Hi,
I am running spatio-temporal model. However, i get the erreo message like this:*** Fail to get good enough initial values. Maybe it is due to something else. When i use another response variable or if i use a very large cutoff, everything is fine. Can you give me some suggestions what can I do to tune the model, thanks so much!
coo <- data[ ,9:10]
mesh <- inla.mesh.2d(
loc = coo,
boundary = bnd,
max.edge = c(1, 2),
cutoff = 0.01
)
plot(mesh)
points(coo,col = "red", pch = 1)
# SPDE
spde <- inla.spde2.matern(
mesh = mesh, alpha = 2, constr = TRUE,
#prior.range = c(10000, 0.01), # P(range < 10000) = 0.01
#prior.sigma = c(3, 0.01) # P(sigma > 3) = 0.01
)
# index of spatial field
timesn <- length(unique(data$date))
indexs <- inla.spde.make.index(
"s",
n.spde = spde$n.spde,
n.group = timesn
)
# make A
group <- rep(c(1:11), each=nrow(data)/11)
coo <- cbind(data$lon, data$lat)
A <- inla.spde.make.A(mesh = mesh, loc = coo, group=group) #, group=group
# stack
X <- data[, c(3, 8, 11:16)]
X$time <- group
stk <- inla.stack(
tag = "data",
data = list(
Yreli = data$Yreli,
Ereli=data$Ereli,
Yprev = data$Yprev,
Eprev=data$Eprev
),
A = list(1, A),
effects = list(X=X, s = indexs)
)
f.3.3_reli <- Yreli ~ perc_white + price_med + pm10 + board +
dispensing + urban +december + f(s, model = spde, group = s.group,
control.group = list(model = "ar1",
hyper = rprior))
poi_st_reli_ari <- inla(f.3.3_reli,
family = "poisson", E = Ereli,
data = inla.stack.data(stk),
control.compute = list(dic = TRUE, waic=TRUE),
control.predictor = list(compute = TRUE,
A = inla.stack.A(stk)
))