Gratia: An R package for exploring generalized additive models
Gavin L. Simpson

TL;DR
The gratia R package enhances the usability of generalized additive models by providing tidy, ggplot2-compatible visualization, diagnostics, and sampling functions, simplifying analysis and teaching of GAMs.
Contribution
It introduces a comprehensive R package that builds on mgcv to facilitate easier exploration, visualization, and understanding of GAMs using a tidy approach.
Findings
Provides ggplot2-compatible plots for GAMs
Includes functions for model diagnostics and posterior sampling
Facilitates teaching and understanding of GAMs
Abstract
Generalized additive models (GAMs, Hastie & Tibshirani, 1990; Wood, 2017) are an extension of the generalized linear model that allows the effects of covariates to be modelled as smooth functions. GAMs are increasingly used in many areas of science (e.g. Pedersen, Miller, Simpson, & Ross, 2019; Simpson, 2018) because the smooth functions allow nonlinear relationships between covariates and the response to be learned from the data through the use of penalized splines. Within the R (R Core Team, 2024) ecosystem, Simon Wood's mgcv package (Wood, 2017) is widely used to fit GAMs and is a Recommended package that ships with R as part of the default install. A growing number of other R packages build upon mgcv, for example as an engine to fit specialised models not handled by mgcv itself (e.g. GJMR, Marra & Radice, 2023), or to make use of the wide range of splines available in mgcv (e.g.…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsData Analysis with R
