Hi,
I am running a spatial-temporal model using areal data (sub-county level) and BYM correlation. When I run the full model with the covariates + spatial random effects + temporal trend, the model runs successfully. But when I remove the covariates to run a baseline (random effects only model), then the program crashes.
Note: my dataset has 52,200 observations spanning 15 years. When I subset the data to include only 12 years instead of 15, the problem goes away.
Please see the code below for the full mode and baseline model:
# Add Covariates Plus SRF + Annual Trend
I5.b <- inla(formula = cases01 ~ Total.Population.std + Population.Density.std +
Dairy.Exotic.Cattle.std + Agricultural.Land.Area.std +
Livestock.Prod.Households.std +
f(County,
model = "bym",
graph = ken.adj,
hyper = HyperBYM,
adjust.for.con.comp = FALSE,
constr = TRUE,
scale.model = TRUE) +
f(Year,model = "rw2") +
f(Year1,model = "iid"),
family = "binomial",
data = train,
control.compute = list(dic = TRUE, waic = TRUE, cpo=TRUE))
# Baseline model (without covariates)
I4.b <- inla(formula = cases01 ~ 1 +
f(County,
model = "bym",
graph = ken.adj,
hyper = HyperBYM,
adjust.for.con.comp = FALSE,
constr = TRUE,
scale.model = TRUE) +
f(Year,model = "rw2") +
f(Year1,model = "iid"),
family = "binomial",
data = train,
control.compute = list(dic = TRUE, waic = TRUE, cpo=TRUE))
Many thanks for your help.
Best,
Val.