> [!tldr] > The (population) correlation coefficient $\rho_{X,Y}$ measures how two random variables $X,Y$ vary together. It ranges between $\pm 1$, with independent variables having a correlation of $0$. > > The sample correlation coefficient $r_{X,Y}$ is a biased but asymptotically unbiased estimate of $\rho_{X,Y}$. **Correlation** between variables $X,Y$ is defined to be $\rho_{XY}:=:\mathrm{corr}(X,Y):= \frac{\mathrm{Cov}(X,Y)}{\sigma_{X}\sigma_{Y}}= \frac{\mathbb{E}[(X-\mu_{X})(Y-\mu_{Y})]}{\sigma_{X}\sigma_{Y}}$and for a sample of $\{ (X_{1},Y_{1}),\dots,(X_{n},Y_{n}) \}$, the **sample correlation** is $r:=\frac{\sum_{i}(x_{i}-\bar{x})(y_{i}-\bar{y})}{\sqrt{ \sum_{i}(x_{i}-\bar{x})^{2}\sum_{i}(y_{i}-\bar{y})^{2} }}$ Note that independence implies a correlation of $0$, while the converse is not true: consider $X \sim \mathrm{Unif}\{0,1 \}$, and $Y \sim \mathrm{Unif}\{ 4, 0 \}$ if $X=1$, and $Y=2$ if $X=0$. - $\mathbb{E}[XY]= 1=\mathbb{E}[X]\cdot\mathbb{E}[Y]$, so they are uncorrelated, but obviously not independent.