# Obvious demonstration of the posterior density of normal laws in bayesian inference

Given the observations' density $$f(X|\theta) = \mathcal{N}(\theta,1)$$ and the prior density $$f(\theta) = \mathcal{N}(0,\sigma^2)$$, it it is said that it is obvious that the posterior density is equal to : $$\mathcal{N}(\frac{X}{1+\sigma^{-2}},\frac{1}{1+\sigma^{-2}})$$.

I use following relation to compute the posterior density : $$f(\theta|X) = \frac{f(X|\theta)f(\theta)}{\int f(X|\theta)f(\theta)d\theta}$$, but I dont find it obvious at all...

Any help appreciated

• Obiousness is in the mind of the beholder: it depends on what one knows and can bring immediately to mind. Thus, your question is predicated on some understanding of what you are expected to know. For instance, are you familiar with the theory of linear regression? With the bivariate Normal family of distributions? What material would be appropriate to invoke when providing an answer?
– whuber
Oct 29 '19 at 17:41
• @whuber this the correction of an exercise in a statistic course. Here the obviousness means that it don't need much computation to arrive at this result. Knowledge on normal distribution and bayesian modeling are effectively assumed Oct 29 '19 at 18:52

\begin{align} f(\theta|X) &\propto \exp(-\frac{1}{2}(X-\theta)^2)\cdot \exp(-\frac{1}{2}\sigma^{-2}\theta^2)\\ & \propto \exp(-\frac{1}{2} ((1+\sigma^{-2})\theta^2 - 2 \theta X + X^2)) \\ & \propto \exp(-\frac{1}{2} (1+\sigma^{-2}) (\theta^2 - 2 \theta \frac{X}{1+\sigma^{-2}})) \\ & \propto \exp(-\frac{1}{2} (1+\sigma^{-2}) (\theta - \frac{X}{1+\sigma^{-2}})^2) \end{align}
The latter is the kernel of a normal $$\mathcal N (\frac{X}{1+\sigma^{-2}}, \frac{1}{1+\sigma^{-2}})$$.