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, Cross Validation and similar, or using iterated nested Laplace approximation for fully Bayesian inference. See Wood (2025) for an overview. Includes a gam() function, a wide variety of smoothers, 'JAGS' support and distributions beyond the exponential family.


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("mgcv")

1.9-4 by Simon Wood, a year ago


Browse source code at https://github.com/cran/mgcv


Authors: Simon Wood [aut, cre]


Documentation:   PDF Manual  


GPL (>= 2) license


Imports methods, stats, graphics, Matrix, splines, utils

Depends on nlme

Suggests parallel, survival, MASS


Imported by APCtools, AQEval, ATbounds, AnchorRegression, BNSP, BSTFA, BioIndex, BioPred, CICI, CIMTx, CKLRT, CatPredi, ComBatFamQC, DeltaTools, Desimml, EPLSIM, EcoNiche, EconEvalR, Epi, FCGR, FDboost, FESta, FLightR, FSSgam, FWDselect, GJRM, GPFDA, HLMdiag, Haplin, IADT, IVDML, JWileymisc, KarsTS, LFApp, LMERConvenienceFunctions, LaMa, MBHdesign, MBSGS, MECfda, MFPCA, MHCtools, MHTrajectoryR, MRFcov, MRTAnalysis, MUVR2, MicrobTiSDA, ModelMap, MultiSpline, MvBinary, NADA2, NCC, PolicyPortfolios, PupilPre, PupillometryR, QRM, RAPTOR, RFAE, RLRsim, RMSTpowerBoost, RPPASPACE, RcmdrPlugin.HH, SEERaBomb, SEMgraph, SPACO, SSDM, SensMap, SmoothPLS, StatDA, SurvSPro, TAG, TSA, TSrepr, Toothnroll, TwoDiRef, UKBAnalytica, Unico, VDPO, VWPre, VarSelLCM, ViroReportR, WVPlots, WhiteStripe, achieveGap, adjoin, analogue, anipaths, archeoViz, aspline, autoFRK, autogam, baker, bayesdfa, baytrends, betaStability, blocs, brms, buildmer, cAIC4, caffsim, car, casebase, catfda, causaldrf, causalreg, cfbfastR, cfda, cgaim, circularEV, climatehealth, clustra, cohetsurr, cohorttools, collin, collinear, colordistance, cpam, crosslag, ctmva, curvir, cvmaPLFAM, dScoreTest, dampack, dataquieR, demography, dendRoAnalyst, disbayes, discSurv, dlim, dlmtree, dlnm, dsims, dsp, ecoCopula, ecorisk, ecostats, ef, ega, elastes, elcf4R, emon, enmSdmX, enmpa, evgam, exmort, ez, fPASS, fRegression, face, fahb, fastFGEE, fastFMM, fdasrvf, fdclassify, fic, flexmsm, funcharts, funcml, funreg, funspace, galamm, gamCopula, gamRR, gamutil, gapclosing, gdam, geoGAM, geoaddSAE2, ggiraphExtra, ggvfields, gllvm, glmmTMB, gmfamm, goeveg, gplsim, grafify, gratia, groc, growthTrendR, hdtg, hyper.gam, iRegression, iTensor, insurancerating, interflex, invacost, janusplot, jmSurface, ks, kuenm2, landsat, lmviz, loa, localIV, logistf, longsurr, lspartition, metagam, mevr, mfaces, mgwrsar, micemd, mirt, modelSelection, morphomap, mrangr, mrds, mudfold, multifamm, mvabund, mvgam, mxfda, nadir, nfl4th, nflfastR, nlraa, nonnet, nowcaster, npregfast, oRaklE, oddsratio, oddstream, openair, optimalThreshold, ordgam, outrigger, pagoda2, palaeoSig, pammtools, particles, pcvr, penfa, pep725, plsmselect, pmcalibration, poissonsuperlearner, poptrend, ppgam, precmed, presmTP, projpred, psme, psre, psychonetrics, pwSEM, qfa, r2glmm, r4pde, rTG, randnet, rbiom, recolorize, redlistr, refitME, refreg, refund, refundBayes, registr, reldist, rioja, roseRF, rstpm2, rticulate, scam, sdPrior, sdmTMB, secr, serosv, simPH, simml, simsl, sisal, sjSDM, skedastic, smimodel, smurf, soilhypfit, spatstat.model, spconf, splinemixmeta, spotr, starsExtra, statuser, stopp, tableeasy, tf, tidyILD, tidygam, tidyvpc, tinyVAST, tourr, trace, trackeRapp, tramME, trendtestR, tripEstimation, tukeytrend, tvGarchKF, tvcure, vegan, vglmer, virtualPollen, vital, voi, weightedGCM, winn, wqtrends, xwf, zetadiv.

