# What is the covariance of two dependent normal distributed random variables

Problem is about getting the covariance of two random variables that are not independent: $\operatorname{cov}(\tilde{x}\mid(\tilde{y}=y),\tilde{x})= \text{ ?}$

$$\tilde{x}\sim N(\mu_1,\sigma^2_1)$$

$$\tilde{x}\mid (\tilde{y}=y) \sim N(\mu_2,\sigma^2_2)$$

where $\tilde{y}=\tilde{x}+\tilde{n}$ where $n$ is also normal distributed. So there is a change in both the mean and variance for the conditional distribution.

Now my question is to get the covariance between $\tilde{x} \mid (\tilde{y}=y)$ and $\tilde{x}$.

I tried to deduct it as following but I am stuck:

\begin{align} & \operatorname{cov}(\tilde{x}\mid(\tilde{y}=y),\tilde{x})=E((\tilde{x} \mid (\tilde{y} = y) \times \tilde{x})-E(\tilde{x} \mid (\tilde{y} = y) E(\tilde{x}) \\[10pt] = {} & E(\tilde{x}\mid (\tilde{y}=y)\times \tilde{x})-\mu_1\mu_2=\text{ ?} \end{align}

• If the conditional distribution of $\bar x$ given $\bar y = y$ does not depend on $y$, then $\bar x$ and $\bar y$ are independent. ${}\qquad{}$ – Michael Hardy Sep 8 '15 at 2:43
• @MichaelHardy It does. $\mu_2$ and $\sigma_2^2$ are both functions of $\tilde{y}$'s mean and variance. – Nicole Leung Sep 8 '15 at 17:12
• Your question is not clear. You want $\operatorname{cov}(\bar x\mid(\bar y=yu),\bar x)$. What is that? There is such a thing as a conditional covariance, but your condition seems to apply to only one of the two arguments to the covariance. And one of them is called "$\bar x\mid(\bar y=y)$. What does that mean? In a notation such as $X\mid Y\sim N(\bullet,\bullet)$, there is no object called $X\mid Y$, but confused students sometimes read it that way. Rather, there is a conditional distribution given $Y$, of $X$. ${}\qquad{}$ – Michael Hardy Sep 8 '15 at 17:32
• You are deeply deeply confused. I did not say there was anything wrong with that usage and I did say there is a correct way to use it. And the Wikipedia article to which you link uses it correctly in its section on conditional distributions. ${}\qquad{}$ – Michael Hardy Sep 8 '15 at 23:17
• Wikipedia writes that if $(X_1,X_2)$ is bivariate normal with variances both $1$ and covariance $\rho$, then $X_1\mid X_2 = x_2 \sim N(\rho x_2, 1-\rho^2)$. That is an example of the correct usage. One could also write $\operatorname{cov}(X_1,X_2 \mid X_3)$ if one has a joint distribution of $(X_1,X_2,X_3)$. And that means $\operatorname{cov}(\bullet\mid X_3)$ with arguments $X_1,X_2$; it does not mean there is some object called $X_1,X_2\mid X_3$ or $X_2\mid X_3$. ${}\qquad{}$ – Michael Hardy Sep 8 '15 at 23:23

$$\tilde{x}\sim N(\mu_1,\sigma^2_1),$$
$$\tilde{x}\mid (\tilde{y}=y) \sim N(\mu_2,\sigma^2_2).$$
This means that given the event that that $\bar y=y$, the conditional distribution of $\bar x$ is $N(\mu_2,\sigma_2^2)$. This is a perfectly correct use of the notation $\text{“ } \tilde{x}\mid (\tilde{y}=y) \sim N(\mu_2,\sigma^2_2)\text{ ''}$.
However, the request for a covariance between $\bar x$ and something called $\text{“ }\bar x\mid (\bar y=y)\text{ ''}$ makes it appear that the poster thinks there is some random variable involved called $\bar x\mid (\bar y=y)$. The question seems to contemplate a joint distribution between that random variable and the random variable $\bar x$, so that there would be a covariance between them. That would be the case if $y$ were a random variable, but nothing to that effect appears in the question. That is a misunderstanding of the meaning of the notation. The notation does not refer to something called $\text{“ }\bar x\mid (\bar y=y)\text{ ''}$ Rather, the meaning of the notation is as explained in the paragraph above.
One could speak of a random variable $\operatorname{E}(\bar x\mid \bar y)$, which would be a function of $\bar y$, and ask for the covariance between that and $\bar x$. However, without knowing anything about the joint distribution of $\bar x$ and $\bar y$, one could not specify which distribution that is.