# Linear conditional expectations example

I am looking for an example of two random variables $X,Y$ such that

(a) $X,Y$ are not independent.

(b) At least one of $X,Y$ is not normal.

(c) $E(X|y)$ (expected value of $X$ given $Y=y$) is linear in $y$, i.e. of the form $a+by$, and $E(Y|x)$ is linear in $x$.

(d) The correlation coefficient $\rho\neq \pm 1$.

-

Let $Y$ be any discrete random variable, choose constants $a$ and $b$, and just set $X=aY+b$. They are not independent, not Gaussian, and the conditional expectations are linear as you wanted.

-
You are right. I just added an additional condition. –  TCL Apr 15 '11 at 5:26

$Y, Z$ are r.v.'s. Let $X=aY+bZ$. Then the correlation should not be $\pm1$.

-
If Y and Z are independent and Y has nonzero density everywhere (so $E[X|Y=y]$ is well-defined), then indeed $E[X|Y=y] = a y + b E[Z]$. But I don't know about $E[Y | X = x]$. –  Robert Israel Apr 15 '11 at 6:15
@Robert. If $Y,Z$ are independent and both uniform on [0,1] , then $X=Y+Z$ does give an example where $E(X|y)=\frac{1}{2}+y, E(Y|x)=\frac{1}{2}x$ (if my calculation is correct), $0<y<1, 0<x<2$. However, I still don't know if there is an example where both $X,Y$ have positive density everywhere. –  TCL Apr 15 '11 at 13:32
If $Y$ has density function $2y,0<y<1$ and $Z$ is uniform on $[0,1]$, $Y,Z$ independent, $X=Y+Z$. Then according to my calculations $E(Y|x)=\frac{2}{3}x, 0<x<1$ and $E(Y|x)=\frac{2(x^2-x+1)}{3x}, 1<x<2$. So $E(Y|x)$ is not linear. –  TCL Apr 15 '11 at 20:53
@TCL You are right. It's more complicated than I thought. –  GWu Apr 15 '11 at 21:54

A general method to get such $X, Y$ is as follows:

Let $Y,Z$ be independent identically distributed random variables. Let $X=Y+Z$. Then as noted above $E(X|y)=y+E(Z)$ is linear in $y$.

And intuitively, $E(Y|x)=E(Z|x)=x/2$. This can be proved rigorously (for continuous case) as follows:

Suppose the density function for $Y,Z$ is $f(u)$. Then the joint pdf for $X,Y$ is $f(y)f(x-y)$, and the density function for $X$ is the convolution of $f$ with itself. Then $$E(Y|x)=\frac{\int y f(y)f(x-y) dy}{\int f(y)f(x-y) dy} .$$ This is equal to $x/2$ as shown by Eric Naslund in [this post].

An integral identity

-
If $X=2Y+Z$ and $Y,Z$ are independently uniform on $[0,1]$. Then $E(Y|x)=x/4$ for $0<x<1$, $=(2x-1)/4$ for $1<x<2$ and $=(x+1)/4$ for $2<x<3$, showing that it is not linear. –  TCL Apr 25 '11 at 3:40