Consider a GAM model, expressed in mgcv just to fix ideas:

my_model <- gam(y ~ ti(x1)+ti(x2) + ti(x1, x2), method= "REML")

The model is linear in the parameters, right? Each smooth is a linear combination of basis functions, which are independent of the data set (unless I use bs = "ad"). Thus the model is linear in the parameters, which are the coefficients of the basis functions. Right? And this should be true, whether or not there are interaction terms - it doesn't really matter. The only exception are adaptive smooths, because in that case the coefficients of the basis functions are themselves functions of the covariates (x1 and x2, in my example). Correct?


Yes, GAMs are linear in the parameters. If we ignore the estimation of smoothness parameters, once we have created the bases for all the covariates we want to fit a smooth effects of, a GAM is just plain old GLM with coefficients for individual basis functions.

This is also true in smooth interactions. The ti(x1, x2) term is just a tensor product basis formed by two univariate marginal bases and the resulting coefficients map to individual functions in the 2-d basis. (The ti() basis has had the main effects of the separate covariates removed when invoked with two or more covariates.)

  • $\begingroup$ You're a guarantee :-) you should consider collaborating with Simon Wood for the third edition of his book...or write one yourself! $\endgroup$
    – DeltaIV
    Nov 17 '17 at 9:27
  • 1
    $\begingroup$ @DeltaIV Ha! :-) Simon doesn't need any help from me; I'm just a very grateful user myself. $\endgroup$ Nov 17 '17 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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