mgcv (version 1.3-22)

gamObject: Fitted gam object

Description

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.

Arguments

Value

  • A gam object has the following elements:
  • aicAIC 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.
  • assignArray whose elements indicate which model term (listed in pterms) each parameter relates to: applies only to non-smooth terms.
  • boundarydid parameters end up at boundary of parameter space?
  • callthe matched call (allows update to be used with gam objects, for example).
  • coefficientsthe coefficients of the fitted model. Parametric coefficients are first, followed by coefficients for each spline term in turn.
  • controlthe gam control list used in the fit.
  • convergedindicates whether or not the iterative fitting method converged.
  • datathe original supplied data argument (for class "glm" compatibility).
  • deviancemodel deviance (not penalized deviance).
  • df.nullnull degrees of freedom.
  • df.residualeffective residual degrees of freedom of the model.
  • edfestimated degrees of freedom for each model parameter. Penalization means that many of these are less than 1.
  • familyfamily object specifying distribution and link used.
  • fit.methodCharacter string describing the multiple GCV/UBRE smoothing parameter estimation method used.
  • fitted.valuesfitted model predictions of expected value for each datum.
  • formulathe model formula.
  • full.formulathe 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.ubreThe minimized GCV or UBRE score.
  • hatarray of elements from the leading diagonal of the `hat' (or `influence') matrix. Same length as response data vector.
  • iternumber of iterations of P-IRLS taken to get convergence.
  • linear.predictorsfitted model prediction of link function of expected value for each datum.
  • methodOne of "GCV" or "UBRE", depending on the fitting criterion used.
  • mgcv.convA list of convergence diagnostics relating to the "mgcv" or "magic" parts of smoothing parameter estimation - this will not be very meaningful for pure "outer" estimation of smoothing parameters. mgcv.conv differs for method "magic" and "mgcv". Here is the "mgcv" version:

    score{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.}

    iter{the number of iterations taken.}

    in.ok{TRUE if the second smoothing parameter guess improved the GCV/UBRE score.}

    step.fail{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:

    full.rank{The apparent rank of the problem given the model matrix and constraints.}

    rank{The numerical rank of the problem.}

    fully.converged{TRUE is multiple GCV/UBRE converged by meeting convergence criteria. FALSE if method stopped with a steepest descent step failure.}

    hess.pos.def{Was the hessian of the GCV/UBRE score positive definite at smoothing parameter estimation convergence?}

    iter{How many iterations were required to find the smoothing parameters?}

    score.calls{and how many times did the GCV/UBRE score have to be evaluated?}

    rms.grad{root mean square of the gradient of the GCV/UBRE score at convergence.}

  • min.edfMinimum possible degrees of freedom for whole model.
  • modelmodel frame containing all variables needed in original model fit.
  • na.actionThe na.action used in fitting.
  • nsdfnumber of parametric, non-smooth, model terms including the intercept.
  • null.deviancedeviance for single parameter model.
  • offsetmodel offset.
  • outer.infoIf `outer' iteration has been used to fit the model (see gam.method) then this is present and contains whatever was returned by the optimization routine used (currently nlm or optim).
  • prior.weightsprior weights on observations.
  • ptermsterms object for strictly parametric part of model.
  • rankapparent rank of fitted model.
  • residualsthe working residuals for the fitted model.
  • sig2estimated or supplied variance/scale parameter.
  • smoothlist 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.
  • spsmoothing parameter for each smooth.
  • termsterms object of model model frame.
  • Vpestimated covariance matrix for the parameters. This is a Bayesian posterior covariance matrix that results from adopting a particular Bayesian model of the smoothing process. Paricularly useful for creating credible/confidence intervals.
  • Vefrequentist estimated covariance matrix for the parameter estimators. Particularly useful for testing whether terms are zero. Not so useful for CI's as smooths are usually biased.
  • weightsfinal weights used in IRLS iteration.
  • yresponse data.

WARNINGS

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

References

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. (2006) Low rank scale invariant tensor product smooths for generalized additive mixed models. Biometrics.

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

See Also

gam