# Brms prior speficiation in negative binomial model

**URL:** <https://discourse.mc-stan.org/t/brms-prior-speficiation-in-negative-binomial-model/29640>\
**Category:** Modeling\
**Tags:** prior-choice, brms\
**Created:** [November 29, 2022, 7:18am UTC](https://discourse.mc-stan.org/t/brms-prior-speficiation-in-negative-binomial-model/29640 "2022-11-29T07:18:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peke0213](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/peke0213/32/15267_2.png) [@peke0213](https://discourse.mc-stan.org/u/peke0213)\
**Post date:** [November 29, 2022, 7:18am UTC](https://discourse.mc-stan.org/t/brms-prior-speficiation-in-negative-binomial-model/29640/1 "2022-11-29T07:18:00Z")

</div>

I’m using brms for regression analysis assuming negative binomial model,  
but I get " E-BFMI less than .2" error.  
I read somewhere else that this error might be avoided by specifying appropriate priors,  
but not sure how to improve my prior.

If there is any suggestion, please let meknow.

# bprior ← c(prior(uniform(-1, 1), class=ar),

# prior(cauchy(0, 1), class=sderr),

# prior(normal(0,10), class = b),

# prior(normal(0,10), class = Intercept),

# prior(cauchy(0, 1), class=shape)

# )

---

<div class="post-metadata">

**Author:** ![Solomon](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/solomon/32/2495_2.png) [@Solomon](https://discourse.mc-stan.org/u/Solomon)\
**Post date:** [November 29, 2022, 2:47pm UTC](https://discourse.mc-stan.org/t/brms-prior-speficiation-in-negative-binomial-model/29640/2 "2022-11-29T14:47:21Z")

</div>

It’s difficult to comment on your priors without knowing more about your data and your model. But at a superficial glance, your intercept prior is pretty vague. Try something more like `prior(normal(log(x), 1), class = Intercept)`, where the value of `x` is where you’d expect the mean of your data to be when all the predictors are at zero. Also, unless your predictors have extreme scales, I’d also reign in your `class = b` prior to something more like `prior(normal(0, 1), class = b)`.

---

<div class="post-metadata">

**Author:** ![peke0213](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/peke0213/32/15267_2.png) [@peke0213](https://discourse.mc-stan.org/u/peke0213)\
**Post date:** [November 30, 2022, 3:11am UTC](https://discourse.mc-stan.org/t/brms-prior-speficiation-in-negative-binomial-model/29640/3 "2022-11-30T03:11:11Z")

</div>

Thank you very much, seems like problem solved about the e-bfmi issue following your advice.  
Still got issue with discrepancy between waic and loo(and loo’s pareto\_k \> 0.7 warnings), but I’ll create another thread for this issue if I cannot find any solution.

By the way, I’m modelling generalized linear model-like regression , with count data as response variable and several other explanatory variables, with autocorrelated errors.