Depended on by AuxSurvey, CONCUR, FlexGAM, KnowBR, MJMbamlss, NIRStat, PanJen, R2BayesX, TSVC, TTS, additive, aplms, bamlss, bgeva, cenGAM, coenoflex, datanugget, denseFLMM, dsm, fda.usc, frailtyMMpen, gKRLS, gam.hp, gamlss.add, gamm4, gammSlice, hmmTMB, ibr, ismev, itsadug, labdsv, mgcViz, multipleNCC, multiridge, personalized, qgam, semsfa, sparseFLMM, spboost, sspm, stgam, structree, tvem.

Suggested by AIBias, AgriFusionR, AlleleShift, BCEA, BioMixModel, BiodiversityR, CalibrationCurves, CausalState, ContourFunctions, DAAG, DHARMa, DPQ, DynNom, ENMTools, EcoEnsemble, EmpiricalDynamics, ForeCA, GeneralizedUmatrix, GeneralizedUmatrixGPU, HRW, HSAUR2, HSAUR3, IRon, LinRegInteractive, Mapinguari, MatchIt, MuMIn, PatientLevelPrediction, PenCoxFrail, ProjectionBasedClustering, R4VN, Rcmdr, RegCalReliab, SCoRES, SentimentAnalysis, SimplyAgree, SuperSurv, Surrogate, TemporalModelR, VGAM, VIM, ZeBook, agridat, ale, amorem, animint2, apsimx, assessor, auditor, bases, bestNormalize, biomod2, broom, broom.helpers, broom.mixed, butcher, caret, caretEnsemble, cassowaryr, catdata, circhelp, civic.icarm, clarify, condvis2, countSTAR, csemGT, ctmcmove, curves, cutpointr, dbw, densitr, detrendr, earth, easyViz, ebrahim.gof, effectsize, emmeans, eyeprocess, fdapace, flexmix, flextable, freqparcoord, futurize, gamair, gamclass, gcplyr, gdpar, ggcube, ggdibbler, ggeffects, ggkodom, ggplot2, ggvis, gp3sequences, gp3tools, granova, halfmoon, hbsaems, heemod, heteroTests, icarm, influential, inlabru, insight, kerasnip, latticeExtra, lazyData, lme4, lmls, longRPart2, loon, macleish, marginaleffects, mcmcsae, mediation, mellio, mlt.docreg, modelbased, modelsummary, mpae, multidplyr, munsellinterpol, mvtweedie, myTAI, openairmaps, pacu, parameters, parsnip, performance, phontrast, plotluck, pminternal, polle, probably, propensity, pscl, quantregGrowth, rassta, remap, riskRegression, rpanel, rstanarm, rtemis, sageR, scar, see, seqwrap, sfislands, shapr, simex, simstudy, sits, spatialEco, spatialrisk, spatialwarnings, spicy, splineplot, statlingua, tailor, targeted, tidyfun, tidysdm, tinycodet, tram, treedater, tune, vetiver, vinereg, weights, weird.

Enhanced by diseasemapping, sfsmisc, stargazer.


See at CRAN