# Inference with Gaussian Random Variable

Let $X = N(0,\frac{1}{\alpha})$, $Y = 2X + 8 + N_{y}$, and $N_{y}$ be a noise $N_{y} = N(0,1)$. Then, $P(y|x) = \frac{1}{\sqrt{2\pi}}exp\{ -\frac{1}{2}(y - 2x - 8)^{2} \}$ and $P(x) = \sqrt{\frac{\alpha}{2\pi}}exp\{-\frac{\alpha x^{2}}{2}\}$.

The mean vector is:

$$\mathbf{\mu} = \left( \begin{array}{c} \mu_{x}\\ \mu_{y}\end{array} \right)= \left( \begin{array}{c} 0\\ 8\end{array} \right).$$

The question is how to calculate the variance of Y.

I know that the correct answer is

$$\frac{4}{\alpha} + 1,$$

but don't know how to get from $$var(Y) = E[(Y-\mu_{y})^{2}] = E[(2X+N_{y})^{2}]$$

to

$$\frac{4}{\alpha} + 1.$$

Can anybody help? UPDATE: Thank you All for answers

The law of iterated expectations can help here. We have:

$$Var[Y]=E(Var[Y|X])+Var[E(Y|X)]$$

Now conditional on $X$ the expected value of $Y$ is $2X+8$, and its variance is $1$. So we have:

$$Var[Y]=E(1)+Var[2X+8]=1+4 Var[X]=1+\frac{4}{\alpha}$$

• (+1) not so straightforward algebra, nice alternative solution. – Dmitrij Celov Apr 2 '11 at 16:14

Solution to this homework is straightforward application of simple algebra and independence of $X$ and $N_y$: $\mathbb{E} (2 X + N_y)^2 = 4 \mathbb{E} X^2 + 4 \mathbb{E} X \mathbb{E} N_y + \mathbb{E} N_y^2 = 4 Var X + 0 + Var N_y = \frac{4}{\alpha} + 1$.

• Thanks for a swift answer, not a homework though. Would have tagged it as such if it really was. – matcheek Apr 2 '11 at 14:18