= Pearson correlation coefficient
{c}
{title2=$\rho_{X,Y}$}
{wiki}
= Correlation coefficient
{synonym}
= Correlation
{synonym}
The <Pearson correlation coefficient> is the <covariance> divided by the product of the <standard deviations>. For real <random variables> with finite, strictly positive <variances>,
$$
\rho_{X,Y}=\frac{\operatorname{Cov}(X,Y)}{\sqrt{\operatorname{Var}(X)\operatorname{Var}(Y)}}.
$$
It is the <expected value> of the product of the two centered variables after dividing each by its <standard deviation>. The <Cauchy-Schwarz inequality> gives $-1\leq\rho_{X,Y}\leq1$. This removes measurement units, while retaining the direction and strength of the linear relationship. Constant <random variables> have zero <standard deviation>, so their <Pearson correlation coefficient> is undefined.
For the <covariance> model $Y=2X+Z$, with $X,Z$ independently uniform on $\{-1,0,1\}$, the calculation gives
$$
\rho_{X,Y}=\frac{4/3}{\sqrt{(2/3)(10/3)}}=\frac2{\sqrt5}\approx0.894427.
$$
The positive <correlation> is less than one because the independent $Z$ term introduces extra variation. For $Y=-2X+Z$ the <correlation> is $-2/\sqrt5$. Both examples appear in the <covariance> diagram.
For nonzero real $a,c$, the <correlation> of $aX+b$ and $cY+d$ is $\operatorname{sgn}(ac)\rho_{X,Y}$. Positive rescaling and added offsets therefore leave the <correlation> unchanged; reversing one scale reverses its sign. Equality $|\rho_{X,Y}|=1$ means that one <random variable> is an <affine function> of the other <almost surely>, with a nonzero slope of the corresponding sign. This is the equality condition in the <Cauchy-Schwarz inequality>, and includes <perfect positive correlation>.
Zero <correlation> says that the centered variables are <orthogonal> in their square-integrable <inner product>. It permits nonlinear <statistical dependence>, as the example $Y=X^2$ in <uncorrelated random variables> demonstrates. More generally, a <correlation> is a statement about a <joint probability distribution>; identifying effects of interventions is the separate task of <causal inference>. This distinction keeps an observed association from being mistaken for a demonstrated mechanism.
An early source for standardized association is <Francis Galton>'s 1888 paper “Co-relations and their Measurement, chiefly from Anthropometric Data”. He compared stature and forearm measurements and changed each measurement to units of its own variability so the two regression directions could be compared. His scale used <probable error>, so it should not be identified word for word with the modern <standard deviation> formula above. https://galton.org/essays/1880-1889/galton-1888-co-relations-royal-soc/galton_corr.html[Galton's original paper, Proceedings of the Royal Society 45, 135–145]{ref}.
Back to article page