Working through the book Bayesian Essentials with R by Jean-Michel Marin & Christian Robert I am trying to work out the posterior for the model given on page 29 when the data is from a normal with unknown mean and variance.
The priors for $\mu$ and $\sigma^2$ are (p.29-30)
\begin{align} \pi(\mu | \sigma^2) &\sim N(0,\sigma^2)\\ \pi(\sigma^2) &\sim \exp(-\sigma^{-2})(\sigma^2)^{-2} \end{align}
and the likelihood (from top of page 29) as
$$l \propto \exp(-(n(\mu - \bar{x})^2 + s^2)/2\sigma^2)/\sigma^n$$
On the top of page 31 the posterior is given as
$$\pi((\mu, \sigma^2) | D) \propto \pi(\sigma^2) \times \pi(\mu | \sigma^2) \times l$$
Plugging the values in gives
\begin{align} \pi((\mu, \sigma^2) | D) \propto ~ & \exp(-\sigma^{-2})(\sigma^2)^{-2} \times \\ &\exp(-\mu^2 / 2\sigma^2) \times \exp(-(n(\mu - \bar{x})^2 + s^2)/2\sigma^2)/\sigma^n\tag{1} \end{align}
I cannot see how to move from this to what is given below.
I'd really appreciate any hints. Thank you.
I can combined the exponent parts of the prior on $\sigma$ and $\mu$ to give $\exp(-\mu^2/2\sigma^2 - 1/\sigma^2)$ which is equal to $\exp(-(\mu^2 + 2)/2\sigma^2)$. I can see how the $1/\sigma^n$ from the likelihood is equal to $(\sigma^{-2})^{n/2}$ but I cannot see how $(\sigma^2)^{-2} = \sigma^{-4}$ is equal to $(\sigma^{-2})^{1/2 + 2}$ , which I think equals $\sigma^{-5}$.