Package: mgcv 1.9-1

Simon Wood

mgcv: Mixed GAM Computation Vehicle with Automatic Smoothness Estimation

Generalized additive (mixed) models, some of their extensions and other generalized ridge regression with multiple smoothing parameter estimation by (Restricted) Marginal Likelihood, Generalized Cross Validation and similar, or using iterated nested Laplace approximation for fully Bayesian inference. See Wood (2017) <doi:10.1201/9781315370279> for an overview. Includes a gam() function, a wide variety of smoothers, 'JAGS' support and distributions beyond the exponential family.

Authors:Simon Wood <[email protected]>

mgcv_1.9-1.tar.gz
mgcv_1.9-1.zip(r-4.5)mgcv_1.9-1.zip(r-4.4)mgcv_1.9-1.zip(r-4.3)
mgcv_1.9-1.tgz(r-4.4-x86_64)mgcv_1.9-1.tgz(r-4.4-arm64)mgcv_1.9-1.tgz(r-4.3-x86_64)mgcv_1.9-1.tgz(r-4.3-arm64)
mgcv_1.9-1.tar.gz(r-4.5-noble)mgcv_1.9-1.tar.gz(r-4.4-noble)
mgcv_1.9-1.tgz(r-4.4-emscripten)mgcv_1.9-1.tgz(r-4.3-emscripten)
mgcv.pdf |mgcv.html
mgcv/json (API)

