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.

  • 3
    $\begingroup$ Why wouldn't you? $\endgroup$
    – Tim
    Nov 12, 2019 at 6:32
  • $\begingroup$ possibly duplicate? stats.stackexchange.com/questions/380426/… $\endgroup$
    – rep_ho
    Nov 13, 2019 at 17:51
  • $\begingroup$ Thanks rep_ho. I saw this question you suggest. Perhaps I should rephrase my question again - When and why would you not want to a GAM? It would seem to me that GAMs and GLMs can essentially be used to model similar relationships between a response and predictor, the main difference being that whilst GAMs can model linear relationships, there is no underlying assumption of linearity in a GAM. Why force yourself to make this assumption by using a GLM when it is not necessary when using a GAM? $\endgroup$ Nov 13, 2019 at 21:57

1 Answer 1


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]).

  • 5
    $\begingroup$ If the question hinges on interpretability, is a polynomial linear model really any more interpretable than a GAM? $\endgroup$
    – dbspon
    Jul 15, 2020 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.