12Generalised Additive Models

Up to this point, we have introduced covariates into linear models or into the linear predictors of GLMs (see Section 11.1.2), by taking the covariate data directly or possibly using some function of those data. It may well be that the covariate data do not have a neat linear (or function of linear such as images) relationship with the outcome variable (even when the link function is taken into account), and we need some non‐parametric representation of the covariate to be introduced into the linear predictor. These representations are known as smoothers: they attempt to represent the covariate data by a smooth line. For instance, if we had some count data with a single covariate, then with a GLM we might use a log‐link function so that

equation

where images is the mean of the Poisson distribution for images. With Generalised additive models or GAMs we have

equation

where the function s (.), a smoother, attempts to create a smooth line to represent the s, which don't have a shape that ...

Get The R Book, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.