Explanation of the Posterior Derivation of the Gaussian Distribution I'm reading through my notes and I don't quite understand this bit:



I understand how the likelihood was calculated but no more than that.Can anyone  explain the steps and exactly how they go from one step to the other? My main problem is how the prior and posterior distribution are found. Thanks
 A: The first image is just variable change from $\sigma^{-2}=\tau$. They assume $\mu$ is known, therefore it's just constant, with no distribution (ignoring the non-degenerate case, which doesn't change the analysis). The likelihood is just multiplication of $p(y_i|\tau)\ \ \  \forall i$. We're trying to find the posterior distribution, i.e. $p(\tau|D)$, the distribution of $\tau$ given the data. Bayes formula says $$p(\tau|D)=\frac{p(\tau)p(D|\tau)}{p(D)}$$ 
This is a univariate PDF for $\tau$, and all other things can be regarded as constant. Since $p(D)$ doesn't depend on $\tau$, it's just a normalizing constant, and can be ignored for now, which is why we insist on using proportionality in these types of problems: $p(\tau|D)\propto p(\tau)p(D|\tau)$. 
The reason is to figure out the form of the PDF and guess the normalizing constant w/o even computing $p(D)$. For example if it was $p(\tau)\propto e^{-2\tau}$, then the prior would be in exponential form, with normalizing constant $\lambda=2$, since the exponential PDF is in the form $\lambda e^{-\lambda x}$, which is normalized by default.
Going back to where we left, we had $p(\tau|D)\propto p(\tau)p(D|\tau)$. We know the likelihood, and it's in Gamma form (for $\tau$). Recall that it was a Gaussian PDF for $y_i$. So, the format actually takes different names if you change the variable. Now, we don't know the prior, and need to choose one. From the conjugate prior list, we see that $p(\tau)$ is Gamma . (5th entry in the 2nd table). 
Conjugate priors make the posterior calculation much easier by allowing them to be in known forms (because posterior and prior are in the same family). You could choose any prior you want, but, then you'd have to integrate the denominator for having the full posterior, if the resulting multiplication of prior and likelihood is not in a known form. And, it's very typical to choose conjugate priors in Bayesian inference.
