-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A better default prior for shape parameter of negative binomial #1614
Comments
I looked again at this. Previously, I had missed that Dan used alpha=1/phi. I made a notebook showing the steps going from Dan's results to PC prior for phi, and an inverse-gamma approximation that is easy to use. The recommended prior @paul-buerkner if you agree with the choice, I can make a PR, too |
Looks good! A PR would be great! |
I like this a lot. It has a nice intuitive appeal. |
Quick question: I assume you are suggesting to just use |
Yes.
Do you want documentation? It would be nice to mention the default priors and brief justifications (e.g. one sentence and reference or link) |
Ah I see. Yes, for the doc it could be more sensible if you would add the info. Do you think you can do it in the next couple of days? I will try to submit the new brms version to CRAN this week. |
Hmm... I looked at the code, and I don't know how to make the change for the prior as if I now read it correctly, there are 4 distributions that have parameter
I have updated Stan prior choice Wiki today to include the new advice for negbinomial |
good point. let me think about it and see how i can fix it.
Aki Vehtari ***@***.***> schrieb am Mo., 18. März 2024, 18:13:
… Hmm... I looked at the code, and I don't know how to make the change for
the prior as if I now read it correctly, there are 4 distributions that
have parameter shape and the default prior is set only based on the name
of the parameter, but the family name doesn't matter. If you know how to
fix it, then here is a proposal for the updated doc
#' Further, family \code{student} needs the parameter
#' \code{nu} representing the degrees of freedom of Student-t distribution.
#' By default, \code{nu} has prior \code{gamma(2, 0.1)}, which is
#' close to a penalized complexity prior (see Stan prior choice Wiki),
#' and a fixed lower bound of \code{1}.
#' Family \code{negbinomial} needs a \code{shape} parameter that has by
#' default \code{inv_gamma(0.4, 0.3)} prior which is close to a
#' penalized complexity prior (see Stan prior choice Wiki).
#' Families \code{gamma}, \code{weibull}, and \code{inverse.gaussian},
#' need a \code{shape} parameter that has a \code{gamma(0.01, 0.01)}
#' prior by default.
I have updated Stan prior choice Wiki today to include the new advice for
negbinomial
—
Reply to this email directly, view it on GitHub
<#1614 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADCW2AH3CDGE2RGY4S77YP3YY4HDTAVCNFSM6AAAAABEMO3T36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUGM2DSNRYGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
It's now working. I implemented a small internal feature that allows for family-specific default priors. I think it's actually kind handy more generally and I guess I will expand this to many other families at some point. |
… v2.21.0, see <paul-buerkner/brms#1614> [<https://github.com/stan-dev/stan/wiki/Prior-Choice-Recommendations> has been updated as well])
The current default prior for
shape
parameter ofnegbinomial
isgamma(0.01, 0.01)
which having a lot of mass for near 0 values, that is, for high overdispersion. A more reasonable prior would be something close to the PC prior shown e.g. in https://dansblog.netlify.app/posts/2022-08-29-priors4/priors4.html#the-dream-pc-priors-in-practice. PC prior has parameterlambda
, and I don't know yet what would be a good default for that, so I'm not yet suggesting the new default, but creating the issue so that I don't forget this.EDIT: removed wrong advice
The text was updated successfully, but these errors were encountered: