0
$\begingroup$

Suppose I have a sample of observations $y = (y_1,y_2, ... ,y_n)$ is drawn from a normal distribution $N(\mu,\sigma^2)$. We are assuming a non-informative prior on $(\mu,\log\sigma)$ i.e; $f(\mu,\sigma^2) \propto 1/\sigma^2$. We have to find the posterior distribution $f(\mu,\sigma^2|y)$.

Let's work it out. \begin{align} f(\mu,\sigma^2|y) &\propto f(\mu,\sigma^2) f(y|\mu,\sigma^2) \\ f(\mu,\sigma^2|y) &\propto \sigma^{-2} (2\pi)^{-n/2} \sigma^{-n} \exp\bigg(\frac {-1}{2\sigma^2} \sum_{i}(y_i-\mu)^2\bigg) \end{align} The next steps shown by my professor, which I do not understand are

$$ f(\mu,\sigma^2|y) \propto \sigma^{-n-2} \exp\bigg(\frac {-1}{2\sigma^2} [\sum_i(y_i-\bar y)^2 + n(\bar y - \mu)^2]\bigg) $$

and he quoted $\because $ Sum of deviations from the mean is zero.

$$ f(\mu,\sigma^2|y) \propto \sigma^{-n-2} \exp\bigg(\frac {-1}{2\sigma^2} [(n-1)s^2 + n(\bar y-\mu)^2]\bigg) $$

where $s^2$ is an unbiased estimator of ${\rm Var}(y)$

Kindly help me understanding the last two steps.

$\endgroup$
  • 2
    $\begingroup$ Try to rewrite the sum like this $\sum_i((y_i - \bar{y}) - (\mu -\bar{y}))^2$ $\endgroup$ – Łukasz Grad Feb 4 '17 at 18:38
  • 2
    $\begingroup$ Please check stats.stackexchange.com/tags/self-study/info and add [self-study] tag. $\endgroup$ – Tim Feb 4 '17 at 18:59
  • $\begingroup$ No, but in the class, my professor wrote the same which I have written. @ŁukaszGrad $\endgroup$ – Ashu Prakash Feb 5 '17 at 18:15
  • 1
    $\begingroup$ @AshuPrakash He ommited this step. Note that these sums are equal. Try to calculate $\sum_i(y_i - \mu)^2 = \sum_i((y_i - \bar{y})-(\mu - \bar{y}))^2 = \dots$ $\endgroup$ – Łukasz Grad Feb 5 '17 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.