# Example: Normal Distribution

Let $\sigma^{2}$ be known, and

• Likelihood: $f_{\left.X\right|\mu}=N\left(\mu,1\right)$.
• Prior: $f_{\mu}=N\left(0,100\right)$.

Focusing on the Kernels, we know that

\begin{aligned} f_{\left.\mu\right|X} & \propto\exp\left(-\frac{1}{2}\left(x-\mu\right)^{2}\right)\exp\left(-\frac{1}{2.100}\mu^{2}\right)\\ & =\exp\left\{ -\frac{1}{2}\left(x^{2}+\mu^{2}-2x\mu+\frac{\mu^{2}}{100}\right)\right\} \\ & \propto\exp\left\{ -\frac{1}{2}\left[\frac{101}{100}\left(\mu^{2}-2\mu\frac{100}{101}x+\left(\frac{100}{101}x\right)^{2}-\left(\frac{100}{101}x\right)^{2}\right)\right]\right\} \\ & \propto\exp\left\{ -\frac{\left(\mu-\frac{100}{101}x^{2}\right)}{2.\frac{100}{101}}\right\} \end{aligned}

Where the proportional signs keep track of expressions that depend solely on $x$ being added or removed from the exponential. Notice that we can multiply or divide the pdf by functions of $x$ at will, because $x$ does not belong to the kernel (after all, this is a pdf of $p$). Instead, $x$ belongs to the normalizing constant. We already know that the posterior integrates to one, so our goal is to find the right kernel, and we can always adjust the constant later.

The result above implies that

\begin{aligned} f_{\left.\mu\right|X} & \propto\exp\left\{ -\frac{\left(\mu-\frac{100}{101}x^{2}\right)}{2.\frac{100}{101}}\right\} \\ \Downarrow\\ f_{\left.\mu\right|X} & =N\left(\frac{100}{101}x^{2},\frac{100}{101}\right).\end{aligned}

The fact that we ended up with a normal distribution is a consequence of the fact that the normal distribution is a conjugate prior with a normal likelihood function.