I am interested in implementing a model in inla that allows me to account for within group spatial covariance and between group spatial covariance. I have spatial point data and the different points have an associated identity (focal) and some fitness value (seed.n) associated with them.
Here is how i define the model:
## Define components ####
svc_components <- ~ -1 +
lambda_f(main = ~ focal-1, model = "fixed")+
lambda(geometry, weights = lambda, model = matern, group = focal)
# model formula
formula <- seed_n ~ .
# Fit ####
res <- bru(
svc_components,
bru_obs(
formula,
family = 'nbinomial',
data = seeds_dat
),
options = list(
# verbose = 1,
control.compute = list(
waic = TRUE,
cpo = TRUE,
config = TRUE #config = T allows for use of inla.posterior.sample function
),
control.inla = list(
strategy = 'laplace',
int.strategy = 'eb'
),
control.group(
model = "exchangeable"
)
)
)
From what I understand the model = "exchangeable" implements a uniform correlation matrix. I have two questions:
1. Is there a way to implement this same model but not assume a uniform correlation matrix? I am interested in estimating each of the pairwise correlations as a part of the fitting process, I understand that i can estimate them post-hoc from the outputs.
2. Given that the correlation amongst pairs is fixed, and that the model result only produces one spatial covariance function, how come the spatial fields look different for different species if we plot the results from res$summary.random. How does this work?
Thanks for your help!