Exploring Spline Based Models in glmmTMB
Abstract
In recent times the R-package glmmTMB has been extended to facilitate spline regression. In this thesis we implement spline based smoothers in glmmTMB-models and compare them to generalized additive models from mgcv and other R-packages. Initially, we compare outputs with the default mgcv gam function, and find slight discrepancies. We explain this as the consequence of a necessary re-parameterization step, which we show is equivalent to the results given by other mixed model frameworks, such as gamm4. Across 7 different data sets, and 15 different models, we demonstrate that splines offer an advantage in many scenarios compared to simpler regression models. We show that glmmTMB as a modelling framework becomes a versatile choice for spline regression, with the additional dispersion and zero-inflation modelling capacity, while remaining user friendly. Lastly, we offer a proof of concept for a method of fitting spline models using Ridge regularization for smoothing, with generalized cross validation for choosing the smoothing parameter. The method greatly reduces the time to train and predict the models, and can offer stronger predictions when faced with multi-collinearity and/or strong smoothing is needed.