Convergence issues for fixed variables when modeling spatial latent effects with spAbund()

25 views
Skip to first unread message

Sonia Illanas

unread,
May 19, 2025, 5:35:27 PMMay 19
to spOccupancy and spAbundance users
Hi there!

I write to the list because I wonder if anyone has previously face what I’m finding. To give you some context:

I’m analyzing hunting yield datasets (n~8000) to compare the behavior of models that consider or do not consider a latent spatial effect (+w(s)). I use the abund() function for models that don’t and the spAbund() function for models that do. To adjust the models, I’m using the following parameters:
 
n.batches<-50
batchs.length<-10000
n.burns<-100000
n.thins<-10
n.chains<-3

prior.list<-list(beta.normal = list(mean=0, var=10),
                        phi.unif = c(3/max.dist, 3/4) #max.dist=
                        sigma.sq.ig= c(2, 1),
                        sigma.sq.mu.ig=list(0.1, 0.1),
                        kappa.unif=c(0.001, 100)
                        )
inits.list<- list(beta= 0, kappa=0.5, sigma.sq=0.5,
                        phi=3/mean.dist, #mean.dist =
                        w = rep (0, length(data$y)
                        )
When examining the convergence of the models, I realized that there are convergence issues with the traceplot, Rhat, and ESS for the fixed variables of the model when structural spatial effects are used. However, sigma.squared and phi do not have convergence issues (see an example of the results below).  Models that don't use a latent structural spatial effect (+ w(s)) converge for fixed variables.

Imagen que contiene Texto

El contenido generado por IA puede ser incorrecto. Gráfico

El contenido generado por IA puede ser incorrecto. Gráfico, Gráfico de líneas, Histograma

El contenido generado por IA puede ser incorrecto.

Has anyone had a similar experience and figured it out how to solve it, or any idea about how to handle it? I’ll be glad to hear your thoughts!

Many thanks!!

Best,

Sonia

Jeffrey Doser

unread,
May 22, 2025, 6:43:45 AMMay 22
to spOccupancy and spAbundance users
Hi Sonia,

Hope all is well, and thanks for the question! I have two main thoughts on what is likely driving the convergence problems you are seeing:
  1. When fitting a spatial model, there can be a phenomenon called "spatial confounding" in which the residual spatial random effect (w(s)) can be correlated with fixed effect covariates in the model, which can ultimately lead to trickiness in interpreting the fixed effect parameters as well as achieving convergence in certain scenarios. Addressing spatial confounding can be a complicated task, but I am guessing this is likely contributing to the problem you're observing given the large number of iterations you are using. I would strongly suggest reading this article by Mäkinen et al. that discusses spatial confounding in the context of species distribution models, when it may occur, and how one can address it by changing prior distributions. If you haven't already seen it, you may also take a look at this vignette I wrote that discusses some things you may look into to try to improve the convergence of model parameters, particularly when thinking about the prior distribution for phi.
  2. If you're using a Poisson distribution, you may consider using a negative binomial distribution instead. With a spatial Poisson model, it is quite easy for the model to overfit, which can in many circumstances lead to the model parameters not showing good convergence. If you use a negative binomial distribution, the overdispersion parameter will attempt to soak up non-spatial variation, which can help avoid overfitting that can occur in the spatial Poisson model. Fitting a spatial NB model can also be tricky (you may need to put a more restrictive prior on phi), but it could help with convergence.
Hope that helps!

Jeff
Reply all
Reply to author
Forward
0 new messages