Hi,
this question has multiple potential answers, depending on the reason
for asking it, and no one true correct answer. For instance, since the
spatial field component has posterior correlation with the "fixed
effects", the variation contribution of each individual effect can add
up to more than the combined variability, so computing a "percentage
of explained variance" doesn't necessarily mean what one thinks it
means.
But you may be on the right track in thinking about what happens to
the model when removing one model components, and comparing the
results. We did something along those lines in
Yuan Yuan, Fabian E. Bachl, Finn Lindgren, David L. Borchers, Janine
B. Illian, Stephen T. Buckland, Håvard Rue, and Tim Gerrodette (2017),
"Point process models for spatio-temporal distance sampling data from
a large-scale survey of blue whales", Annals of Applied Statistics,
11, 2270--2297, doi:10.1214/17-AOAS1078
There, we compared the spatial model predictions with and without the
random field component present in the estimation, and computed the
overall spatial variability (in the spatial context, overall spatial
variability is arguably the relevant quantity, and not raw statistical
variance at the observation locations).
What you describe sounds similar, but with looking only at the
locations where you have observations.
Both versions require you to run the model twice; one with the f(s,
...) component, and once without it. There's no special magic to
this.
Note:
Due to the posterior dependence, I prefer looking at the combined
component effects when comparing models; i.e. I would mainly compare
combined predictor values, and not the individual component estimates,
as those have different interpretation in the presence of other model
components (spatial confounding is virtually ubiquitous, and one
should not expect "spatial fixed effect" estimates to remain unchanged
when adding other spatial components to the model).
Finn
On Mon, 3 Jun 2024 at 03:26, Richard <
richard...@gmail.com> wrote:
>
> Dear INLA team
>
> I have created a spatial model and I am interested to see how much of the variability is explained by each term, especially by the spatial effect, is there any way to do this? Let´s say I have this model:
>
> y ~ x1 + x2 + x3 + f(s, model = spde)
>
> Is there any way to check how much each terms help to explain the variability?
>
> One thing I did, but I am not sure if there is a better option, and it is just graphical, is to see how well the posterior follows the sample, so I use inla.posterior.sample and get the first n-predictors that correspond to the sample of size n, the idea is that those predictors are similar to the observed data.
>
> I am not sure if by removing each of terms once and see how much the posterior changes compared to the data could help to show how much each term helps to compute the posterior but is not exactly an explanation of the variability and I am more interested in something numeric rather than graphic.
>
> Is there any way to do this?
>
> Thank you
>
>
> --
> You received this message because you are subscribed to the Google Groups "R-inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
r-inla-discussion...@googlegroups.com.
> To view this discussion on the web, visit
https://groups.google.com/d/msgid/r-inla-discussion-group/52912b2c-c085-4004-953f-a398afc3e7efn%40googlegroups.com.
--
Finn Lindgren
email:
finn.l...@gmail.com