Solved – When and why would you not want to use a GAM

generalized-additive-modelmgcv

I understand that GAMs in mgcv have the ability to reduce s(x) to a linear relationship with the response variable. If this is the case, why wouldn't you use a GAM?

When fitting smooth terms in gam() using s(x) my understanding is that if the relationship between x and the response variable is linear then a linear relationship will be fitted. Similarly, if the relationship between x and the response variable is non-linear then an appropriate non-linear relationship will be fitted. This is demonstrated when looking at summary(my_gam) – if s(x) has a linear relationship with the response variable the effective degrees of freedom (edf) in summary(my_gam) is 1 or approximately 1, indicating a linear relationship.

Threfore, I don't understand why you wouldn't use a GAM if it can model linear relationships should they exist, but also model non-linear relationships should these exist.In other words, why use a GLM over a GAM if you must make additional assumptions about relationships between the response and predictor – assumptions that do not need to be made when using a GAM?

Its seems that a GAM can do everything that a GLM can and more, but it doesn't do the 'and more' bit (i.e fit non-linear relationships) unless it is needed.

Best Answer

You could take this to extreme and ask why wouldn't we use non-parametric model like $k$-NN regression? Actually, the opposite question Why would anyone use KNN for regression? was asked, and you can check it for more detailed discussion. You can also make the question more broad and ask why wouldn't we use more complicated models instead of simpler ones? For example, why would anyone use logistic, or linear regression, if they could use a neural network?

The two main reasons for preferring simple models are:

  • Interpretability. Simple models like linear regression are directly interpretable, while this does not have to be the case of more complicated models. This may be desirable in some disciplines (e.g. medicine), and even obligatory by law in others (finance).
  • Overfitting. More complicated models are more prone to overfitting, especially for small sample sizes. Complicated model may simply memorize the training dataset and not generalize.

As noticed in the comments, this seems to be also discussed in the following thread: When to use a GAM vs GLM.

As a comment, notice that using model that is linear in parameters is not that a big constraint. You can easily extend a linear model using polynomial components to model complex relationships, and this may even outperform neural networks in some cases (see Cheng et al, 2018 [arXiv:1806.0685]).

Related Question