# Install 'mgcv' in R:
install.packages('mgcv', repos = c('https://staffanbetner.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Uses libs:
  • openblas– Optimized BLAS
  • openmp– GCC OpenMP (GOMP) support library
Datasets:
  • columb - Reduced version of Columbus OH crime data
  • columb.polys - Reduced version of Columbus OH crime data

On CRAN:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

12.88 score 31 stars 7.7k packages 17k scripts 63k downloads 1.3k mentions 185 exports 3 dependencies

Last updated 11 months agofrom:aff4560d18. Checks:OK: 9. Indexed: no.

TargetResultDate
Doc / VignettesOKOct 31 2024
R-4.5-win-x86_64OKOct 31 2024
R-4.5-linux-x86_64OKOct 31 2024
R-4.4-win-x86_64OKOct 31 2024
R-4.4-mac-x86_64OKOct 31 2024
R-4.4-mac-aarch64OKOct 31 2024
R-4.3-win-x86_64OKOct 31 2024
R-4.3-mac-x86_64OKOct 31 2024
R-4.3-mac-aarch64OKOct 31 2024

Exports:%.%anova.gambambam.updatebandcholbetarblas.thread.testcholdropcholupcnormconcurvitycox.phcSplineDesd.mvtdDetadiagXVXddmvndpnormexclude.too.farextract.lme.covextract.lme.cov2FFdesfix.family.linkfix.family.lsfix.family.qffix.family.rdfix.family.varfixDependenceformula.gamformXtViXfs.boundaryfs.testfull.scoregamgam.checkgam.controlgam.fitgam.fit3gam.fit5.post.procgam.mhgam.outergam.reparamgam.sidegam.vcompgam2derivativegam2objectivegamlss.etamugamlss.gHgammgammalsgamSimgaulssget.vargevlssgfamginlagumblsin.outinfluence.gaminitial.spinSideinterpret.gamjagamk.checkldetSldTweedielogLik.gamls.sizemagicmagic.post.procmini.rootsmodel.matrix.gammono.conmrootmultinommvnnbnegbinnew.namenotExpnotExp2notLognotLog2null.space.dimensionocatpclspdIdnotpdTenspen.edfplace.knotsplot.gampolys.plotpredict.bampredict.gamPredict.matrixPredict.matrix.Bspline.smoothPredict.matrix.cr.smoothPredict.matrix.cs.smoothPredict.matrix.cyclic.smoothPredict.matrix.duchon.splinePredict.matrix.gp.smoothPredict.matrix.mrf.smoothPredict.matrix.pspline.smoothPredict.matrix.random.effectPredict.matrix.sfPredict.matrix.soap.filmPredict.matrix.sos.smoothPredict.matrix.swPredict.matrix.t2.smoothPredict.matrix.tensor.smoothPredict.matrix.tprs.smoothPredict.matrix.ts.smoothPredict.matrix2PredictMatprint.anova.gamprint.gamprint.summary.gampsum.chisqqq.gamr.mvtresiduals.gamrigrmvnRrankrTweediesscatsdiagsdiag<-shashsim2jamSl.inirepSl.initial.reparaSl.reparaSl.setupslanczossmooth.constructsmooth.construct.ad.smooth.specsmooth.construct.bs.smooth.specsmooth.construct.cc.smooth.specsmooth.construct.cp.smooth.specsmooth.construct.cr.smooth.specsmooth.construct.cs.smooth.specsmooth.construct.ds.smooth.specsmooth.construct.gp.smooth.specsmooth.construct.mrf.smooth.specsmooth.construct.ps.smooth.specsmooth.construct.re.smooth.specsmooth.construct.sf.smooth.specsmooth.construct.so.smooth.specsmooth.construct.sos.smooth.specsmooth.construct.sw.smooth.specsmooth.construct.t2.smooth.specsmooth.construct.tensor.smooth.specsmooth.construct.tp.smooth.specsmooth.construct.ts.smooth.specsmooth.construct2smooth.infosmooth2randomsmoothConsp.vcovspasm.constructspasm.smoothspasm.spsummary.gamt2tetensor.prod.model.matrixtensor.prod.penaltiestitotalPenaltySpacetricholtrind.generatortwTweedietwlssuniquecombsvcov.gamvis.gamXbdXWXdXWydziPzipllziplss

Dependencies:latticeMatrixnlme

Readme and manuals

Help Manual

Help pageTopics
Approximate hypothesis tests related to GAM fitsanova.gam print.anova.gam
Generalized additive models for very large datasetsbam
Update a strictly additive bam model for new data.bam.update
Choleski decomposition of a band diagonal matrixbandchol
GAM beta regression familybetar
BLAS thread safetyblas.thread.test
Reporting mgcv bugs.bug.reports.mgcv
Deletion and rank one Cholesky factor updatecholdrop cholup
Basis dimension choice for smoothschoose.k
GAM censored normal family for log-normal AFT and Tobit modelscnorm Tobit
Reduced version of Columbus OH crime datacolumb columb.polys
GAM concurvity measuresconcurvity
Additive Cox Proportional Hazard Modelcox.ph
Additive Cox proportional hazard models with time varying covariatescox.pht
Evaluate cyclic B spline basiscSplineDes
Obtaining derivative w.r.t. linear predictordDeta
Stable evaluation of difference between normal c.d.f.sdpnorm
Exclude prediction grid points too far from dataexclude.too.far
Extract the data covariance matrix from an lme objectextract.lme.cov extract.lme.cov2
Factor smooth interactions in GAMsfactor.smooth factor.smooth.interaction
Distribution families in mgcvfamily.mgcv
Level 5 fractional factorial designsFFdes
Modify families for use in GAM fitting and checkingfix.family.link fix.family.ls fix.family.qf fix.family.rd fix.family.var
Detect linear dependencies of one matrix on anotherfixDependence
GAM formulaformula.gam
Form component of GAMM covariance matrixformXtViX
FELSPLINE test functionfs.boundary fs.test
GCV/UBRE score for use within nlmfull.score
Generalized additive models with integrated smoothness estimationgam
Some diagnostics for a fitted gam modelgam.check
Setting GAM fitting defaultsgam.control
GAM convergence and performance issuesgam.convergence gam.performance
GAM P-IRLS estimation with GCV/UBRE smoothness estimationgam.fit
P-IRLS GAM estimation with GCV, UBRE/AIC or RE/ML derivative calculationgam.fit3
Post-processing output of gam.fit5gam.fit5.post.proc
Simple posterior simulation with gam fitsgam.mh posterior.simulation
Specifying generalized additive modelsgam.models
Minimize GCV or UBRE score of a GAM using `outer' iterationgam.outer
Finding stable orthogonal re-parameterization of the square root penalty.gam.reparam
Scale parameter estimation in GAMsgam.scale
Generalized Additive Model Selectiongam.selection
Identifiability side conditions for a GAMgam.side
Report gam smoothness estimates as variance componentsgam.vcomp
Objective functions for GAM smoothing parameter estimationgam2derivative gam2objective
Transform derivatives wrt mu to derivatives wrt linear predictorgamlss.etamu
Calculating derivatives of log-likelihood wrt regression coefficientsgamlss.gH
Generalized Additive Mixed Modelsgamm
Gamma location-scale model familygammals
Fitted gam objectgamObject
Simulate example data for GAMsgamSim
Gaussian location-scale model familygaulss
Get named variable or evaluate expression from list or data.frameget.var
Generalized Extreme Value location-scale model familygevlss
Grouped familiesgfam grouped families
GAM Integrated Nested Laplace Approximation Newton Enhancedginla
Gumbel location-scale model familygumbls
Identifiability constraintsidentifiability
Which of a set of points lie within a polygon defined regionin.out
Extract the diagonal of the influence/hat matrix for a GAMinfluence.gam
Starting values for multiple smoothing parameter estimationinitial.sp
Are points inside boundary?inSide
Interpret a GAM formulainterpret.gam
Just Another Gibbs Additive Modeller: JAGS support for mgcv.jagam sim2jam
Checking smooth basis dimensionk.check
Getting log generalized determinant of penalty matricesldetS
Log Tweedie density evaluationldTweedie
Linear functionals of a smooth in GAMsfunction.predictors linear.functional.terms signal.regression
AIC and Log likelihood for a fitted GAMAIC.gam logLik.gam
Size of list elementsls.size
Stable Multiple Smoothing Parameter Estimation by GCV or UBREmagic
Auxilliary information from magic fitmagic.post.proc
Frequently Asked Questions for package mgcvmgcv.FAQ
Mixed GAM Computation Vehicle with GCV/AIC/REML/NCV smoothness estimation and GAMMs by REML/PQLmgcv-package mgcv mgcv.package
Parallel computation in mgcv.mgcv.parallel
Obtain square roots of penalty matricesmini.roots
Missing data in GAMsmissing.data
Extract model matrix from GAM fitmodel.matrix.gam
Monotonicity constraints for a cubic regression splinemono.con
Smallest square root of matrixmroot
GAM multinomial logistic regressionmultinom
Multivariate normal additive modelsmvn
Neighbourhood Cross ValidationNCV
GAM negative binomial familiesnb negbin
Obtain a name for a new variable that is not already in usenew.name
Functions for better-than-log positive parameterizationnotExp notLog
Alternative to log parameterization for variance componentsnotExp2 notLog2
The basis of the space of un-penalized functions for a TPRSnull.space.dimension
GAM ordered categorical familyocat ordered.categorical
The one standard error rule for smoother modelsone.se.rule
Penalized Constrained Least Squares Fittingpcls
Overflow proof pdMat class for multiples of the identity matrixcoef.pdIdnot corMatrix.pdIdnot Dim.pdIdnot logDet.pdIdnot pdConstruct.pdIdnot pdFactor.pdIdnot pdIdnot pdMatrix.pdIdnot solve.pdIdnot summary.pdIdnot
Functions implementing a pdMat class for tensor product smoothscoef.pdTens pdConstruct.pdTens pdFactor.pdTens pdMatrix.pdTens pdTens summary.pdTens
Extract the effective degrees of freedom associated with each penalty in a gam fitpen.edf
Automatically place a set of knots evenly through covariate valuesplace.knots
Default GAM plottingplot.gam
Plot geographic regions defined as polygonspolys.plot
Prediction from fitted Big Additive Model modelpredict.bam
Prediction from fitted GAM modelpredict.gam
Prediction methods for smooth terms in a GAMPredict.matrix Predict.matrix2
Predict matrix method functionsPredict.matrix.cr.smooth Predict.matrix.cs.smooth Predict.matrix.cyclic.smooth Predict.matrix.pspline.smooth Predict.matrix.t2.smooth Predict.matrix.tensor.smooth Predict.matrix.tprs.smooth Predict.matrix.ts.smooth
Prediction matrix for soap film smoothPredict.matrix.sf Predict.matrix.soap.film Predict.matrix.sw
Print a Generalized Additive Model object.print.gam
Evaluate the c.d.f. of a weighted sum of chi-squared deviatespsum.chisq
QQ plots for gam model residualsqq.gam
Random effects in GAMsrandom.effects
Generalized Additive Model residualsresiduals.gam
Generate inverse Gaussian random deviatesrig
Generate from or evaluate multivariate normal or t densities.d.mvt dmvn r.mvt rmvn
Find rank of upper triangular matrixRrank
Generate Tweedie random deviatesrTweedie
Defining smooths in GAM formulaes
GAM scaled t family for heavy tailed datascat t.scaled
Extract or modify diagonals of a matrixsdiag sdiag<-
Sinh-arcsinh location scale and shape model familyshash
Single index models with mgcvsingle.index
Re-parametrizing model matrix XSl.inirep Sl.initial.repara
Applying re-parameterization from log-determinant of penalty matrix to model matrix.Sl.repara
Setting up a list representing a block diagonal penalty matrixSl.setup
Compute truncated eigen decomposition of a symmetric matrixslanczos
Constructor functions for smooth terms in a GAMsmooth.construct smooth.construct2 user.defined.smooth
Adaptive smooths in GAMsadaptive.smooth smooth.construct.ad.smooth.spec
Penalized B-splines in GAMsb.spline d.spline Predict.matrix.Bspline.smooth smooth.construct.bs.smooth.spec
Penalized Cubic regression splines in GAMscubic.regression.spline cyclic.cubic.spline smooth.construct.cc.smooth.spec smooth.construct.cr.smooth.spec smooth.construct.cs.smooth.spec
Low rank Duchon 1977 splinesDuchon.spline Predict.matrix.duchon.spline smooth.construct.ds.smooth.spec
Factor smooth interactions in GAMsPredict.matrix.fs.interaction smooth.construct.fs.smooth.spec
Low rank Gaussian process smoothsgp.smooth Predict.matrix.gp.smooth smooth.construct.gp.smooth.spec
Markov Random Field Smoothsmrf Predict.matrix.mrf.smooth smooth.construct.mrf.smooth.spec
P-splines in GAMscyclic.p.spline p.spline smooth.construct.cp.smooth.spec smooth.construct.ps.smooth.spec
Simple random effects in GAMsPredict.matrix.random.effect smooth.construct.re.smooth.spec
Soap film smoother constructersmooth.construct.sf.smooth.spec smooth.construct.so.smooth.spec smooth.construct.sw.smooth.spec soap
Splines on the spherePredict.matrix.sos.smooth smooth.construct.sos.smooth.spec Spherical.Spline
Constrained factor smooth interactions in GAMsPredict.matrix.sz.interaction smooth.construct.sz.smooth.spec
Tensor product smoothing constructorsmooth.construct.t2.smooth.spec
Tensor product smoothing constructorsmooth.construct.tensor.smooth.spec
Penalized thin plate regression splines in GAMssmooth.construct.tp.smooth.spec smooth.construct.ts.smooth.spec tprs
Generic function to provide extra information about smooth specificationsmooth.info
Smooth terms in GAMsmooth.terms smooths
Convert a smooth to a form suitable for estimating as random effectsmooth2random
Prediction/Construction wrapper functions for GAM smooth termsPredictMat smoothCon
Extract smoothing parameter estimator covariance matrix from (RE)ML GAM fitsp.vcov
Experimental sparse smoothersspasm.construct spasm.smooth spasm.sp
Alternatives to step.gamstep.gam
Summary for a GAM fitprint.summary.gam summary.gam
Define alternative tensor product smooths in GAM formulaet2
Define tensor product smooths or tensor product interactions in GAM formulaete ti
Row Kronecker product/ tensor product smooth construction%.% tensor.prod.model.matrix tensor.prod.penalties
Obtaining (orthogonal) basis for null space and range of the penalty matrixtotalPenaltySpace
Choleski decomposition of a tri-diagonal matrixtrichol
Generates index arrays for upper triangular storagetrind.generator
GAM Tweedie familiestw Tweedie
Tweedie location scale familytwlss
find the unique rows in a matrixuniquecombs
Extract parameter (estimator) covariance matrix from GAM fitvcov.gam
Visualization of GAM objectspersp.gam vis.gam
Internal functions for discretized model matrix handlingdiagXVXd Xbd XWXd XWyd
GAM zero-inflated (hurdle) Poisson regression familyziP
Zero inflated (hurdle) Poisson location-scale model familyzipll ziplss