I am trying to understand how to derive the posterior distribution of a parameter $mu$ given data vector $z$, $P(mu|z)$, where
$$
mu sim N(0,A)
$$
and
$$
z|mu sim N(mu,1).
$$
Obviously from Bayes theorem
$$
P(mu|z) = g(mu) f(z|mu) /f(z).
$$
where
$$
f(z)= int g(mu) f(z|mu) d mu .
$$
I can write $g(mu) f(z|mu)$ as a pointwise product of normal densities:
$$
frac{1}{2 pi sqrt{A}} exp bigg(-frac{mu^2+A(z-mu)^2}{2A}bigg)
$$
the solution is given in Efron's book on Large Scale Inference, p. 2. here:
$$
mu|z sim N(zB,B)$$ where $$B=frac{A}{A+1}
$$
I would appreciate advice on how to approach the problem (and the answer to this question is a proof). In particular I do not understand what to do with the integral in the numerator of Bayes theorem.
EDIT
Following answer by @Neil_G I took a next approach:
We have:
begin{align}
g(mu) &propto expbigg(- frac{mu^2}{2A}bigg) \[8pt]
f(z|mu) &propto expbigg(z mu – frac{1}{2}(z^2+mu^2)bigg)
end{align}
so
begin{align}
P(mu|z) &propto expbigg(- frac{1}{2A} mu^2 + zmu – frac{1}{2} z^2 – frac{1}{2} mu^2bigg) \[8pt]
&= exp bigg(-frac{1}{2B} (mu^2+Bz^2-2Bz mu)bigg) \[8pt]
&propto exp bigg(-frac{1}{2B} (mu^2-2Bz mu)bigg) \[8pt]
&propto exp bigg(-frac{ (mu – Bz)^2}{2B}bigg)
end{align}
which completes the proof.
Best Answer
First note that begin{align} x sim N(mu, sigma^2) &Leftrightarrow f(x mid mu, sigma^2) propto expleft(fracmu{sigma^2}x -frac1{2sigma^2}x^2right) & tag{1} \ x sim N(mu, sigma^2) &Rightarrow L(mu mid x, sigma^2) propto expleft(frac{x}{sigma^2}mu -frac1{2sigma^2}mu^2right) & tag{2} end{align}
So, begin{align} P(mu) &propto expleft(-frac{1}{2A}mu^2right) & text{by (1)} \ L(mu mid z) &propto expleft(mu z – frac12mu^2right) & text{by (2)} \ implies P(mu mid z) &propto P(mu) L(mu mid z) \ &propto expleft(mu z – frac{A + 1}{2A}mu^2right) \ implies mu &sim Nleft(zfrac{A}{A+1}, frac{A}{A+1}right) & text{by (1)}. end{align}
Similar Posts:
- Solved – Deriving the Ridge Regression $boldsymbol{beta}mid mathbf{y}$ distribution
- Solved – marginal distribution of multivariate normal
- Solved – Posterior distribution of Normal Normal-inverse-Gamma Conjugacy
- Solved – How to derive the conjugate prior of an exponential family distribution
- Solved – Fisher information in logit model