I am reposting an “answer” to a question that I had given some two weeks ago here: Why is the Jeffreys prior useful? It really was a question (and I did not have the right to post comments at the time, either), though, so I hope it is OK to do this:

In the link above it is discussed that the interesting feature of Jeffreys prior is that, when reparameterizing the model, the resulting posterior distribution gives posterior probabilities that obey the restrictions imposed by the transformation. Say, as discussed there, when moving from the success probability θ in the Beta-Bernoulli example to odds ψ=θ/(1−θ), it should be the case that the a posterior satisfies P(1/3≤θ≤2/3∣X=x)=P(1/2≤ψ≤2∣X=x).

I wanted to create a numerical example of invariance of Jeffreys prior for transforming θ to odds ψ, and, more interestingly, lack thereof of other priors (say, Haldane, uniform, or arbitrary ones).

Now, if the posterior for the success probability is Beta (for any Beta prior, not only Jeffreys), the posterior of the odds follows a Beta distribution of the second kind (see Wikipedia)

with the same parameters. Then, as highlighted in the numerical example below, it is not too surprising (to me, at least) that there is invariancefor any choice of Beta prior(play around with`alpha0_U`

and`beta0_U`

), not only Jeffreys, cf. the output of the program.`library(GB2) # has the Beta density of the 2nd kind, the distribution of theta/(1-theta) if theta~Beta(alpha,beta) theta_1 = 2/3 # a numerical example as in the above post theta_2 = 1/3 odds_1 = theta_1/(1-theta_1) # the corresponding odds odds_2 = theta_2/(1-theta_2) n = 10 # some data k = 4 alpha0_J = 1/2 # Jeffreys prior for the Beta-Bernoulli case beta0_J = 1/2 alpha1_J = alpha0_J + k # the corresponding parameters of the posterior beta1_J = beta0_J + n - k alpha0_U = 0 # some other prior beta0_U = 0 alpha1_U = alpha0_U + k # resulting posterior parameters for the other prior beta1_U = beta0_U + n - k # posterior probability that theta is between theta_1 and theta_2: pbeta(theta_1,alpha1_J,beta1_J) - pbeta(theta_2,alpha1_J,beta1_J) # the same for the corresponding odds, based on the beta distribution of the second kind pgb2(odds_1, 1, 1,alpha1_J,beta1_J) - pgb2(odds_2, 1, 1,alpha1_J,beta1_J) # same for the other prior and resulting posterior pbeta(theta_1,alpha1_U,beta1_U) - pbeta(theta_2,alpha1_U,beta1_U) pgb2(odds_1, 1, 1,alpha1_U,beta1_U) - pgb2(odds_2, 1, 1,alpha1_U,beta1_U)`

This brings me to the following questions:

- Do I make a mistake?
- If no, is there a result like there being no lack of invariance in conjugate families, or something like that? (Quick inspection leads me to suspect that I could for instance also not produce lack of invariance in the normal-normal case.)
- Do you know a (preferably simple) example in which we
doget lack of invariance?

**Answer**

Your computation seems to be verifying that, when we have a particular prior distribution p(θ) the following two procedures

- Compute the posterior pθ∣D(θ∣D)
- Transform the aforementioned posterior into the other parametrization to obtain pψ∣D(ψ∣D)

and

- Transform the prior pθ(θ) into the other parametrization to obtain pψ(ψ)
- Using the prior pψ(ψ), compute the posterior pψ∣D(ψ∣D)

lead to the same posterior for ψ. This will indeed always occur (caveat; as long as the transformation is such that a distribution over ψ is determined by a distribution over θ).

However, this is not the point of the invariance in question. Instead, the question is whether, when we have a particular Method For Deciding The Prior, the following two procedures:

- Use the Method For Deciding The Prior to decide pθ(θ)
- Convert that distribution into pψ(ψ)

and

- Use the Method For Deciding The Prior to decide pψ(ψ)

result in the same prior distribution for ψ. If they result in the same prior, they will indeed result in the same posterior, too (as you have verified for a couple of cases).

As mentioned in @NeilG’s answer, if your Method For Deciding The Prior is ‘set uniform prior for the parameter’, you will not get the same prior in the probability/odds case, as the uniform prior for θ over [0,1] is not uniform for ψ over [0,∞).

Instead, if your Method For Deciding The Prior is ‘use Jeffrey’s prior for the parameter’, it will not matter whether you use it for θ and convert into the ψ-parametrization, or use it for ψ directly. This is the claimed invariance.

**Attribution***Source : Link , Question Author : Christoph Hanck , Answer Author : Juho Kokkala*