# Probability of $X$ given $Z = x$ with $Z = X + Y$ and both $X$ and $Y$ normal

Let $X$ and $Y$ be independent random normal variables such that $X\sim N(\mu _{X},\sigma _{X}^{2})$ and $Y\sim N(\mu _{Y},\sigma _{Y}^{2})$. Let $Z = X + Y$, so that $Z\sim N(\mu _{X}+\mu _{Y},\sigma _{X}^{2}+\sigma _{Y}^{2})$.

I'm wondering what is $f_X(x \mid Z = z)$, i. e. the probability distribution of X given Z.

I'm guessing that I can use the fact that $f_{X}(x\mid Z=z)f_{Z}(z)=f_{X,Z}(x,z)=f_{Z}(z\mid X=x)f_{X}(x)$, since I know $f_X$ and $f_Z$, and my intuition is that $f_{Z}(z\mid X=x)$ is just the probability distribution of a normal random variable with mean $x+\mu_Y$ and variance $\sigma _{Y}^{2}$, but I don't actually know the latter fact since I haven't proved it and so I'm not sure it's correct.

Another possibility I have considered is to calculate $f_{X,Z}$ (and use that to derive $f_X(x \mid Z = z)$ by using $f_{X}(y\mid Z=z)={\frac {f_{X,Z}(x,z)}{f_{Z}(z)}}$), but I need $Cov(X,Z)$ for that, and I don't know what it is.

I hope that this isn't too confused and that what I'm asking is clear enough!

Philippe

Let $A= \begin{pmatrix} 1 & 0 \\ 0 & 1 \\ 1& 1\end{pmatrix}$. \begin{align*} \begin{pmatrix} X\\Y\end{pmatrix} &\sim N\left(\begin{pmatrix}\mu_X \\ \mu_Y\end{pmatrix},\begin{pmatrix}\sigma^2_X & 0 \\ 0 & \sigma^2_Y\end{pmatrix}\right)\\ \begin{pmatrix} X\\Y\\Z\end{pmatrix} &= A\begin{pmatrix} X\\Y\end{pmatrix}\\ &\sim N\left(A\begin{pmatrix}\mu_X \\ \mu_Y\end{pmatrix},A\begin{pmatrix}\sigma^2_X & 0 \\ 0 & \sigma^2_Y\end{pmatrix}A^T\right)\\ &= N\left(\begin{pmatrix}\mu_X \\ \mu_Y \\ \mu_X+\mu_Y\end{pmatrix},\begin{pmatrix}\sigma^2_X & 0 & \sigma^2_X \\ 0 & \sigma^2_Y & \sigma^2_Y\\ \sigma^2_X & \sigma^2_Y & \sigma^2_X+\sigma^2_Y\end{pmatrix}\right)\\ \end{align*} So $X|Z$ is normally distributed with mean $$\mu_{X|Z} = \mu_X + \frac{\sigma^2_X}{\sigma^2_X+\sigma^2_Y}\{Z-(\mu_X+\mu_Y)\}$$ and variance $$\sigma^2_{X|Z} = \sigma^2_X-\frac{\sigma^4_X}{\sigma^2_X+\sigma^2_Y}$$ https://en.wikipedia.org/wiki/Multivariate_normal_distribution#Conditional_distributions

Let $X\sim N(0,1)$ and $Y\sim N(0,1)$, independent.

Consider the transformation: $(X,Y)\rightarrow (X,Z)$, $Z=X+Y$

Jacobian matrix is $\mid \det J\Big(\dfrac{(X,Y)}{(X,Z)}\Big)\mid=\mid 1/\det J\Big(\dfrac{(X,Z)}{(X,Y)}\Big)\mid=1$

Hence $f_{(X,Z)}(x,z)=\dfrac{1}{2\pi}e^{-\dfrac{x^2+(z-x)^2}{2}}\cdot\mid \det J\Big(\dfrac{(X,Y)}{(X,Z)}\Big)\mid=\dfrac{1}{2\pi}e^{-\dfrac{x^2+(z-x)^2}{2}}$

Now use $f_{X}(x\mid Z=z)f_{Z}(z)=f_{X,Z}(x,z)$.

Note: I used normalized version here. You can easily transform that into your version by just using $x\rightarrow \dfrac{x-\mu_X}{\sigma_X}$ and $y\rightarrow \dfrac{y-\mu_Y}{\sigma_Y}$ (Constant term will change too.)

Here: $J\Big(\dfrac{(f,g)}{(h.k)}\Big)=\begin{bmatrix}\frac{\partial f}{\partial h}&\frac{\partial g}{\partial h}\\\frac{\partial f}{\partial k}&\frac{\partial g}{\partial k}\end{bmatrix}$

• Thanks! Would you mind filling in some details about lines 3 to 4 in your answer? I'm not familiar with how one can use a Jacobian to derive the joint density of the transformation of a pair of normally distributed random variables and would like to understand what you did. (I'm also not sure what $\dfrac{(X,Y)}{(X,Z)}$ means in your notation. I gather that it must be a vector of transformations, but I'm not sure which ones. Again, I don't know anything about how one can use the Jacobian in the situation, so I could use more details.) Commented Aug 25, 2017 at 16:37
• @Philippe here $J\Big(\dfrac{f,g}{h.k}\Big)=\begin{matrix}\frac{\partial f}{\partial h}&\frac{\partial g}{\partial h}\\\frac{\partial f}{\partial k}&\frac{\partial g}{\partial k}\end{matrix}$ Commented Aug 25, 2017 at 16:45
• @Philippe you must read Jacobian for this type cases. This is very useful. Commented Aug 25, 2017 at 16:50