# Uncorrelatedness (probability theory)

In probability theory and statistics, two real-valued random variables, $X$, $Y$, are said to be uncorrelated if their covariance, $\operatorname {cov} [X,Y]=\operatorname {E} [XY]-\operatorname {E} [X]\operatorname {E} [Y]$, is zero. If two variables are uncorrelated, there is no linear relationship between them.
Uncorrelated random variables have a Pearson correlation coefficient, when it exists, of zero, except in the trivial case when either variable has zero variance (is a constant). In this case the correlation is undefined.
In general, uncorrelatedness is not the same as orthogonality, except in the special case where at least one of the two random variables has an expected value of 0. In this case, the covariance is the expectation of the product, and $X$ and $Y$ are uncorrelated if and only if $\operatorname {E} [XY]=0$.
If $X$ and $Y$ are independent, with finite second moments, then they are uncorrelated. However, not all uncorrelated variables are independent.$^{:p.155}$

## Definition
### Definition for two real random variables

Two random variables $X,Y$ are called uncorrelated if their covariance $\operatorname {Cov} [X,Y]=\operatorname {E} [(X-\operatorname {E} [X])(Y-\operatorname {E} [Y])]$ is zero.$^{:p.153}$$^{:p.121}$ Formally:
$X,Y{\text{ uncorrelated}}\quad \iff \quad \operatorname {E} [XY]=\operatorname {E} [X]\cdot \operatorname {E} [Y]$

### Definition for two complex random variables

Two complex random variables $Z,W$ are called uncorrelated if their covariance $\operatorname {K} _{ZW}=\operatorname {E} [(Z-\operatorname {E} [Z]){\overline {(W-\operatorname {E} [W])}}]$ and their pseudo-covariance $\operatorname {J} _{ZW}=\operatorname {E} [(Z-\operatorname {E} [Z])(W-\operatorname {E} [W])]$ is zero, i.e.
$Z,W{\text{ uncorrelated}}\quad \iff \quad \operatorname {E} [Z{\overline {W}}]=\operatorname {E} [Z]\cdot \operatorname {E} [{\overline {W}}]{\text{ and }}\operatorname {E} [ZW]=\operatorname {E} [Z]\cdot \operatorname {E} [W]$

### Definition for more than two random variables

A set of two or more random variables $X_{1},\ldots ,X_{n}$ is called uncorrelated if each pair of them is uncorrelated. This is equivalent to the requirement that the non-diagonal elements of the autocovariance matrix $\operatorname {K} _{\mathbf {X} \mathbf {X} }$ of the random vector $\mathbf {X} =[X_{1}\ldots X_{n}]^{\mathrm {T} }$ are all zero. The autocovariance matrix is defined as:
    $\operatorname {K} _{\mathbf {X} \mathbf {X} }=\operatorname {cov} [\mathbf {X} ,\mathbf {X} ]=\operatorname {E} [(\mathbf {X} -\operatorname {E} [\mathbf {X} ])(\mathbf {X} -\operatorname {E} [\mathbf {X} ]))^{\rm {T}}]=\operatorname {E} [\mathbf {X} \mathbf {X} ^{T}]-\operatorname {E} [\mathbf {X} ]\operatorname {E} [\mathbf {X} ]^{T}$

## Examples of dependence without correlation
### Example 1

* Let $X$ be a random variable that takes the value 0 with probability 1/2, and takes the value 1 with probability 1/2.
* Let $Y$ be a random variable, independent of $X$, that takes the value −1 with probability 1/2, and takes the value 1 with probability 1/2.
* Let $U$ be a random variable constructed as $U=XY$.
The claim is that $U$ and $X$ have zero covariance (and thus are uncorrelated), but are not independent.
Proof:
Taking into account that
    $\operatorname {E} [U]=\operatorname {E} [XY]=\operatorname {E} [X]\operatorname {E} [Y]=\operatorname {E} [X]\cdot 0=0,$
where the second equality holds because $X$ and $Y$ are independent, one gets
    ${\begin{aligned}\operatorname {cov} [U,X]&=\operatorname {E} [(U-\operatorname {E} [U])(X-\operatorname {E} [X])]=\operatorname {E} [U(X-{\tfrac {1}{2}})]\\&=\operatorname {E} [X^{2}Y-{\tfrac {1}{2}}XY]=\operatorname {E} [(X^{2}-{\tfrac {1}{2}}X)Y]=\operatorname {E} [(X^{2}-{\tfrac {1}{2}}X)]\operatorname {E} [Y]=0\end{aligned}}$
