Any hard-working student is a counterexample to "all students are lazy".
What are some simple counterexamples to "if random variables $X$ and $Y$ are uncorrelated then they are independent"?
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It only takes a minute to sign up.
Sign up to join this communityAny hard-working student is a counterexample to "all students are lazy".
What are some simple counterexamples to "if random variables $X$ and $Y$ are uncorrelated then they are independent"?
Let $X\sim U(-1,1)$.
Let $Y=X^2$.
The variables are uncorrelated but dependent.
Alternatively, consider a discrete bivariate distribution consisting of probability at 3 points (-1,1),(0,-1),(1,1) with probability 1/4, 1/2, 1/4 respectively. Then variables are uncorrelated but dependent.
Consider bivariate data uniform in a diamond (a square rotated 45 degrees). The variables will be uncorrelated but dependent.
Those are about the simplest cases I can think of.
I think the essence of some of the simple counterexamples can be seen by starting with a continuous random variable $X$ centered on zero, i.e. $E[X]=0$. Suppose the pdf of $X$ is even and defined on an interval of the form $(-a,a)$, where $a>0$. Now suppose $Y=f(X)$ for some function $f$. We now ask the question: for what kind of functions $f(X)$ can we have $Cov(X,f(X))=0$?
We know that $Cov(X,f(X))=E[Xf(X)]-E[X]E[f(X)]$. Our assumption that $E[X]=0$ leads us straight to $Cov(X,f(X))=E[Xf(X)]$. Denoting the pdf of $X$ via $p(\cdot)$, we have
$Cov(X,f(X))=E[Xf(X)]=\int_{-a}^{a}xf(x)p(x)dx$.
We want $Cov(X,f(X))=0$ and one way of achieving this is by ensuring $f(x)$ is an even function, which implies $xf(x)p(x)$ is an odd function. It then follows that $\int_{-a}^{a}xf(x)p(x)dx=0$, and so $Cov(X,f(X))=0$.
This way, we can see that the precise distribution of $X$ is unimportant as long as the pdf is symmetric around some point, and any even function $f(\cdot)$ will do for defining $Y$.
Hopefully, this can help students see how people come up with these types of counterexamples.
We can define a discrete random variable $X\in\{-1,0,1\}$ with $\mathbb{P}(X=-1)=\mathbb{P}(X=0)=\mathbb{P}(X=1)=\frac{1}{3}$
and then define $Y=\begin{cases}1,\quad\text{if}\quad X=0\\0,\quad\text{otherwise}\end{cases}$
It can be easily verified that $X$ and $Y$ are uncorrelated but not independent.
Be the counterexample (i.e., hard-working student)! With that said:
I was trying to think of a real world example and this was the first that came to my mind. This will not be the mathematically simplest case (but if you understand this example, you should be able to find a simpler example with urns and balls or something).
According to some research, the average IQ of men and women is the same, but the variance of male IQ is greater than the variance of female IQ. For concreteness, let's say that male IQ follows $N(100, \sigma^2)$ and female IQ follows $N(100, \alpha \sigma^2)$ with $\alpha<1$. Half the population is male and half the population is female.
Assuming that this research is correct:
What is the correlation between gender and IQ?
Are gender and IQ independent?
I ran across the example of a short straddle in this "Mini-lesson" by Nassim Taleb.
The payoff has the shape of an inverted V with the peak when the price of the underlying security at expiration is the strike price at which both the call and the put are sold. The idea is that if at the last closing Microsoft shares were \$248.15 and we sell a \$247.50 call for May 21, and a put at the same price and same date, the purchasers will be betting on the price going up (call) or down (put) - i.e. their bets are in opposite directions, but each is betting in the price to move even higher than today's (since the option strike price above the current price will be priced into the option), in the case of the call purchaser; or lower than the strike price (put).
If the price of Microsoft is the strike price the seller of the short straddle cashes in the maximum profit from both unexercised options.
There is a clear dependency between the price of the underlying stock and the profit for the options trader, yet there is a zero correlation because both components move in symmetrical and opposite directions.
Try this (R code):
x=c(1,0,-1,0);
y=c(0,1,0,-1);
cor(x,y);
[1] 0
This is from the equation of circle $x^2+y^2-r^2=0$
$Y$ is not correlated with $x$, but it is functionally dependent (deterministic).
cor
function returning zero will indicate a population correlation of zero.
$\endgroup$
The only general case when lack of correlation implies independence is when the joint distribution of X and Y is Gaussian.
A two-sentence answer: the clearest case of uncorrelated statistical dependence is a non-linear function of a RV, say Y = X^n. The two RVs are clearly dependent but yet not correlated, because correlation is a linear relationship.