Species Distribution Modelling with GAMs

Jens Meyer

15 6 2021


1 Generalized Additive Modells

library(mgcv)

model <- gam(presence ~ s(x1) + s(x2) + s(x3) +     # one dimensional smooths
                s(x4, x5),                          # two dimensional smooths
                data = __,                          # your data
                family = ___,                       # your distribution (e.g. gaussian)
                method = "REML"                     # sets parameter for your smooths
                ...)                        

1.1 Smooths / Splines

Generalized Additive Models use spline functions (smooths).

1.1.1 Basis functions

The spline functions are composed of simpler basis functions witch are weighted and summed up.
\[s(x) = \sum_{k = 1}^K \beta_k b_k(x)\]


The more basis functions a smooth is made of, the more complex of a relationship the smooth can model (Simpson 2020). With the parameter k in s(x1, k = __) you can pick the number of basis functions.