Therefore, $U$ and $X$ are uncorrelated.
Independence of $U$ and $X$ means that for all $a$ and $b$, $\Pr(U=a\mid X=b)=\Pr(U=a)$. This is not true, in particular, for $a=1$ and $b=0$.
* $\Pr(U=1\mid X=0)=\Pr(XY=1\mid X=0)=0$
* $\Pr(U=1)=\Pr(XY=1)=1/4$
Thus $\Pr(U=1\mid X=0)\neq \Pr(U=1)$ so $U$ and $X$ are not independent.
Q.E.D.

### Example 2

If $X$ is a continuous random variable uniformly distributed on $[-1,1]$ and $Y=X^{2}$, then $X$ and $Y$ are uncorrelated even though $X$ determines $Y$ and a particular value of $Y$ can be produced by only one or two values of $X$ :
$f_{X}(t)={1 \over 2}I_{[-1,1]};f_{Y}(t)={1 \over {2{\sqrt {t}}}}I_0,1]}$
on the other hand, $f_{X,Y}$ is 0 on the triangle defined by $0<X<Y<1$ although $f_{X}\times f_{Y}$ is not null on this domain. Therefore $f_{X,Y}(X,Y)\neq f_{X}(X)\times f_{Y}(Y)$ and the variables are not independent.
$E[X]={{1-1} \over 4}=0;E[Y]={{1^{3}-(-1)^{3}} \over {3\times 2}}={1 \over 3}$
$Cov[X,Y]=E\left[(X-E[X])(Y-E[Y])\right]=E\left[X^{3}-{X \over 3}\right]={{1^{4}-(-1)^{4}} \over {4\times 2}}=0$
Therefore the variables are uncorrelated.

## When uncorrelatedness implies independence

There are cases in which uncorrelatedness does imply independence. One of these cases is the one in which both random variables are two-valued (so each can be linearly transformed to have a Bernoulli distribution). Further, two jointly normally distributed random variables are independent if they are uncorrelated, although this does not hold for variables whose marginal distributions are normal and uncorrelated but whose joint distribution is not joint normal (see Normally distributed and uncorrelated does not imply independent).

## Generalizations
### Uncorrelated random vectors

Two random vectors $\mathbf {X} =(X_{1},\ldots ,X_{m})^{T}$ and $\mathbf {Y} =(Y_{1},\ldots ,Y_{n})^{T}$ are called uncorrelated if
    $\operatorname {E} [\mathbf {X} \mathbf {Y} ^{T}]=\operatorname {E} [\mathbf {X} ]\operatorname {E} [\mathbf {Y} ]^{T}$.
They are uncorrelated if and only if their cross-covariance matrix $\operatorname {K} _{\mathbf {X} \mathbf {Y} }$ is zero.$^{:p.337}$
Two complex random vectors $\mathbf {Z}$ and $\mathbf {W}$ are called uncorrelated if their cross-covariance matrix and their pseudo-cross-covariance matrix is zero, i.e. if
    $\operatorname {K} _{\mathbf {Z} \mathbf {W} }=\operatorname {J} _{\mathbf {Z} \mathbf {W} }=0$
where
    $\operatorname {K} _{\mathbf {Z} \mathbf {W} }=\operatorname {E} [(\mathbf {Z} -\operatorname {E} [\mathbf {Z} ]){(\mathbf {W} -\operatorname {E} [\mathbf {W} ])}^{\mathrm {H} }]$
and
    $\operatorname {J} _{\mathbf {Z} \mathbf {W} }=\operatorname {E} [(\mathbf {Z} -\operatorname {E} [\mathbf {Z} ]){(\mathbf {W} -\operatorname {E} [\mathbf {W} ])}^{\mathrm {T} }]$.

### Uncorrelated stochastic processes

Two stochastic processes $\left\{X_{t}\right\}$ and $\left\{Y_{t}\right\}$ are called uncorrelated if their cross-covariance $\operatorname {K} _{\mathbf {X} \mathbf {Y} }(t_{1},t_{2})=\operatorname {E} \left[\left(X(t_{1})-\mu _{X}(t_{1})\right)\left(Y(t_{2})-\mu _{Y}(t_{2})\right)\right]$ is zero for all times.$^{:p.142}$ Formally:
    $\left\{X_{t}\right\},\left\{Y_{t}\right\}{\text{ uncorrelated}}\quad :\iff \quad \forall t_{1},t_{2}\colon \operatorname {K} _{\mathbf {X} \mathbf {Y} }(t_{1},t_{2})=0$.