# Covariance

The extent of the relationship between two variables. It is an inherently algebraic concept and cannot be defined without reference to algebra. Where variables have been normalized the covariance is equal to the correlation.

The covariance between two jointly distributed numeric random variables, X and Y with expectations is defined as:

${\displaystyle Covariance(X,Y)=\operatorname {E} {{\big [}(X-\operatorname {E} [X])(Y-\operatorname {E} [Y]){\big ]}}}$

Where ${\displaystyle x_{i}}$ and ${\displaystyle y_{i}}$ are the realized values of X and Y in a sample of n observations and ${\displaystyle {\bar {x}}}$ and ${\displaystyle {\bar {y}}}$ are their respective means, the sample covariance is estimated as:

${\displaystyle Covariance(x,y)={\frac {1}{n-1}}\sum _{i=1}^{n}(x_{i}-{\bar {x}})(y_{i}-{\bar {y}})}$