1
$\begingroup$

I'd like to calculate the posterior distribution given the prior distribution $w\sim N(0,\Sigma_p)$ and the likelihood $y|X,w\sim N(X^\top w,\sigma_n^2I).$

Ignoring everything that does not contain w:

$p(w|X,y)\propto p(y|X,w)p(w) \propto exp(-{1 \over 2} (\sigma_n^{-2}(y-X^\top w)^\top (y-X^\top w) -w^\top\Sigma_p^{-1}w))= exp(-{1 \over 2}(\sigma_n^{-2}(w^\top Xy + y^\top X^\top w)-w^\top(\sigma_n^{-2}XX^\top -\Sigma_p^{-1} )w))$

Now the answer should be $exp(-{1 \over 2}(w - \bar w)^\top(\sigma_n^{-2}XX^\top -\Sigma_p^{-1})(w - \bar w))$ where $\bar w =\sigma_n^{-2}(\sigma_n^{-2}XX^\top -\Sigma_p^{-1})^{-1}Xy.$

Could anyone help how to do this?

Thanks!

$\endgroup$

1 Answer 1

1
$\begingroup$

Ok so I figured it out. Notice $w^\top X y = y^\top X^\top w$. So continuing the above expression: $p(w|X,y) \propto exp(-{1 \over 2}(2\sigma_n^{-2}y^\top X w -w^\top(\sigma_n^{-2}XX^\top -\Sigma_p^{-1} )w))= exp(-{1 \over 2}(w^\top A^{-1}w-2 \bar w^\top A^{-1}w))$ where $A=(\sigma_n^{-2}XX^\top -\Sigma_p^{-1})^{-1} $ and the answer follows.

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.