EVOLUTION-MANAGER
Edit File: mgcv-package.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Mixed GAM Computation Vehicle with GCV/AIC/REML smoothness...</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for mgcv.package {mgcv}"><tr><td>mgcv.package {mgcv}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Mixed GAM Computation Vehicle with GCV/AIC/REML smoothness estimation and GAMMs by REML/PQL </h2> <h3>Description</h3> <p><code>mgcv</code> provides functions for generalized additive modelling (<code><a href="gam.html">gam</a></code> and <code><a href="bam.html">bam</a></code>) and generalized additive mixed modelling (<code><a href="gamm.html">gamm</a></code>, and <code><a href="random.effects.html">random.effects</a></code>). The term GAM is taken to include any model dependent on unknown smooth functions of predictors and estimated by quadratically penalized (possibly quasi-) likelihood maximization. Available distributions are covered in <code><a href="family.mgcv.html">family.mgcv</a></code> and available smooths in <code><a href="smooth.terms.html">smooth.terms</a></code>. </p> <p>Particular features of the package are facilities for automatic smoothness selection (Wood, 2004, 2011), 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 available. In addition to the main modelling functions, <code><a href="jagam.html">jagam</a></code> provided facilities to ease the set up of models for use with JAGS, while <code><a href="ginla.html">ginla</a></code> provides marginal inference via a version of Integrated Nested Laplace Approximation. </p> <h3>Details</h3> <p><code>mgcv</code> provides generalized additive modelling functions <code><a href="gam.html">gam</a></code>, <code><a href="predict.gam.html">predict.gam</a></code> and <code><a href="plot.gam.html">plot.gam</a></code>, 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 <code><a href="summary.gam.html">summary.gam</a></code> and <code><a href="anova.gam.html">anova.gam</a></code> are also provided, for extracting information from a fitted <code><a href="gamObject.html">gamObject</a></code>. </p> <p>Use of <code><a href="gam.html">gam</a></code> is much like use of <code><a href="../../stats/html/glm.html">glm</a></code>, except that within a <code>gam</code> model formula, isotropic smooths of any number of predictors can be specified using <code><a href="s.html">s</a></code> terms, while scale invariant smooths of any number of predictors can be specified using <code><a href="te.html">te</a></code>, <code><a href="te.html">ti</a></code> or <code><a href="t2.html">t2</a></code> terms. <code><a href="smooth.terms.html">smooth.terms</a></code> provides an overview of the built in smooth classes, and <code><a href="random.effects.html">random.effects</a></code> should be refered to for an overview of random effects terms (see also <code><a href="smooth.construct.mrf.smooth.spec.html">mrf</a></code> for Markov random fields). Estimation is by penalized likelihood or quasi-likelihood maximization, with smoothness selection by GCV, GACV, gAIC/UBRE or (RE)ML. See <code><a href="gam.html">gam</a></code>, <code><a href="gam.models.html">gam.models</a></code>, <code><a href="linear.functional.terms.html">linear.functional.terms</a></code> and <code><a href="gam.selection.html">gam.selection</a></code> for some discussion of model specification and selection. For detailed control of fitting see <code><a href="gam.convergence.html">gam.convergence</a></code>, <code><a href="gam.html">gam</a></code> arguments <code>method</code> and <code>optimizer</code> and <code><a href="gam.control.html">gam.control</a></code>. For checking and visualization see <code><a href="gam.check.html">gam.check</a></code>, <code><a href="choose.k.html">choose.k</a></code>, <code><a href="vis.gam.html">vis.gam</a></code> and <code><a href="plot.gam.html">plot.gam</a></code>. While a number of types of smoother are built into the package, it is also extendable with user defined smooths, see <code><a href="smooth.construct.html">smooth.construct</a></code>, for example. </p> <p>A Bayesian approach to smooth modelling is used to derive standard errors on predictions, and hence credible intervals (see Marra and Wood, 2012). The Bayesian covariance matrix for the model coefficients is returned in <code>Vp</code> of the <code><a href="gamObject.html">gamObject</a></code>. See <code><a href="predict.gam.html">predict.gam</a></code> 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 (see Wood, 2013a,b). Frequentist approximations can be used for hypothesis testing based model comparison. See <code><a href="anova.gam.html">anova.gam</a></code> and <code><a href="summary.gam.html">summary.gam</a></code> for more on hypothesis testing. </p> <p>For large datasets (that is large n) see <code><a href="bam.html">bam</a></code> which is a version of <code><a href="gam.html">gam</a></code> with a much reduced memory footprint. </p> <p>The package also provides a generalized additive mixed modelling function, <code><a href="gamm.html">gamm</a></code>, based on a PQL approach and <code>lme</code> from the <code>nlme</code> library (for an <code>lme4</code> based version, see package <code>gamm4</code>). <code>gamm</code> 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 <code><a href="magic.html">magic</a></code> can fit models to data with a known correlation structure. </p> <p>Some underlying GAM fitting methods are available as low level fitting functions: see <code><a href="magic.html">magic</a></code>. But there is little functionality that can not be more conventiently accessed via <code><a href="gam.html">gam</a></code> . Penalized weighted least squares with linear equality and inequality constraints is provided by <code><a href="pcls.html">pcls</a></code>. </p> <p>For a complete list of functions type <code>library(help=mgcv)</code>. See also <code><a href="mgcv-FAQ.html">mgcv.FAQ</a></code>. </p> <h3>Author(s)</h3> <p>Simon Wood <simon.wood@r-project.org> </p> <p>with contributions and/or help from Natalya Pya, Thomas Kneib, Kurt Hornik, Mike Lonergan, Henric Nilsson, Fabian Scheipl and Brian Ripley. </p> <p>Polish translation - Lukasz Daniel; German translation - Chris Leick, Detlef Steuer; French Translation - Philippe Grosjean </p> <p>Maintainer: Simon Wood <simon.wood@r-project.org> </p> <p>Part funded by EPSRC: EP/K005251/1 </p> <h3>References</h3> <p>These provide details for the underlying mgcv methods, and fuller references to the large literature on which the methods are based. </p> <p>Wood, S.N., N. Pya and B. Saefken (2016), Smoothing parameter and model selection for general smooth models (with discussion). Journal of the American Statistical Association 111, 1548-1575 <a href="http://dx.doi.org/10.1080/01621459.2016.1180986">http://dx.doi.org/10.1080/01621459.2016.1180986</a> </p> <p>Wood, S.N. (2011) Fast stable restricted maximum likelihood and marginal likelihood estimation of semiparametric generalized linear models. Journal of the Royal Statistical Society (B) 73(1):3-36 </p> <p>Wood, S.N. (2004) Stable and efficient multiple smoothing parameter estimation for generalized additive models. J. Amer. Statist. Ass. 99:673-686. </p> <p>Marra, G and S.N. Wood (2012) Coverage Properties of Confidence Intervals for Generalized Additive Model Components. Scandinavian Journal of Statistics, 39(1), 53-74. </p> <p>Wood, S.N. (2013a) A simple test for random effects in regression models. Biometrika 100:1005-1010 </p> <p>Wood, S.N. (2013b) On p-values for smooth components of an extended generalized additive model. Biometrika 100:221-228 </p> <p>Wood, S.N. (2017) <em>Generalized Additive Models: an introduction with R (2nd edition)</em>, CRC </p> <p>Development of mgcv version 1.8 was part funded by EPSRC grants EP/K005251/1 and EP/I000917/1. </p> <h3>Examples</h3> <pre> ## see examples for gam and gamm </pre> <hr /><div style="text-align: center;">[Package <em>mgcv</em> version 1.8-28 <a href="00Index.html">Index</a>]</div> </body></html>