Generalized additive model (GAM)

Gist

An extension of the Generalized linear models (GLM) with the addition of Splines

Mathematics

Like a GLM, a GAM is linear in its parameters Each smooth term is written as a weighted sum of fixed basis functions: $$ f_j(x_j) = \sum_{k=1}^{K_j} \beta_{jk} , b_{jk}(x_j) $$ The bjk are chosen in advance ad the βjk are estimated. So once the basis is built, the additive predictor collapses into a design matrix: $$ g(\mu_i) = \beta_0 + \sum_{j=1}^{J} \sum_{k=1}^{K_j} \beta_{jk} , b_{jk}(x_{ji}) \quad\Longleftrightarrow\quad g(\boldsymbol{\mu}) = \mathbf{X}\boldsymbol{\beta} $$

Wigglineness

I do think it’s really funny that the actual term is just wiggliness. It is calculated as the integral of the second derivatives squared. It is is squared because if you don’t, wiggly curve may have a wigglineness of zero [1]

Uses

R


  1. https://stats.stackexchange.com/questions/400688/why-2nd-derivative-is-squared-to-represent-wigglyness-in-gam ↩︎