mgcv-package              package:mgcv              R Documentation

_G_A_M_s _w_i_t_h _G_C_V _s_m_o_o_t_h_n_e_s_s _e_s_t_i_m_a_t_i_o_n _a_n_d _G_A_M_M_s _b_y _R_E_M_L/_P_Q_L

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

     'mgcv' provides functions for generalized additive modelling  and
     generalized additive mixed modelling. The term GAM is taken to
     include  any GLM estimated by quadratically penalized (possibly
     quasi-) likelihood maximization.

     Particular features of the package are facilities for automatic
     smoothness selection,  and the provision of a variety of smooths
     of more than one variable. User defined  smooths can be added. A
     Bayesian approach to confidence/credible interval calculation is
     provided. Linear functionals of smooths, penalization of
     parametric model terms and linkage  of smoothing parameters are
     all supported. Lower level routines for generalized ridge 
     regression and penalized linearly constrained least squares are
     also provided.

_D_e_t_a_i_l_s:

     'mgcv' provides generalized additive modelling functions 'gam',
     'predict.gam' and 'plot.gam', which are very similar in use to the
     S functions of the same name designed by Trevor Hastie (with some
     extensions).  However the underlying representation and estimation
     of the models is based on a penalized regression spline approach,
     with automatic smoothness selection. A number of other functions 
     such as 'summary.gam' and 'anova.gam'  are also provided, for
     extracting information from a fitted 'gamObject'.

     Use of 'gam' is much like use of 'glm', except that within a 'gam'
     model formula, isotropic smooths of any number of predictors can
     be specified using 's' terms, while scale invariant smooths of any
     number of predictors can be specified using 'te' terms.
     'smooth.terms' provides an  overview of the built in smooth
     classes. Estimation is by penalized likelihood or quasi-likelihood
     maximization, with smoothness selection by GCV or gAIC/ UBRE. See
     'gam', 'gam.models',  'linear.functional.terms' and
     'gam.selection' for some discussion of model specification and
     selection. For detailed control of fitting see 'gam.convergence',
     'gam.method' and 'gam.control'. For checking and visualization see
     'gam.check', 'choose.k', 'vis.gam' and 'plot.gam'. While a number
     of types of smoother are built into the package, it is also
     extendable with user defined smooths, see 'smooth.construct', for
     example.

     A Bayesian approach to smooth modelling is used to derive standard
     errors on predictions, and hence credible intervals. The Bayesian
     covariance matrix for the model coefficients is returned in 'Vp'
     of the 'gamObject'. See 'predict.gam' for examples of how this can
     be used to obtain credible regions for any quantity derived from
     the fitted model, either directly, or by direct simulation from
     the posterior distribution of the model coefficients. Approximate
     p-values can also be obtained for testing  individual smooth terms
     for equality to the zero function, using similar ideas.
     Frequentist approximations can be used for hypothesis testing
     based model comparison. See 'anova.gam' and 'summary.gam' for more
     on hypothesis testing.

     The package also provides a generalized additive mixed modelling
     function, 'gamm', based on a PQL approach and   'lme' from the
     'nlme' library. 'gamm' is particularly useful for modelling
     correlated data (i.e. where a simple independence model for the
     residual variation is inappropriate). In addition, low level
     routine 'magic' can fit models to data with a known correlation
     structure.

     Some underlying GAM fitting methods are available as low level
     fitting functions: see 'magic' and 'mgcv'. But there is little
     functionality  that can not be more conventiently accessed via
     'gam' .  Penalized weighted least squares with linear equality and
     inequality constraints is provided by  'pcls'.

     For a complete list of functions type 'library(help=mgcv)'.

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

     Simon Wood <simon.wood@r-project.org>

     with contributions and/or help from Kurt Hornik, Mike Lonergan,
     Henric Nilsson and Brian Ripley. 

     Maintainer: Simon Wood <simon.wood@r-project.org>

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

     Wood, S.N. (2004) Stable and efficient multiple smoothing
     parameter estimation for generalized additive models. J. Amer.
     Statist. Ass. 99:673-686. 

     Wood, S.N. (2006) _Generalized Additive Models: an introduction
     with R_, CRC

     Wood, S.N. (2008) Fast stable direct fitting and smoothness
     selection for generalized additive models. J.R.Statist.Soc.B
     70(3):495-518

_E_x_a_m_p_l_e_s:

     ## see examples for gam and gamm

