# Statistics - Generalized additive model (GAM)

In statistics, a generalized additive model (GAM) is a generalized linear model in which the linear predictor depends linearly on unknown smooth functions of some predictor variables, and interest focuses on inference about these smooth functions.

The general idea is that we fit non-linear functions in a bunch of variables at the same time. The additive in the name means that we're going to retain the additivity of linear models because it leads to interpretable models.

Allows for flexible nonlinearities in several variables, but retains the additive structure of linear models.

## 2 - Function

$$y_i = \beta_0 + f_1(x_{i1}) + f_2(x_{i2}) + \dots + f_p(x_{ip}) + \epsilon_i$$ where:

• Y is an additive function of the different X's.
• X's are the different variables in the model.

where:

• the third variable is factor variable. So there'sa piecewise constant function is a natural

thing to fit. One constant for each of the levels.