noamross / gams-in-r-course

Generalized Additive Models in R: A Free Interactive Course
https://noamross.github.io/gams-in-r-course
Other
243 stars 69 forks source link

Chapter 3.11 #29

Open mikekaminsky opened 4 years ago

mikekaminsky commented 4 years ago

In chapter 3, section 11 you give the following example of using tensor interaction terms:

gam(y ~ s(x1) + s(x2) + ti(x1, x2), data = data, method = "REML")

However, that (appears to??) conflict with the recommendation from Simon Wood in A Toolbox of Smooths(see page 28, "Miscellanea"):

However, nested models make most sense if the bases arestrictly nested. To ensure this, smooth interactions shouldbe constructed using marginal bases identical to thoseused for the main effects. gam(y~te(x)+te(z)+te(x,z))would achieve this, for example

Maybe (surely??) I'm missing something here, but if there's a clear explanation it might be worth adding to the course.