Hierarchical generalized additive models: an introduction with mgcv

Northwest Atlantic Fisheries Center, Fisheries and Oceans Canada, St. John's, Newfoundland and Labrador, Canada
Department of Biology, Memorial University of Newfoundland, St. John's, Newfoundland and Labrador, Canada
Centre for Research into Ecological and Environmental Modelling, University of St. Andrews, St. Andrews, United Kingdom
School of Mathematics and Statistics, University of St. Andrews, St. Andrews, United Kingdom
Institute of Environmental Change and Society, University of Regina, Regina, Saskatchewan, Canada
Ecohealth Alliance, New York, New York, United States
DOI
10.7287/peerj.preprints.27320v1
Subject Areas
Ecology, Statistics, Data Science
Keywords
Generalized Additive Models, Hierarchical models, time series, functional regression, smoothing, regression, community ecology, tutorial, nonlinear estimation
Copyright
© 2018 Pedersen et al.
Licence
This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, reproduction and adaptation in any medium and for any purpose provided that it is properly attributed. For attribution, the original author(s), title, publication source (PeerJ Preprints) and either DOI or URL of the article must be cited.
Cite this article
Pedersen EJ, Miller DL, Simpson GL, Ross N. 2018. Hierarchical generalized additive models: an introduction with mgcv. PeerJ Preprints 6:e27320v1

Abstract

In this paper, we discuss an extension to two popular approaches to modelling complex structures in ecological data: the generalized additive model (GAM) and the hierarchical model (HGLM). The hierarchical GAM (HGAM), allows modelling of nonlinear functional relationships between covariates and outcomes where the shape of the function itself varies between different grouping levels. We describe the theoretical connection between these models, HGLMs and GAMs, explain how to model different assumptions about the degree of inter-group variability in functional response, and show how HGAMs can be readily fitted using existing GAM software, the mgcv package in R. We also discuss computational and statistical issues with fitting these models, and demonstrate how to fit HGAMs on example data.

Author Comment

This is a submission to PeerJ for review.

Supplemental Information

Supplementary tutorial code to reproduce examples in text

DOI: 10.7287/peerj.preprints.27320v1/supp-1