# Rstanarm prior specification: stan\_glm.nb() and stan\_glm() Poisson

**URL:** <https://discourse.mc-stan.org/t/rstanarm-prior-specification-stan-glm-nb-and-stan-glm-poisson/823>\
**Category:** rstanarm\
**Created:** [June 7, 2017, 7:54pm UTC](https://discourse.mc-stan.org/t/rstanarm-prior-specification-stan-glm-nb-and-stan-glm-poisson/823 "2017-06-07T19:54:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShanZhengYang](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@ShanZhengYang](https://discourse.mc-stan.org/u/ShanZhengYang)\
**Post date:** [June 7, 2017, 7:54pm UTC](https://discourse.mc-stan.org/t/rstanarm-prior-specification-stan-glm-nb-and-stan-glm-poisson/823/1 "2017-06-07T19:54:16Z")

</div>

New rstanarm user here. This is excellent software, thank you!

Question: I am a bit confused by the possible priors for models `stan_glm.nb()` and `stan_glm(family=Poisson())` after reading through the documentation via `help("priors")` and the vignette: [https://cran.r-project.org/web/packages/rstanarm/vignettes/priors.html](https://cran.r-project.org/web/packages/rstanarm/vignettes/priors.html)

Are there recommended priors for these models? Given the model/rstanarm function, are there priors recommended for rstanarm users?

It doesn’t look like the weakly informative priors used by rstanarm models are documented, by model. Is this information freely available? At the moment, it appears users would need to run the model, then check with `prior_summary()` (Apologies if I have missed documentation.)

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [June 7, 2017, 8:00pm UTC](https://discourse.mc-stan.org/t/rstanarm-prior-specification-stan-glm-nb-and-stan-glm-poisson/823/2 "2017-06-07T20:00:25Z")

</div>

The recommendation is that if you don’t know that you want to put an informative prior on any of the coefficients, specify `QR = TRUE`. Then the default independent normal priors should be okay. That goes for any `stan_glm{er}` model.

---

<div class="post-metadata">

**Author:** ![ShanZhengYang](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@ShanZhengYang](https://discourse.mc-stan.org/u/ShanZhengYang)\
**Post date:** [June 7, 2017, 8:04pm UTC](https://discourse.mc-stan.org/t/rstanarm-prior-specification-stan-glm-nb-and-stan-glm-poisson/823/3 "2017-06-07T20:04:06Z")

</div>

> The recommendation is that if you don’t know that you want to put an informative prior on any of the coefficients, specify QR = TRUE.

So, the default is `QR=FALSE`? If so, what is the default prior for QR=FALSE?

> Then the default independent normal priors should be okay.

Interesting. I had presumed that this wouldn’t be the same for count regression.

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [June 7, 2017, 8:05pm UTC](https://discourse.mc-stan.org/t/rstanarm-prior-specification-stan-glm-nb-and-stan-glm-poisson/823/4 "2017-06-07T20:05:29Z")

</div>

For `QR = FALSE`, you pretty much have to do `prior_summary` to figure out what the priors were. By default, it is normal with mean zero but the scales are a function of the standard deviations of the variables.

---

<div class="post-metadata">

**Author:** ![ShanZhengYang](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@ShanZhengYang](https://discourse.mc-stan.org/u/ShanZhengYang)\
**Post date:** [June 7, 2017, 8:09pm UTC](https://discourse.mc-stan.org/t/rstanarm-prior-specification-stan-glm-nb-and-stan-glm-poisson/823/5 "2017-06-07T20:09:17Z")

</div>

Understood.

I noticed that when executing the model using QR=TRUE, this results in many more messages of the form

“”“  
Rejecting initial value:  
Log probability evaluates to log(0), i.e. negative infinity.  
Stan can’t start sampling from this initial value.  
”"""

I never noticed this when running models without specifying QR. Could you offer a short explanation why this behavior exists?

Thanks for the help

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [June 7, 2017, 8:17pm UTC](https://discourse.mc-stan.org/t/rstanarm-prior-specification-stan-glm-nb-and-stan-glm-poisson/823/6 "2017-06-07T20:17:21Z")

</div>

No, but you could probably also specify `init_r = 0.5` or something less than 2 to get starting values that are closer to zero.

---

<div class="post-metadata">

**Author:** ![Bob\_Carpenter](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bob_carpenter/32/9230_2.png) [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)\
**Post date:** [June 21, 2017, 8:22pm UTC](https://discourse.mc-stan.org/t/rstanarm-prior-specification-stan-glm-nb-and-stan-glm-poisson/823/7 "2017-06-21T20:22:26Z")

</div>

The problem is that Stan initializes uniformly in (-2, 2) on the unconstrained scale. This can sometimes lead to initial parameter guesses that are far enough out in the tail when transformed back to the constrained scale that they cause arithmetic problems. Specifing 0.5 gives you narrower inits in (-0.5, 0.5).
