Interpretability of tensor product interactions in space Spatial data (x, y) is most often accompanied by spatial autocorrelation or locally different interactions between x & y. When I want to fit a parameter across space with generalized additive models and I am interested only in the long range effect of one spatial direction (e.g. x) is it valid to use the ti() tensor product interaction?
What I am aiming to is to look for the main effect of x excluding a spatial autocorrelation effect or other local interaction between x and y.
I am using the quantile version of gams out of the package qgam
library(qgam)
b <- qgam(Response ~ ti(x)+ti(y)+ti(x,y)+s(some random factors,bs=”re”),qu=0.5) #0.5 for median

Can I say that interpreting the results from ti(x) represents the main effect or left-over effect excluding the interaction (or local correlation of x & y)? So the effect I see in ti(x) is taking out both the effect of y and the interaction / local correlation of x,y?
By increasing the number of k in the ti(x,y) can I account for smaller scale interactions / correlation of y & x on higher resolution?
And a final question related to that, is there a difference in this context using:
b <- qgam(Response ~ s(x)+s(y)+ti(x,y)+s(some random factors,bs=”re”),qu=0.5)

I know there are other methods like gamm which can add correlation terms for errors e.g. in this spatial context, but I need quantile estimates so qgam is mandatory.
-Or are there any other techniques with which I can accomplish that?
Thanks!
 A: Yes, your interpretation is correct; s(x) + s(z) + ti(x,z) includes the main effects of x and z as separate terms from the interaction term ti(x,z), in the same sense as x + z + x:z would in an linear model.
From some tests I did a while back, ti(x) or s(x) in a model like
y ~ s(x) + s(z) + ti(x, z)

is close to the smooth effect of x averaged over the values of z. By that I mean say you fitted this model
y ~ te(x, z)

and then evaluated the smooth effect of x at a set of values for z from this model (using a grid of points x' and a very fine set of values for z, and then average the estimated smooth effect of x over z at each value of x') you would get something very close to s(x) in the first model.
I haven't quite worked out why there is more of a discrepancy than I would have expected, but this may just related to the first model not being exactly equal to the second model; there are more smoothness parameters in the first model than the second for example.
What you are doing seems valid to me.
Another option, which seems much more involved would be to fit the model with s(x, z, bs = 'tp') or s(x, z, bs = 'ds') or te(x, z). Create some vector of new values for x that you want to evaluate the model at, and combine it with a fine set of values for z. Then simulate from the model posterior at this grid of x and z points, and the average the predicted values over z for each value of x, yielding the average posterior effect of x.
Increasing k works as you say, up to a point; you're assuming that the effect of ti(x, z) is smooth so there becomes a point where increasing k will lead to a rough surface and the penalty will start to dominate the penalised likelihood of the model. If you have a large amount of data then you can have a k that is higher, but there's still some limit imposed by the definition of smoothness.
There isn't a difference between
y ~ s(x) + s(z) + ti(x, z)

and
y ~ ti(x) + ti(z) + ti(x, z)

At one time Simon Wood indicated that he didn't like having ti() work for single terms, but this warning seems to have been removed from the Changelog, so perhaps he has changed his mind about that.
