REVIEW 2 major objections 5 minor 26 references
Adding structure to generalized additive models, with applications in ecology
T0 review · 2 major / 5 minor · reviewed 2026-08-05 · deepseek-v4-flash
Pith's one-line read The paper shows that varying-coefficient, scalar-on-function, and distributed-lag models are all generalized additive models, so vector-valued environmental covariates can enter directly instead of as hand-chosen summaries.
desk verdict Useful, clearly-written tutorial on fitting three existing structured-covariate GAM extensions in mgcv, but the flagship SoFR comparison is reported ambiguously and needs correcting before the paper's adoption argument can be trusted. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The argument runs on three pieces of machinery: (1) tensor products, which build multivariate smooths from univariate marginal bases so covariates on different scales can interact; (2) the summation convention, which treats matrix-valued covariates by evaluating the smooth at each column and summing over columns, approximating an integral; and (3) linear functionals ("by" variables), which multiply a smooth by a scalar, factor, or vector before it enters the linear predictor. Depending on the type of "by" variable, this yields varying-coefficient terms ($s(z)\cdot x$), scalar-on-function terms ($\sum_j s(v_j)x_i(v_j)$), or, with a tensor product, distributed-lag terms ($\sum_t s(x_{it}, t)$)
What would settle it
Refit the kittiwake model of Section 4 on the same data with both the full scalar-on-function terms and the Frederiksen-style averaged covariates, and compare predictive performance on years or sites held out during fitting; if the averaged model matches or beats the functional model, the central practical claim that data-driven weighting avoids information loss is contradicted.
Extended reading notes
Core claim
The central claim is that moving from scalar covariates to vector-valued covariates does not require leaving the generalized additive model class. The paper shows that a smooth term $s_j$ in the linear predictor can be pre-multiplied by a linear functional $L_{ij}$—the "by" variable—and that when the covariates are matrices, the summation convention lets the model sum the smooth over columns. That single mechanism, combined with tensor products for anisotropic interactions, yields three model families: varying-coefficient models $s(z)\cdot x$, scalar-on-function regression $\sum_j s(v_j)x_i(v_j)$, and distributed-lag models $\sum_t s(x_{it}, t)$. The paper demonstrates on soil carbon, kittiw
Load-bearing premise
The practical case for these models rests on the illustrative analyses being valid, and Section 4.2 is internally ambiguous about whether the scalar-on-function model or the simple averaged-covariate model actually had the lower AIC, so if the averaged models truly win, the paper's argument for adoption weakens.
Editorial extensions
If this is right
- Ecologists can include entire time series or spatial profiles as covariates instead of pre-chosen averages, with the aggregation weights estimated from data.
- The estimated weight functions are directly interpretable: they show which months, depths, or lag days drive the response, and in what direction.
- Because the terms are smooth and penalized, the models borrow strength across index values and avoid the multicollinearity and parameter inflation of treating each component as a separate covariate.
- Covariates with different index scales (days versus months) can enter the same model because each has its own smooth over its own index.
- The same fitted-value framework can be extended hierarchically, for example by sharing information between sites, within the existing GAM toolbox.
Reading between the lines
- Because the Section 4.2 text says both "the corresponding average models had lower AICs" and "Delta AIC > 20 between our scalar-on-function regression and best average model," a reader should settle which model actually won before using the kittiwake example as evidence; the two sentences point in opposite directions.
- The same "smooth times covariate, summed over an index" construction should transfer directly to spatial surfaces or trait gradients as the index domain, not only time and depth.
- A testable extension is to compare held-out predictive accuracy of data-driven weighting versus hand-picked summaries across many species and sites; the paper's examples suggest but do not formally establish that the structured models pay for their extra complexity.
- Because the terms enter only the linear predictor, they can be embedded in hierarchical Bayesian population models; the paper notes this direction, which would let forecasts propagate uncertainty through the estimated weight functions.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper is a methods tutorial aimed at ecologists. It presents three extensions of generalized additive models for vector-valued covariates—varying-coefficient models, scalar-on-function (signal) regression, and distributed lag models—and shows how each can be implemented in the R package mgcv using tensor products, the summation convention, and 'by' variables. The mathematical exposition is cast as an extension of the standard GAM additive predictor, and the three model classes are illustrated with ecological applications: soil organic carbon as a varying-coefficient model, kittiwake breeding success as a scalar-on-function regression, and aphid arrival dates as a distributed lag model. The paper claims that these approaches avoid arbitrary aggregation of structured covariates, reduce information loss, and can be fitted with standard software. The central contribution is didactic rather than novel statistical theory.
Significance. If the illustrative analyses are reported correctly, the paper is a useful practical bridge between functional-data-analysis methods and routine GAM software. The tensor-product construction (Appendix A) and the cross-basis derivation for distributed lags (Appendix B) are standard but clearly presented, and the paper gives concrete formula and data-layout guidance that ecologists can follow. The use of posterior sampling for uncertainty and the attention to model structure are good practice. However, the paper's adoption argument depends on the examples demonstrating that the proposed models outperform or at least interpretably augment simple averaging approaches, and one of those comparisons is currently reported in a self-contradictory way. The central derivations are sound, but the evidence base needs correction before the claims can be relied upon.
major comments (2)
- [Section 4.2, paragraph beginning 'We compared model (6)...'] The AIC comparison is internally contradictory. The text states that 'the corresponding average models had lower AICs' and then gives '∆AIC >20 between our scalar-on-function regression and best average model'; the second clause implies the scalar-on-function model is worse by more than 20 AIC units. If that is the correct reading, the flagship SoFR example actually shows the average model winning, which undercuts the claim that SoFR reduces information loss. If the intended reading is that SoFR has the lower AIC, then the sentence is mistyped. Either way, the reported comparison is not usable as evidence. Please state clearly which model has lower AIC, report actual AIC (and deviance-explained) values for both the SoFR and each average model, and, if the average models are better, re-examine or re-frame the example. This is load-bearing because the paper's usefulness claim rests on the
- [Section 5.2, final paragraph and Supplementary Material C] The distributed lag model is advocated as an improvement over the standard January–February average-temperature model and a weekly-average model, but the quantitative comparison is only in Supplementary Material C. The main text says 'Overall we find that the distributed lag approach gives significant, interpretable insight', but no main-text statistics are provided. Given that the tutorial's practical value is demonstrated through these examples, the comparison should be reported in the main text, or the claim should be softened to 'interpretable insight' without asserting relative predictive improvement. Please also clarify whether 'significant' is used in the statistical sense or colloquially.
minor comments (5)
- [Section 4.2, Figure 3 caption and text] The text says 'The right four plots relate to the calanus effect, the left four to SST', but the figure caption and the next paragraph say the left four plots are calanus and the right four are SST. These are contradictory; please correct.
- [Section 4.2, model comparison sentence] The phrase 'deviances explained (> 35% difference in both cases)' is vague. Report the deviance-explained values for each model, not just a percentage difference.
- [Equations (6) and (7), index conventions] The summation ranges (18 months; days 15 to 120; 59 lags) are motivated by the applied context, but the manuscript should state more explicitly that these windows are fixed a priori and that only the weights within the windows are estimated. As written, 'effectively perform model selection during fitting' may overstate the data-driven aspect.
- [Section 5.2, final paragraph] The sentence beginning 'These are reasonable when compared to the parameters required...' is grammatically incomplete and should be rephrased.
- [Throughout] A few typographical issues: 'anholocylic' should be 'anholocyclic' (Section 5.2), and Figure 4 is referenced as 'Figure 4)' with a stray parenthesis (Section 4.2).
Circularity Check
No significant circularity: the paper maps existing model classes (VCM, SoFR, DLM) into mgcv machinery via self-contained derivations; self-citations are ancillary pointers, and the Section 4.2 AIC ambiguity is a consistency issue, not a circular one.
full rationale
This is a methods tutorial showing how three pre-existing model classes (varying-coefficient, scalar-on-function, and distributed lag models) can be expressed in the mgcv GAM framework using tensor products, the summation convention, and 'by' variables. The derivation chain is self-contained, not circular. The SoFR construction is an explicit algebraic equivalence: the functional integral (4) is approximated by quadrature in (5), and Section 2.3 shows this is exactly a vector-valued linear functional with the summation convention; the smooth s(v) is estimated from data, not defined in terms of the response. The DLM is derived from first principles in Appendix B as a tensor product of marginal smooths in x and lag, followed by the summation convention over lags, matching the standard cross-basis construction with external citations (Gasparrini 2011; Armstrong 2006). The VCM is simply the numeric 'by' variable form in Section 2.3. No fitted parameter is renamed as a prediction; the paper makes no out-of-sample predictive claims, and the example analyses are illustrative fits. The paper cites its own prior work (Miller 2025 for Bayesian interpretation and posterior sampling; Pedersen et al. 2019 for hierarchical GAMs), but these are ancillary pointers: the central implementability claim rests on the paper's own equations and on external references (Wood 2017, Hastie and Tibshirani 1993), not on the self-citations. They are therefore not load-bearing. The one notable issue is internal consistency in Section 4.2: the text says 'the corresponding average models had lower AICs (ΔAIC >20 between our scalar-on-function regression and best average model)', which literally implies the averaged Frederiksen model outperforms the SoFR model by >20 AIC, undercutting the paper's promotion of SoFR; if the intended claim is the opposite, the sentence is mistyped. This weakens the illustrative evidence for the usefulness claim but is not a circularity: it does not make any derivation equivalent to its inputs. Overall, no significant circularity; score 2 reflects only the presence of minor, non-load-bearing self-citations.
Assumptions & free parameters
free parameters (3)
- Maximum lag T = 59 days for aphid model =
59
- Calanus window of 18 months and SST window of days 15 to 120 =
18 months; 106 days
- Basis dimensions k for smooth terms =
not specified in main text
assumptions (5)
- standard math Tensor product smooth construction
- domain assumption Summation convention in mgcv
- domain assumption Smoothness penalties provide appropriate regularization
- domain assumption Response distributions are correctly specified for the examples
- standard math Soap film smoother appropriately handles the coastline boundary
Cite this review
Pith. "Pith review of Adding structure to generalized additive models, with applications in ecology." pith.science (2026). https://pith.science/paper/N2DO4OXB
@misc{pith2026250807915,
author = {Pith},
title = {Pith review of: Adding structure to generalized additive models, with applications in ecology},
year = {2026},
howpublished = {\url{https://pith.science/paper/N2DO4OXB}},
note = {Machine review of arXiv:2508.07915}
}
abstract
Generalized additive models (GAMs) connecting a set of scalar covariates that map 1-1 to a response are commonly employed in ecology and beyond. However, covariates are often inherently non-scalar, taking multiple values for each observation of the response. They can sometimes have a temporal structure, e.g., a time series of temperatures, 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 and information is necessarily lost. 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. Here we introduce three useful extensions to GAMs that efficiently and effectively handle vector-valued covariates without requiring one to choose 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 \mgcv{}.
Figures
Figures from the paper (3 more)
Reference graph
Works this paper leans on
-
[5]
ISSN 1061-8600, 1537-2715. doi: 10.1198/jcgs. 2010.10007. R. Harrington, G. G. Howling, J. S. Bale, and S. Clark. A new approach to the use of meteorological and suction trap data in predicting aphid problems. EPPO Bulletin, 21(3):499–505, Sept
arXiv 2010
-
[7]
doi: 10.1111/j.1365-2486.2007.01394.x
ISSN 1365-2486. doi: 10.1111/j.1365-2486.2007.01394.x. T. Hastie and R. Tibshirani. Varying-Coefficient Models. Journal of the Royal Statistical Society. Series B (Methodological), 55(4):757–796,
-
[13]
ISSN 0171-8630, 1616-1599. doi: 10.3354/meps13693. A. Lilly, J. Bell, G. Hudson, A. Nolan, and T. W. National Soil Inventory of Scotland (NSIS 1978-88), Mar
-
[16]
ISSN 2167-8359. doi: 10.7717/peerj.13950. C. Ostle. CPR data for OSPAR PH1 FW5 PH2 PH3 FW2 QSR2023,
-
[17]
ISSN 2167-8359. doi: 10.7717/peerj.6876. R. D. Peng, F. Dominici, and L. J. Welty. A Bayesian Hierarchical Distributed Lag Model for Estimating the Time Course of Risk of Hospitalization Associated with Particulate Matter Air Pollution. Journal of the Royal Statistical Society Series C: Applied Statistics, 58(1):3–24, Feb
-
[19]
A note on basis dimension selection in generalized additive modelling
ISSN 0016-7061. doi: 10.1016/j.geoderma. 2014.05.004. N. Pya and S. N. Wood. A note on basis dimension selection in generalized additive modelling. arXiv preprint arXiv:1602.06696,
work page Pith review arXiv 2014
-
[20]
doi: 10.1038/s41598-019-51296-5
ISSN 2045-2322. doi: 10.1038/s41598-019-51296-5. P. T. Reiss, J. Goldsmith, H. L. Shang, and R. T. Ogden. Methods for Scalar-on-Function Regression: Scalar-on-Function Regression. International Statistical Review, 85(2):228–249, Aug
-
[22]
doi: 10.1007/s10980-017-0575-y
ISSN 0921-2973, 1572-9761. doi: 10.1007/s10980-017-0575-y. J. T. Thorson, C. L. Barnes, S. T. Friedman, J. L. Morano, and M. C. Siple. Spatially varying coefficients can improve parsimony and descriptive power for species distribution models. Ecography, 2023(5):e06510, May
Show all 26 references
-
[1980]
doi: 10.1111/j.1365-2338.1980.tb02635.x
ISSN 0250-8052, 1365-2338. doi: 10.1111/j.1365-2338.1980.tb02635.x. K. F. A. Walters and A. M. Dewar. Overwintering Strategy and the Timing of the Spring Migration of the Cereal Aphids Sitobion avenae and Sitobion fragariae. Journal of Applied Ecology, 23(3):905–915,
1980
-
[1986]
doi: 10.2307/2403943
ISSN 0021-8901. doi: 10.2307/2403943. C. T. Williams.Overwintering and Low Temperature Biology of Cereal Aphids. PhD thesis, University of Southampton,
-
[1991]
doi: 10.1111/j.1365-2338.1991.tb01281.x
ISSN 0250-8052, 1365-2338. doi: 10.1111/j.1365-2338.1991.tb01281.x. R. Harrington, S. J. Clark, S. J. Welham, P. J. Verrier, C. H. Denholm, M. Hullé, D. Maurice, M. D. Rounsevell, N. Cocu, and E. U. E. Consortium. Environmental change and the phenology of European aphids. Glob...
1991
-
[2000]
doi: 10.1890/1051-0761(2000) 010[0423:TVDOSO]2.0.CO;2
ISSN 1939-5582. doi: 10.1890/1051-0761(2000) 010[0423:TVDOSO]2.0.CO;2. N. J. Klappstein, T. Michelot, J. Fieberg, E. J. Pedersen, and J. Mills Flemming. Step selection functions with non- linear and random effects. Methods in Ecology and Evolution, 15(8):1332–1346,
1939 doi
-
[2002]
doi: 10.3354/meps245239
ISSN 0171-8630, 1616-1599. doi: 10.3354/meps245239. M. Frederiksen, M. Edwards, R. A. Mavor, and S. Wanless. Regional and annual variation in black-legged kittiwake breeding productivity is related to sea surface temperature. Marine Ecology Progress Series, 350:137–143, Nov
-
[2006]
doi: 10.1097/01.ede.0000239732.50999.8f
ISSN 1044-3983. doi: 10.1097/01.ede.0000239732.50999.8f. F. Daunt, S. Benvenuti, M. P. Harris, A. L. Dall, D. A. Elston, and S. Wanless. Foraging strategies of the black-legged kittiwake Rissa tridactyla at a North Sea colony: Evidence for a maximum foraging range. Marine Ecol...
-
[2007]
doi: 10.3354/meps07126
ISSN 0171-8630, 1616-1599. doi: 10.3354/meps07126. A. Gasparrini. Distributed Lag Linear and Non-Linear Models inR : The Packagedlnm. Journal of Statistical Software, 43(8),
-
[2008]
frequentist
ISSN 13697412, 14679868. doi: 10.1111/j.1467-9868. 2008.00665.x. 16 Adding structure to GAMsPREPRINT Appendix A Tensor product construction We can build a tensor product basis as follows. If we have two univariate smoothssx(x) and sy(y), we can look at their basis expansions: ...
2008 arXiv
-
[2009]
doi: 10.1111/j.1467-9876.2008.00640.x
ISSN 0035-9254. doi: 10.1111/j.1467-9876.2008.00640.x. L. Poggio and A. Gimona. National scale 3D modelling of soil organic carbon stocks with uncertainty propagation — An example from Scotland. Geoderma, 232–234:284–299, Nov
2008
-
[2011]
doi: 10.18637/jss.v043.i08
ISSN 1548-7660. doi: 10.18637/jss.v043.i08. J. Goldsmith, J. Bobb, C. M. Crainiceanu, B. Caffo, and D. Reich. Penalized Functional Regression. Journal of Computational and Graphical Statistics, 20(4):830–851, Jan
-
[2014]
doi: 10.1080/10618600.2012.729985
ISSN 1061-8600, 1537-2715. doi: 10.1080/10618600.2012.729985. D. L. Miller. Bayesian views of generalized additive modelling. Methods in Ecology and Evolution, n/a(n/a),
2012
-
[2017]
doi: 10.1111/insr.12163
ISSN 03067734. doi: 10.1111/insr.12163. E. F. Stuber, L. F. Gruber, and J. J. Fontaine. A Bayesian method for assessing multi-scale species-habitat relationships. Landscape Ecology, 32(12):2365–2381, Dec
-
[2019]
doi: 10.1002/gdj3.78
ISSN 2049-6060. doi: 10.1002/gdj3.78. B. Huang, C. Liu, V . Banzon, E. Freeman, G. Graham, B. Hankins, T. Smith, and H.-M. Zhang. Improvements of the Daily Optimum Interpolation Sea Surface Temperature (DOISST) Version 2.1.Journal of Climate, 34(8):2923–2939, Apr
-
[2021]
doi: 10.1175/JCLI-D-20-0166.1
ISSN 0894-8755, 1520-0442. doi: 10.1175/JCLI-D-20-0166.1. E. K. Jacobson, E. E. Henderson, D. L. Miller, C. S. Oedekoven, D. J. Moretti, and L. Thomas. Quantifying the response of Blainville’s beaked whales to U.S. naval sonar exercises in Hawaii. Marine Mammal Science, 38(4):...
-
[2022]
doi: 10.1111/mms.12944
ISSN 0824-0469, 1748-7692. doi: 10.1111/mms.12944. E. G. Jobbágy and R. B. Jackson. The Vertical Distribution of Soil Organic Carbon and Its Relation to Climate and Vegetation. Ecological Applications, 10(2):423–436,
-
[2023]
doi: 10.1111/ecog.06510
ISSN 0906-7590, 1600-0587. doi: 10.1111/ecog.06510. L. A. D. Turl. An approach to forecasting the incidence of potato and cereal aphids in Scotland. EPPO Bulletin, 10(2): 135–141, July
-
[2024]
doi: 10.1111/2041-210X.14367
ISSN 2041-210X. doi: 10.1111/2041-210X.14367. 15 Adding structure to GAMsPREPRINT R. Langton, P. Boulcott, and P. Wright. A verified distribution model for the lesser sandeel Ammodytes marinus. Marine Ecology Progress Series, 667:145–159, June
-
[2025]
doi: 10.1111/2041-210X.14498
ISSN 2041-210X. doi: 10.1111/2041-210X.14498. D. L. Miller, E. A. Becker, K. A. Forney, J. J. Roberts, A. Cañadas, and R. S. Schick. Estimating uncertainty in density surface models. PeerJ, 10:e13950, Aug
Reviewed August 5, 2026 · model on record in the stance chip above.
Discussion (0). Sign in to comment.