I was under the impression that using te
and adding the main effects with s
plus the interaction with ti
is the same (in a GAM model, estimated with mgcv
).
However:
library( mgcv )
library( gamair )
data( brains )
tm <- gam(medFPQ~te(Y,X,k=10),data=brain,family=Gamma(link=log))
tm1 <- gam(medFPQ ~ s(Y,k=10,bs="cr") + s(X,bs="cr",k=10) +
ti(X,Y,k=10), data=brain, family=Gamma(link=log))
predict(tm)[955]
predict(tm1)[955]
(The example is copied verbatim from Simon Wood's GAM book, page 335, so the specification should be correct.)
So, aren't these two formulations equivalent...?