# Correlation of two random variables with the same distribution

Say that we have two r.v.'s $X$ and $Y$ where both have the same distribution, i.e., $X\stackrel{d}{=}Y$.

My question is, if $\operatorname{corr}(X,Y)=1$, does this mean $X=Y$ ?

Additionally, say that the support of $X$ and $Y$ is $[a,b]$.
If $\left|\operatorname{corr}(X,Y)\right|<1$, can I say that $f_{(X,Y)}(x,y)>0$ for $x,y\in[a,b]$? Clearly for $X=Y$ this is not true as the support is only positive at the line x=y. However, without a perfect correlation I would guess that any combination should be possible.

• Is this work for a class? It sounds a bit like a textbook style question. – Glen_b Jun 18 '18 at 11:14
• No, I am a way after my class years. I am interested in the representation of a exchangeable random vector. However first I need to solve this question or find some reference. Clearly a random vectors $(X,X)$ and $(X,Y)$ with same marginals and symmetric copula are exchangeable and define the two cases mentioned above. – K. Keeper Jun 18 '18 at 11:21
• The first half of your question is rigorously answered at stats.stackexchange.com/questions/160629. Counterexamples to the second abound: for instance, consider a mixture of the variables $(X,X)$ and $(X,a+b-X).$ – whuber Jun 18 '18 at 13:20

If $X$ and $Y$ are perfectly correlated, then $Y=mX+c$ for some $m$ and $c$, from which we get $E(Y)=mE(X)+c$ and $\text{Var}(Y)=m^2\text{Var}(X)$. (Noting that with positive correlation, $m$ will also be positive)

This is fairly simple to establish.

If they have identical distributions then means and variances are equal, at which point you can solve for $m$ and $c$.

It is NOT the case that the joint density is positive over the support if the absolute correlation is less than 1. It's not the case even when it's zero.

For counterexample, consider X,Y uniform over [-1,1], but where the joint distribution is zero in the 2nd and 4th quadrants and uniform in the 1st and 3rd.

It's not much harder to make one with covariance $0$. Many examples are on site, but I'll mention one - $X$ is standard normal and $Y = \Phi^{-1}[F(X^2)]$, where $F$ is the cdf of a $\chi^2_1$ and $\Phi$ is the standard normal cdf. $X$ and $Y$ are both standard normal, they have zero correlation but the joint density is degenerate (it lies on a curve).

For people that use R here's some code to generate some data following these examples:

 u <- runif(10000,-1,1)
v <- runif(10000,0,1)*sign(u)
x <- rnorm(10000)
y <- qnorm(pchisq(x^2,1))