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.