### Bayesian estimation of the mean of a normal distribution

$p\left(measure\phantom{\rule{thickmathspace}{0ex}}{y}_{i}\right)=p\left("{Y}_{i}={y}_{i}"\right)=P\left({y}_{i}-\frac{\mathrm{\Delta }}{2}\le {Y}_{i}\le {y}_{i}+\frac{\mathrm{\Delta }}{2}|\mathrm{\Theta }\right)$

$\frac{1}{\sqrt{2\pi {\sigma }^{2}}}exp\left(\frac{-1}{2{\delta }^{2}}{\left({y}_{i}-\mathrm{\Theta }\right)}^{2}\right)\mathrm{\Delta }$

$P\left(\mathrm{\Theta }|D\right)\propto P\left(D|Theta\right)\ast P\left(\mathrm{\Theta }\right)$ $P\left ( \Theta |D\right )\propto P\left ( D|Theta \right )*P\left ( \Theta \right )$，其中 $P\left(\mathrm{\Theta }|D\right)\propto \underset{i=1}{\overset{n}{\coprod }}exp\left(-\frac{1}{2{\sigma }^{2}}{\left({y}_{i}-\mathrm{\Theta }\right)}^{2}\right)P\left(\mathrm{\Theta }\right)$ $P\left ( \Theta |D \right )\propto \coprod_{i=1}^{n}exp\left ( -\frac{1}{2\sigma ^{2}}\left ( y_{i}-\Theta \right )^{2} \right )P\left ( \Theta \right )$，即
$P\left(\mathrm{\Theta }|D\right)\propto exp\left(\underset{i=1}{\overset{n}{\sum }}-\frac{1}{2{\sigma }^{2}}{\left({y}_{i}-\mathrm{\Theta }\right)}^{2}\right)P\left(\mathrm{\Theta }\right)$ $P\left ( \Theta |D \right )\propto exp\left (\sum_{i=1}^{n} -\frac{1}{2\sigma ^{2}}\left ( y_{i}-\Theta \right )^{2} \right )P\left ( \Theta \right )$，對於這里，有一個小的tricky，即可將前面的表達式表達為： $P\left(\mathrm{\Theta }|D\right)\propto exp\left(\underset{i=1}{\overset{n}{\sum }}-\frac{1}{2{\sigma }^{2}}{\left({y}_{i}-\stackrel{¯}{y}+\stackrel{¯}{y}-\mathrm{\Theta }\right)}^{2}\right)P\left(\mathrm{\Theta }\right)$ $P\left ( \Theta |D \right )\propto exp\left (\sum_{i=1}^{n} -\frac{1}{2\sigma ^{2}}\left ( y_{i}-\bar{y}+\bar{y}-\Theta \right )^{2} \right )P\left ( \Theta \right )$，化簡得:
$P\left(\mathrm{\Theta }|D\right)\propto exp\left(-\frac{1}{2{\sigma }^{2}}\underset{i=1}{\overset{n}{\sum }}\left(\left({y}_{i}-\stackrel{¯}{y}{\right)}^{2}+\left(\stackrel{¯}{y}-\mathrm{\Theta }{\right)}^{2}+2\ast \left({y}_{i}-\stackrel{¯}{y}\right)\ast \left(\stackrel{¯}{y}-\mathrm{\Theta }\right)\right)\right)P\left(\mathrm{\Theta }\right)$

$\propto exp\left(-\frac{1}{2{\sigma }^{2}}\left(n{\sigma }^{2}+n{\left(\stackrel{¯}{y}-\mathrm{\Theta }\right)}^{2}\right)\right)P\left(\mathrm{\Theta }\right)$

$P\left(\mathrm{\Theta }\right)\propto exp\left(-\frac{n{\left(\stackrel{¯}{y}-\mathrm{\Theta }\right)}^{2}}{2{\sigma }^{2}}-\frac{{\left(\mathrm{\Theta }-{\mu }_{0}\right)}^{2}}{2{\sigma }_{0}^{2}}\right)$