Greetings,
I am interested in specifying a Jeffreys prior for a rate parameter in Stan. I know that the Jeffreys prior is 1/(sqrt(lambda)), where lambda is the rater parameter. Also, the conjugate distribution for lambda is gamma(a,b). I’m just not sure how to set this up in Stan language. On a similar topic, is there a resource available that lists a variety of Jeffreys priors for different distributions and how they can be set up in Stan? Thanks in advance.
DK
1 Like
You can put in your model section for the Jeffreys prior:
target + = -0.5*log(lambda);
And for the gamma will be
target += gamma_lpdf( lambda | a, b );
And be careful with Jeffreys prior, they usually made the posterior distribution improper, and more likely the prediction distribution will be improper too. And this is really bad when you are comparing models.
This link might help you
Prior recomendation
Good luck :)
2 Likes
You cannot use improper distributions for Bayesian inference. So it’s beyond “really bad”; it’s plain out “wrong”.
@maxbiostat, Well I dont know about what you say! For example Miggon in 2008 use an improper prior for the df of a miltivariate t-student and obtain better results than an exponential distribution.
So actually you can use them, you just need to know when and pay the price
:)
If the posterior is improper, the very claim of “better results” is void. Fonseca et al. (2008), which I think is the paper you’re referring to, show that an improper prior on the df leads to a proper posterior, and hence there is no problem. When I said “You cannot use improper distributions for Bayesian inference” I meant that an improper posterior cannot be used for drawing inference.
1 Like
@maxbiostat Ohh well true! You are right
So, what if I simply specified a proper gamma(a, b) prior for the rate and then monitored the a Jeffreys prior 1/(sqrt(lambda)). For example
Y ~ dpois(lambdaJeff)
lambda ~ gamma(a, b)
lambdaJeff <- 1/sqrt(lambda))
Is that appropriate?
No. That would have nothing to do with a Jeffreys’s prior and would just be a weird transformation of a Gamma random variable. In this case, the Jeffrey’s prior on the rate leads to a proper posterior distribution, so no need to worry. If you want to employ a Jeffreys’s prior, you can do it. It will complicate things like prior predictive checks, but that’s a consequence of the modelling choice.
Hi,
Thanks but perhaps I am not being clear. I am simply uncertain how to set the Jeffreys Prior for the rate parameter. The Jeffreys prior is sqrt(1/lambda) (I wrote that incorrectly in my last emails. So, it seems to be a transformation of the rate parameter, lambda, whose conjugate distribution is gamma(a,b). Exactly how do I set this up in Stan, and what would the values of the shape and scale parameters be?
Thanks again,
David
@asael_am already answered your question above. Look for the post that talks about target
statements.
1 Like
Missed that, thanks. The reply leaves open the choice of shape and scale. I would image that seems to matter, so in a strange way, Jeffreys prior is both objective and subjective. But, it’s possible I am missing what values of a and b should be chosen. Are there suggestions in the literature?
Thanks again!
I think you have misunderstood. The point is that you can either use a Jeffreys’s prior or a gamma prior. If you go with former, all you need is
1 Like
There is nothing “objective” about a Jeffreys prior. Like all modeling choices, both in the observational model and in the prior model, it is an assumption that has to be justified within the scope of a given analysis. See https://arxiv.org/abs/1708.07487 for much more.
1 Like