Skip to content

Spatial correlation in glmmTMB

2 messages · André Pardal

#
Hello,

Thank you all for the comments. Actually, there is a misspelling in my
first email and sorry for not explaining properly. I will try below:

I collected data in 62 locations along a large spatial scale (> 500 km).
And I surely have replication inside each location.
First I performed a model selection for identifying the best random
structure than the fixed structure. The final best model is as below.

m1 = glmmTMB(density ~ wave_exposure + (1|subregion/location), data=
mydata, family= nbinom1, ziformula= ~0)

The term (1|subregion/location) is the random effect of subregion and
location (and location is nested in subregion)

When I try to account for spatial correlation a have the following model:

m1.spatial = glmmTMB(density ~ wave_exposure + (1|subregion/location) +
exp(pos +0|group), data= mydata, family= nbinom1, ziformula= ~0)

The term exp(pos +0|group) refers to the spatial correlation. exp =
exponential covariance structure; pos = numFactor putting spatial
coordinates together; group = a dummy factor (mydata$group <- factor(rep(1,
nrow(mydata))))

I already tried to create a jitter for spatial coordinates, since some
packages do not work if the distance between two coordinates is zero.
I also tried changing the dummy factor to be a repetition from 1 to 62
(since I have 62 locations).

Actually, most of times the model not even runs and cracks my R.

Well, I guess I will try spaMM.


Thanks a lot.

Andre.




On Fri, 19 Jul 2019 at 09:47, Francois Rousset <
francois.rousset at umontpellier.fr> wrote:

            

  
    
#
Sorry, forgot to paste the error i get:

dens.exp = glmmTMB(density_cht ~ wf_log + exp(pos + 0|group2) +
(1|subregion/location), data=density2, REML=T, family = nbinom1,
ziformula=~0) ##full

Warning message:
In fitTMB(TMBStruc) :
Model convergence problem; non-positive-definite Hessian matrix. See
vignette('troubleshooting')
Error in solve.default(as.matrix(Qm)): system is computationally singular:
reciprocal condition number = 2.67616e-135

On Mon, 22 Jul 2019 at 12:23, Andr? Pardal <andre.pardal.souza at gmail.com>
wrote: