When to include a spatially-varying covariate in the formula argument? #294
Replies: 4 comments 5 replies
-
I think I'd need a MWE here. In general, I think you'd nearly always want a covariate in both since the spatially varying field is assumed to be drawn from a mean-zero distribution. |
Beta Was this translation helpful? Give feedback.
-
That makes sense. I'm working on an example, but I think the issue is more to do with how the intercepts are specified than whether the spatially varying term is in the formula. If I can make a clean example maybe we can add it to the documentation, as the only examples we have now are for the special case of the spatially-varying coefficient of time. |
Beta Was this translation helpful? Give feedback.
-
Model One potential problem in folks interpreting
Alternatively, one could fit the same model estimating the global intercept (with a goal of making the mean of
But the mean of those spatial fields are still not 0, which is weird. The mean of
For The bigger thing I'm not totally getting is why the means of
|
Beta Was this translation helpful? Give feedback.
-
The fields are drawn from MVN(0, Sigma) but any given realized field will not have mean zero, just like how random intercepts come from N(0, sigma), but any one random intercept value will not have a value of 0. So, even IID random fields will have different means through time, but they're penalized towards mean 0. And a given spatial field will be penalized towards zero but may not have a calculated mean zero. |
Beta Was this translation helpful? Give feedback.
-
This is based on a question received by email and some personal experimentation.
In our sdmTMB workshop/teaching slides, we indicate that when fitting a model with a spatially-varying covariate, one will likely want to include the spatially-varying term in the formula argument in addition to the spatial_varying argument. However, this can result in a singularity error:
solve.default(h, g) :
system is computationally singular
Can we give more specific guidance on when to include the spatially varying term in the formula? If it is yet unclear, I can put together a MWE to better understand when this occurs.
Beta Was this translation helpful? Give feedback.
All reactions