Posterior cdf of bernoulli and uniform prior

163 Views Asked by At

Let X1, . . . , Xn i.i.d. Bernoulli(θ) with a uniform prior. Show that the posterior density of ψ = log(θ/(1 − θ)) is

$$h(ψ|x) = \frac{Γ(n + 2)}{Γ(s + 1)Γ(n − s + 1)}(\frac{e^ψ}{1 + e^ ψ})^s(\frac{1}{1 + e^ ψ})^{n - s + 2}$$, ψ ∈ R.

I can't get the answer but some results i got is $h(\theta|x)\sim Beta(s+1, n - s + 1)$. Then $P(ψ<\tau) = P(ψ<\frac{e^\tau}{e^\tau+1}) $ is proportional to $$(\frac{e^ψ}{1 + e^ ψ})^s(\frac{1}{1 + e^ ψ})^{n - s}(\frac{e^\tau}{e^\tau+1})(1 - \frac{e^\tau}{e^\tau+1})$$. THis is different to the answer above and i can't figue what i did wrong. Thanks

1

There are 1 best solutions below

0
On

I will use $n\bar x$ instead of $s$ to represent the sample total. Then $$\mathcal L(\theta \mid \boldsymbol x) \propto f(\boldsymbol x \mid \theta)p(\theta) = \theta^{n \bar x} (1-\theta)^{n - n\bar x}.$$ Then by monotone transformation with the choice $\psi = g(\theta) = \log(\theta/(1-\theta))$ hence $\theta = g^{-1}(\psi) = e^\psi/(1+e^\psi)$, we have $$\mathcal L(\psi \mid \boldsymbol x) \propto \mathcal L(g^{-1}(\psi) \mid \boldsymbol x) \left|\frac{dg^{-1}}{d\psi}\right| = \left(\frac{e^\psi}{1+e^\psi}\right)^{n\bar x} \left(\frac{1}{1 + e^\psi}\right)^{n - n\bar x} \frac{e^\psi}{(1 + e^{\psi})^2} = \left(\frac{e^\psi}{1+e^\psi}\right)^{n\bar x + 1} \left(\frac{1}{1 + e^\psi}\right)^{n - n\bar x + 1}.$$ Apart from a minor error on your part, my findings agree with yours.