Spatially and Temporally Varying Coefficient Models Using Generalized Additive Models
Overview
A framework for undertaking space and time varying coefficient models (varying parameter models) using a Generalized Additive Model (GAM) with smooths approach. The framework suggests the need to investigate for the presence and nature of any space-time dependencies in the data. It proposes a workflow that creates and refines an initial space-time GAM and includes tools to create and evaluate multiple model forms. The workflow sequence is to: i) Prepare the data by lengthening it to have a single location and time variables for each observation. ii) Create all possible space and/or time models in which each predictor is specified in different ways in smooths. iii) Evaluate each model via their AIC value and pick the best one. iv) Create the final model. v) Calculate the varying coefficient estimates to quantify how the relationships between the target and predictor variables vary over space, time or space-time. vi) Create maps, time series plots etc. The number of knots used in each smooth can be specified directly or iteratively increased. This is illustrated with a climate point dataset of the dry rain forest in South America. This builds on work in Comber et al (2024) doi:10.1080/13658816.2023.2270285 and Comber et al (2026) doi:10.1080/13658816.2026.2671964.
- update to main function (
evaluate_models()) with fast GAM option usingmgcv::bam - update to
gam_model_rank()function to includekin the results
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-08
- NOTE12 OK, 1 NOTE2026-06-07
- OK14 OK2026-03-10
Documentation
- Help pages
- 6 (1 internal)includes a package overview page
- Examples that run
- 80%4 run in a plain check · 1 never run
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- not measured
- Median days to close, 50 most recently updated closed PRs
- 1
Commits over time
3 development-tooling and community-health practices detected across 2 families in the upstream repository
Checks run against github.com/lexcomber/stgam on 2026-10-25.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Dependencies
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 1.2.1Latest
- RR 4.6.0 released · 2026-04-24
- 1.2.0
- 1.1.02025-08-27 · diff ↗
- 1.0.22025-06-12 · diff ↗
- 1.0.12025-06-07 · diff ↗
- 1.0.02025-05-12 · diff ↗ ·
removed 4 exports
do_bma, gam_model_probs, plot_1d_smooth, plot_2d_smoothadded 1 export
gam_model_rank - RR 4.5.0 released · 2025-04-11
- 0.0.1.22024-07-31 · diff ↗
- 0.0.1.12024-07-12 · diff ↗
- 0.0.1.02024-06-25
- RR 4.4.0 released · 2024-04-24
Package metadata
- First published
- 2024-06-25
- Total releases
- 9 / 2 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 26 KB / 1 file
- Download size
- 3.3 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("stgam")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-26, which the citation names so these numbers can be found later. More on citing and the projects behind them.