Hi,
I am fitting a model with split random effects and separate intercepts (taking account the sampling weights) of a country separated by the sea into 2 separate regions. I was wondering if there were any recent changes in INLA as the output for the variance/ precisions of the structured random effects in the models fitted in April were different from the output in July (using the same codes and data). Below are the codes:
props.w$unstruct <- props.w$struct <- 1:n.area
formula1 = logit.p ~ -1 + factor(Region) +
f(struct1, model = 'besag', graph = mat1, scale.model = TRUE, param = c(0.5,0.005)) +
f(unstruct1, model = 'iid', param = c(0.5,0.005)) +
f(struct2, model = 'besag', graph = mat2, scale.model = TRUE, param = c(0.5,0.005)) +
f(unstruct2, model = 'iid', param = c(0.5,0.005))
fit1 <- inla(formula1,
family="gaussian", data=props.w,
control.predictor = list(compute = TRUE),
control.compute = list(dic = TRUE, cpo = TRUE, waic=TRUE),
control.family = list(hyper = list(prec = list(
initial = log(1), fixed=TRUE))),
scale=props.w$logit.prec)
summary(fit1)
# variance region1
m <- fit1$internal.marginals.hyperpar$"Log precision for struct1"
m.var <- inla.tmarginal(function(x) 1/exp(x), m)
inla.zmarginal(m.var)
m1 <- fit1$internal.marginals.hyperpar$"Log precision for unstruct1"
m1.var <- inla.tmarginal(function(x) 1/exp(x), m1)
inla.zmarginal(m1.var)
# variance region2
m2 <- fit1$internal.marginals.hyperpar$"Log precision for struct2"
m2.var <- inla.tmarginal(function(x) 1/exp(x), m2)
inla.zmarginal(m2.var)
m3 <- fit1$internal.marginals.hyperpar$"Log precision for unstruct2"
m3.var <- inla.tmarginal(function(x) 1/exp(x), m3)
inla.zmarginal(m3.var)
Thank you in advance for your help.
BR,
Maria