Let $x$ and $\epsilon$ are two random variables. If $$Cov(x, \epsilon)=0$$ and $$E[\epsilon]=0,$$ can that lead to $E[\epsilon|x]=0?$
-
Welcome to CV. Since you’re new here, you may want to take our tour, which has information for new users. Since this looks like homework (apologies if it's not), please add the [self-study] tag and read its wiki. Then tell us what you understand thus far, what you've tried & where you're stuck. We'll provide hints to help you get unstuck. Please make these changes as just posting your homework & hoping someone will do it for you is grounds for closing. If this is self-study rather than homework, let us know, and... it's still a good idea to show us what you've tried. – jbowman Jan 22 '20 at 04:05
-
1it's not a homework. Some papers only check that if $Cov(x, \epsilon)$ is zero for OLS assumption which specifies that $E[\epsilon|x]=0$ in lots of formal literatures. – Long Bu Jan 22 '20 at 04:17
-
1Related: https://stats.stackexchange.com/questions/486169/random-sampling-weak-and-strong-exogenity/486253#486253 – markowitz Mar 28 '21 at 11:38
4 Answers
This figure is a complete answer.
For those who would like a gloss on the figure though, notice that in this sample of 1,000 values of $(X,\varepsilon),$
"$\operatorname{Cov}(X,\varepsilon)=0$." When $X$ and $\varepsilon$ are centered around zero, as they are here, the covariance is their average product. The figure uses color to indicate the individual products: greens and blues for very negative values and oranges for slightly positive values. On balance the many oranges cancel the few greens and blues, giving zero covariance.
"$E[\varepsilon]=0$." On average the value of $\varepsilon$ is zero. This is clear from the symmetry: rotating the plot 180 degrees preserves its features (down to fairly fine detail) but negates the values of $\varepsilon.$ Thus the average must be close to zero (the only finite number equal to its own negative).
The conditional expectation $E[\varepsilon\mid X]$ is traced out by the thick black curve: at each value of $X$ it estimates the average height of the points lying above that value. Clearly this is not always zero. (All that matters in this example is that the curve is not constantly zero: the details of its shape are irrelevant.)
Even when $X$ and $\varepsilon$ have zero covariance and $\varepsilon$ has zero expectation, locally the values of $\varepsilon$ may fluctuate with $X,$ provided they average out to zero globally (on the whole).
Appendix
Below is the R
code that generated the figure. The (long) third line is the heart of it: to a curvilinear function $y = \sin(\pi x/\sqrt{3})$ it adds uniformly distributed errors runif(n, -1/2, 1/2)
and then -- to assure the resulting response will have no correlation with $x$ -- removes the effect of $x$ on these values (using the sequence of calls scale(residuals(lm(...)))
).
(If you are uncomfortable with this pre-processing, then add the errors after removing the effect of $x:$
eps <- runif(n, -1/2, 1/2) + residuals(lm(sin(pi*x/sqrt(3)) ~ x))
The result, because the errors are truly independent of $x,$ will not have a perfectly zero correlation, but only because of chance variation in the simulation. This gives a better simulation but doesn't guarantee a good plot!)
#
# Create data.
#
n <- 1e3 # Specify the size of the dataset
x <- scale(runif(n)) # Create explanatory variable values
eps <- scale(residuals(lm(runif(n, -1/2, 1/2) + sin(pi*x/sqrt(3)) ~ x)))
zapsmall(cor(cbind(x, eps))) # Confirm lack of correlation
#
# Create a data frame for plotting and plot it.
#
X <- data.frame(x=x, eps=eps, Product=x*eps)
library(ggplot2)
ggplot(X, aes(x, eps)) +
geom_hline(yintercept=0) + geom_vline(xintercept=0) + # Draw axes
geom_point(aes(fill=Product), size=2, shape=21, alpha=1/4) + # Plot the points
geom_smooth(color="Black", se=FALSE, size=1.1) + # Plot the regression
scale_fill_gradientn(colors=topo.colors(13)[1:12]) + # Specify colors
ylab(expression(epsilon)) # Label an axis

- 281,159
- 54
- 637
- 1,101
-
would you mind sharing the equations needed to generate this simulation? – financial_physician Apr 19 '21 at 16:31
-
1
Let $x = \epsilon = 0$. Now check the relevant moments.

- 91,027
- 3
- 150
- 376
-
-
It depends what OP is trying to show here (which is a bit ambiguous). The example shows that there are cases where all three conditions hold, so the first two conditions are compatible with the third. – Ben Mar 30 '21 at 08:30
-
The question seems me quite clear. In any case, comments (not answers) are for clarifications too. – markowitz Mar 30 '21 at 10:04
Let $x$ and $\epsilon$ are two random variables. If $$Cov(x,\epsilon)=0$$ and $$E[\epsilon]=0,$$ can that lead to $E[\epsilon|x]=0?$
No, those conditions are not enough.
Indeed it is possible that both hold but $Cov(x^2,\epsilon)\neq0$, therefore $E[\epsilon|x]\neq 0$
However if this stonger condition hold $Cov(f(x),\epsilon)=0$ fon any $f()$, then $E[\epsilon|x] = 0$ hold
Note: sometimes $E[\epsilon|x] = 0$ is assumed but only $E[x \epsilon] = 0$ is checked/considered. This prassi can work if we assume (often implicitly) that only linear relations are permitted.

- 3,964
- 1
- 13
- 28
The following is wrong. Here is an counter example:
Here are my thoughts. Could some expert help check for me? thanks.
$Cov(x, \epsilon)=0\space\implies E[x\epsilon]-E[x]E[\epsilon]=0 \space \stackrel{E[\epsilon]=0}\implies E[x\epsilon]=0$
so we can say $x$ and $\epsilon$ are orthogonal. From the geometric perspective, $E[\epsilon|x]$ is the projection of $\epsilon$ onto the x's plane. Since $\epsilon$ is orthogonal to that plane, so the projection is zero. That is $E[\epsilon|x]=0$

- 181
- 5
-
Here is a counterexample: https://stats.stackexchange.com/questions/190703/non-linear-endogeneity/190800#190800 – Christoph Hanck Jan 22 '20 at 07:05
-
@ChristophHanck Thanks for pointing it out. I guess $E[x]=0$ is needed for my implication to be correct. in[this book]( https://drive.google.com/file/d/1VmkAAGOYCTORq1wxSQqy255qLJjTNvBI/view) section 9.4: it defines $ = E[UV]$, where U, V are random variables. if $E[U]=0$ and $E[V]=0$ then it shows the interpretation: U, V are orthogonal if and only if U an V are uncorrelated(Cov(U, V) = 0) – Long Bu Jan 22 '20 at 07:43
-
I am not sure - my counterexample also has $E(x)=0$. Also, in my understanding, orthogonal is something else than $E(\epsilon|x)=0$. – Christoph Hanck Jan 22 '20 at 07:52
-
Hmm. then I guess when some literatures use $cov(x, \epsilon)=0$ to check the real consistent OLS assumption $E[\epsilon|x]=0$. there is an implicit assumption that $\epsilon$ is in normal distribution. – Long Bu Jan 22 '20 at 08:18
-
Zero covariance is enough for consistency, but zero conditional mean affords stronger results - again, I'd refer you to the link I posted for an example. – Christoph Hanck Jan 22 '20 at 08:27
-
@LongBu; "then I guess when some literatures use $cov(x,ϵ)=0$ to check the real consistent OLS assumption $E[ϵ|x]=0$. there is an implicit assumption that ϵ is in normal distribution" this can be a reasonable explanation but it seems me not so common. Maybe my answer can help. – markowitz Mar 29 '21 at 08:03