.
===================================
Note:
Here is my code:
precision.prior <- list(prec = list(prior = "pc.prec", param = c(0.5, 0.01)))
baseformula <- obs ~ 1 + holiday + f(week, replicate = ID_region, model = "rw1", cyclic = TRUE, constr = TRUE, scale.model = TRUE, hyper = precision.prior) +
f(ID_region2, model = "bym2", replicate = ID_year, graph = map.graph,,
hyper = precision.prior, scale.model = TRUE)
# test baseline model with Poisson and Negative Binomial distributions
model <- inla(formula = baseformula, data = df_train, family = 'nbinomial', E = 1,
control.inla = list(strategy = 'adaptive'),
control.compute = list(dic = TRUE, waic=TRUE, config = FALSE,
cpo = TRUE, return.marginals = FALSE),
control.fixed = list(correlation.matrix = TRUE,
prec.intercept = 1, prec = 1),
control.predictor = list(link = 1, compute = TRUE),
verbose = FALSE)
Note:
1. I have tried adding the following to inla() function with initial = -1 OR -2,, but I am still getting the same error.
# control.family = list(hyper = list(size = list(initial = -1))), ## ADD for nbinomial