Bayesian posterior with Normal inverse gamma model

1.3k Views Asked by At

I want to derive an expression for the posterior distribution (without the normalizing constant) of: $$p(\mu,\sigma^2)=p(\mu| \sigma^2)p(\sigma^2)$$ with $$\mu|\sigma^2 \sim N(2,1.7^2\sigma^2) \ \ \text{and} \ \ \sigma^2\sim IG(10,20)$$ IG denotes an inverse-gamma distribution. I have been following the example from : https://people.eecs.berkeley.edu/~jordan/courses/260-spring10/lectures/lecture5.pdf page 3, but I don't get the same results. I'm not sure what happened to the square in the summation in that example. I get the following:

$$p(\mu| \sigma^2)p(\sigma^2) \propto \sigma^{2^{-a-1}}exp(\frac{-b}{\sigma^2})\times 1.7^{-2n}\sigma^{2^{-n/2}}exp(-\frac{\sum(x_i-2)^2}{2\times1.7^2\times\sigma^2})\propto \sigma^{2^{-(a+n/2)-1}}exp(-\frac{b+\sum(x_i-2)^2/(2\times 1.7^2)}{\sigma^2})\sim IG(a+n/2,b+\sum(x_i-2)^2/2*1.7^2),$$ with $a=10$ and $b=20$.

Im not sure about the $1.7^2$ nor the square in the sum, mostly because it doesn't match the results in the link. Can someone tell me what I´m doing wrong?