0

我想用 brms 包跨栏捕鱼模型。total_2005 范围 0 ~ 38816,totalnet_2005 范围 0 ~ 6530,数据有 671 个观测值。

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")

但它返回了错误;

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 不适合这个数据?

4

0 回答 0