🤖 AI Summary
Conventional generalized additive models (GAMs) struggle to incorporate non-scalar covariates—such as time series and spatial measurements—without resorting to lossy aggregation or pointwise treatment, which induces information loss and multicollinearity. Method: This paper proposes a structured modeling framework that directly smooths raw spatiotemporal data within the R package *mgcv*, systematically unifying three GAM extensions: varying-coefficient models, scalar-on-function regression, and distributed lag models. The framework preserves the intrinsic functional or geometric structure of covariates and enables end-to-end modeling of multidimensional, non-scalar inputs. Contribution/Results: It breaks GAM’s inherent reliance on scalar predictors, substantially enhancing model interpretability, ecological mechanism transparency, and empirical estimation accuracy. The approach provides a general, scalable methodological foundation for ecological modeling with complex observational data.
📝 Abstract
Generalized additive models (GAMs) that connect a set of scalar covariates that map 1-1 to a response variable are commonly employed in ecological and other scientific disciplines. However, covariates are often inherently non-scalar, taking on multiple values for each observation of the response. They can sometimes have a temporal structure, e.g., a time series of temperature and precipitation measurements, or a spatial structure, e.g., multiple soil pH measurements made at nearby locations. While aggregating or selectively summarizing such covariates to yield a scalar covariate allows the use of standard GAM fitting procedures, exactly how to do so can be problematic, e.g., using a mean or median value for some subsequence of a time series, and information is necessarily lost as well. On the other hand naively including all $p$ components of a vector-valued covariate as $p$ separate covariates, say, without recognizing the structure, can lead to problems of multicollinearity, data sets that are excessively wide given the sample size, and difficulty extracting the primary signal provided by the covariate. In this paper we introduce three useful extensions to GAMs that provide means of efficiently and effectively handling vector-valued covariates without requiring one to choose problematic aggregations or selective summarizations. These extensions are varying-coefficient, scalar-on-function and distributed lag models. While these models have existed for some time they remain relatively underused in ecology. This article aims to show when these models can be useful and how to fit them with the popular R package exttt{mgcv}.