Package: stgam 1.2.0

stgam: Spatially and Temporally Varying Coefficient Models Using Generalized Additive Models

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 (2004) <doi:10.3390/ijgi13120459>.

Authors:Lex Comber [aut, cre], Paul Harris [ctb], Gonzalo Irisarri [ctb], Chris Brunsdon [ctb]

stgam_1.2.0.tar.gz
stgam_1.2.0.zip(r-4.7)stgam_1.2.0.zip(r-4.6)stgam_1.2.0.zip(r-4.5)
stgam_1.2.0.tgz(r-4.6-any)stgam_1.2.0.tgz(r-4.5-any)
stgam_1.2.0.tar.gz(r-4.6-any)stgam_1.2.0.tar.gz(r-4.5-any)
stgam_1.2.0.tgz(r-4.5-emscripten)
stgam.pdf |stgam.html
stgam/json (API)
NEWS

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

Bug tracker:https://github.com/lexcomber/stgam/issues

Datasets:
  • chaco - Chaco dry rainforest data

On CRAN:

Conda:

6.32 score 7 stars 8 scripts 278 downloads 4 exports 26 dependencies

Last updated from:ffbc74f835. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK179
source / vignettesOK249
linux-release-x86_64OK149
macos-release-arm64OK98
macos-oldrel-arm64OK101
windows-develOK126
windows-releaseOK136
windows-oldrelOK152
wasm-releaseOK161

Exports:calculate_vcseffect_sizeevaluate_modelsgam_model_rank

Dependencies:clicodetoolsdoParalleldplyrforeachgenericsglueiteratorslatticelifecyclemagrittrMatrixmgcvnlmepillarpkgconfigpurrrR6rlangstringistringrtibbletidyselectutf8vctrswithr

A Geographer's introduction to GAMs

Rendered fromstgam_intro_chaco.Rmdusingknitr::rmarkdownon Apr 13 2026.

Last update: 2026-04-13
Started: 2026-01-26

A Geographer's introduction to space-time regression with GAMs using stgam

Rendered fromstgam_vc_models_chaco.Rmdusingknitr::rmarkdownon Apr 13 2026.

Last update: 2026-04-13
Started: 2026-01-26