I would like to hurdle model for fish catch with brms packages.
ff <- read.csv(file.choose())
ff <- merge(f, n[,1:7], by = "code", all.x = TRUE) %>%
filter(!is.na(sigma.BTM_rcp26_2005.5YS) & !is.na(sigma.S100_rcp26_2005.5Y.1) & !is.na(to.BTM_rcp26_2005.5YAVE.) & !is.na(to.S100_rcp26_2005.5YAVE))
ff.csv (66.5 KB)
fbmodel <- brm(total_2005 ~ Thickness.average + Depth.range + Depth.average +
sigma.BTM_rcp26_2005.5YS + sigma.S100_rcp26_2005.5Y.1 +
to.BTM_rcp26_2005.5YAVE. + to.S100_rcp26_2005.5YAVE,
offset(totalnet_2005) ,
data = ff,
family = hurdle_negbinomial(link = "log", link_shape = "log", link_hu = "logit"),
prior = c(set_prior("normal(0,10)", class = "b")),
warmup = 300,
iter = 1000,
chains = 4,
save_all_pars = TRUE,
backend = "cmdstanr",
control = list(adapt_delta = 0.99, max_treedepth = 15),
save_model = "fish_stanscript",
file = "fish")
but it returned the error;
Chain 4 Rejecting initial value:
Chain 4 Log probability evaluates to log(0), i.e. negative infinity.
Chain 4 Stan can't start sampling from this initial value.
Chain 4 Initialization between (-2, 2) failed after 100 attempts.
Chain 4 Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.
hurdle_negbionomial was not suitable for this data?