According to chapter 3 of Gelman's Data Bayesian Analysis[DBA], when we have $y_i\sim N(\mu,\sigma^2)$, and $p(\mu,\sigma^2)\propto (\sigma^2)^{-1}$

Then, $p(\mu,\sigma^2|\mathbf{y})\propto \sigma^{-n-2} exp\left( -\frac{1}{2\sigma^2}(n-1)s^2+n(\bar y -\mu)^2\right)$.

We are interested in $p(\mu|y)=\int p(\mu,\sigma^2|\mathbf{y}) \ d\sigma^2$, and Gelman states the following in page 66 of the third edition of DBA:

enter image description here

My doubt is on the first line of the proportionals. How do we obtain that expression? I've tried a simple multivariate version of change of variables, with $H(A,z)=(\mu,\sigma^2)$.

However, since $\frac{\partial\mu}{\partial A} = \frac{1}{2}\left( nA-n(n-1)s^2\right)^{-1/2}$, absolute value of the Jacobian(det. of der.) seems to be $\frac{A}{4z^2} \left( nA-n(n-1)s^2\right)^{-1/2}$, which doesn't seem to produce the desired expression.

Any help would be appreciated.


1 Answer 1


The posterior density is denoted by $p(\mu, \sigma^2|y)$, but you need to find the marginal posterior density for $p(\mu|y)$. This is just like the problem of obtaining a marginal density when you know the joint density. Thus,

$$p(\mu|\mathbf{y}) = \int p(\mu, \sigma^2 |\mathbf{y}) \, d \sigma^2. $$

Remember that the integral is only in $\sigma^2$ and $\mu$. So the change of variable only affects $\sigma^2$.

Let $A = (n-1)s^2 + n(\mu - \bar{y})^2$, and $z = \frac{A}{2\sigma^2}$. Then $dz = -\dfrac{A}{2(\sigma^2)^2} d\sigma^2 \implies d\sigma^2 = -\dfrac{A}{2z^2} dz$

\begin{align*} p(\mu|\mathbf{y})& \propto \int_0^{\infty} \sigma^{-n-2} \exp\left( -\frac{1}{2\sigma^2}(n-1)s^2+n(\bar y -\mu)^2\right) d\sigma^2\\ & = \int_{\infty}^{0} \left(\sigma^{\frac{-n-2}{2}} \right)^2\exp \left(-\dfrac{A}{2 \sigma^2} \right) \left(-\dfrac{A}{2z^2}\right) dz\\ & = \left(\dfrac{A}{2} \right)^{\frac{-n}{2}} \int_{0}^{\infty}{z^{\frac{n+2}{2}}}z^{-2} \exp(-z)dz\\ & \propto A^{\frac{-n}{2}}\int_0^{\infty}z^{\frac{n-2}{2}} exp(-z) dz\\ & \vdots \end{align*}


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.