gamObject                package:mgcv                R Documentation

_F_i_t_t_e_d _g_a_m _o_b_j_e_c_t

_D_e_s_c_r_i_p_t_i_o_n:

     A fitted GAM object returned by function 'gam' and of class
     '"gam"' inheriting from classes '"glm"' and '"lm"'. Method
     functions 'anova', 'logLik', 'influence', 'plot', 'predict',
     'print', 'residuals' and 'summary' exist for this class.

     All compulsory elements of '"glm"' and '"lm"' objects are present,
     but the fitting method for a GAM is different to a linear model or
     GLM, so that the elements relating to the QR decomposition of the
     model matrix are absent.

_V_a_l_u_e:

     A 'gam' object has the following elements:

     aic: AIC of the fitted model: bear in mind that the degrees of
          freedom used to calculate this are the effective degrees of
          freedom of the model, and the likelihood is evaluated at the
          maximum of the penalized likelihood in most cases, not at the
          MLE.

  assign: Array whose elements indicate which model term (listed in
          'pterms') each parameter relates to: applies only to
          non-smooth terms.

boundary: did parameters end up at boundary of parameter space?

    call: the matched call (allows 'update' to be used with 'gam'
          objects, for example). 

coefficients: the coefficients of the fitted model. Parametric
          coefficients are  first, followed  by coefficients for each
          spline term in turn.

 control: the 'gam' control list used in the fit.

converged: indicates whether or not the iterative fitting method
          converged.

    data: the original supplied data argument (for class '"glm"'
          compatibility).

deviance: model deviance (not penalized deviance).

 df.null: null degrees of freedom.

df.residual: effective residual degrees of freedom of the model.

     edf: estimated degrees of freedom for each model parameter.
          Penalization means that many of these are less than 1.

  family: family object specifying distribution and link used.

fit.method: The underlying multiple GCV/UBRE method used: '"magic"' 
          for the new more stable method, '"mgcv"' for the Wood (2000)
          method.

fitted.values: fitted model predictions of expected value for each
          datum.

 formula: the model formula.

full.formula: the model formula with each smooth term fully expanded
          and with option arguments given explicitly (i.e. not with
          reference to other variables) - useful for later prediction
          from the model.

gcv.ubre: The minimized GCV or UBRE score.

     hat: array of elements from the leading diagonal of the `hat' (or
          `influence') matrix.  Same length as response data vector.

    iter: number of iterations of P-IRLS taken to get convergence.

linear.predictor: fitted model prediction of link function of expected
          value for  each datum.

  method: Either '"GCV"' or '"UBRE"', depending on smoothing parameter
          selection method used  (or appropriate, if none used).

mgcv.conv: A list of convergence diagnostics relating to smoothing
          parameter estimation. Differs for method '"magic"' and
          '"mgcv"'. Here is  the '"mgcv"' version:

     _s_c_o_r_e corresponding to edf, an array of GCV or UBRE scores for the
          model given the final  estimated relative smoothing
          parameters.

     _g the gradient of the GCV/UBRE score w.r.t. the relative smoothing
          parameters at termination.

     _h the second derivatives corresponding to 'g' above - i.e. the
          leading diagonal of the Hessian.

     _e the eigen-values of the Hessian. All non-negative indicates a
          positive definite Hessian.

     _i_t_e_r the number of iterations taken.

     _i_n._o_k 'TRUE' if the second smoothing parameter guess improved the
          GCV/UBRE score.

     _s_t_e_p._f_a_i_l 'TRUE' if the algorithm terminated by failing to improve
          the GCV/UBRE score rather than by `converging'.  Not
          necessarily a problem, but check the above derivative
          information quite carefully.

          In the case of '"magic"' the items are:

     _f_u_l_l._r_a_n_k The apparent rank of the problem given the model matrix
          and  constraints.

     _r_a_n_k The numerical rank of the problem.

     _f_u_l_l_y._c_o_n_v_e_r_g_e_d 'TRUE' is multiple GCV/UBRE converged by meeting 
          convergence criteria. 'FALSE' if method stopped with a
          steepest descent step  failure.

     _h_e_s_s._p_o_s._d_e_f Was the hessian of the GCV/UBRE score positive
          definite at  smoothing parameter estimation convergence?

     _i_t_e_r How many iterations were required to find the smoothing
          parameters?

     _s_c_o_r_e._c_a_l_l_s and how many times did the GCV/UBRE score have to be
          evaluated?

     _r_m_s._g_r_a_d root mean square of the gradient of the GCV/UBRE score at
           convergence.

 min.edf: Minimum possible degrees of freedom for whole model.

   model: model frame containing all variables needed in original model
          fit.

    nsdf: number of parametric, non-smooth, model terms including the
          intercept.

null.deviance: deviance for single parameter model.

  offset: model offset.

prior.weights: prior weights on observations.

  pterms: 'terms' object for strictly parametric part of model.

    rank: apparent rank of fitted model.

residuals: the working residuals for the fitted model.

    sig2: estimated or supplied variance/scale parameter.

  smooth: list of smooth objects, containing the basis information for
          each term in the  model formula in the order in which they
          appear. These smooth objects are what gets returned by the
          'smooth.construct' objects.

      sp: smoothing parameter for each smooth.

   terms: 'terms' object of 'model' model frame.

      Vp: estimated covariance matrix for the parameters. This is a
          Bayesian posterior covariance matrix that results from
          adopting a particular Bayesian model of the smoothing
          process.

 weights: final weights used in IRLS iteration.

       y: response data.

_W_A_R_N_I_N_G_S:

     This model object is different to that described in Chambers and
     Hastie (1993) in order to allow smoothing parameter estimation
     etc.

_A_u_t_h_o_r(_s):

     Simon N. Wood simon@stats.gla.ac.uk

_R_e_f_e_r_e_n_c_e_s:

     Key References on this implementation:

     Wood, S.N. (2000)  Modelling and Smoothing Parameter Estimation
     with Multiple  Quadratic Penalties. J.R.Statist.Soc.B
     62(2):413-428

     Wood, S.N. (2003) Thin plate regression splines. J.R.Statist.Soc.B
     65(1):95-114

     Wood, S.N. (in press) Stable and efficient multiple smoothing
     parameter estimation for generalized additive models. J. Amer.
     Statist. Ass.

     Wood, S.N. (2004) On confidence intervals for GAMs based on
     penalized regression splines. Technical Report 04-12 Department of
     Statistics, University of Glasgow.

     Wood, S.N. (2004) Low rank scale invariant tensor product smooths
     for generalized additive mixed models. Technical Report 04-13
     Department of Statistics, University of Glasgow.

     Key Reference on GAMs and related models:

     Hastie (1993) in Chambers and Hastie (1993) Statistical Models in
     S. Chapman and Hall.

     Hastie and Tibshirani (1990) Generalized Additive Models. Chapman
     and Hall.

     Wahba (1990) Spline Models of Observational Data. SIAM

_S_e_e _A_l_s_o:

     'gam'

