Covariance and correlation


 * Main articles: covariance, correlation.

In probability theory and statistics, the mathematical descriptions of covariance and correlation are very similar. Both describe the degree of similarity between two random variables or sets of random variables.




 * correlation matrix||$$\phi_{XY}(n,m) =E[ (X_n-E[X_n])(Y_m-E[Y_m])]/(\sigma_X \sigma_Y) \;$$
 * covariance matrix||$$\gamma_{XY}(n,m)    =E[ (X_n-E[X_n])\,(Y_m-E[Y_m])]$$
 * }
 * covariance matrix||$$\gamma_{XY}(n,m)    =E[ (X_n-E[X_n])\,(Y_m-E[Y_m])]$$
 * }

where $$\sigma_X$$ and $$\sigma_Y$$ are the standard deviations of the $$\{X_i\}$$ and $$\{Y_i\}$$ respectively. Notably, correlation is dimensionless while covariation is in units obtained by multiplying the units of each variable. The correlation and covariance of a variable with itself (i.e. $$Y=X$$) is called the autocorrelation and autocovariance, respectively.

In the case of stationarity, the means are constant and the covariance or correlation are functions only of the difference in the indices:




 * cross correlation||$$\phi_{XY}(m) =E[ (X_n-E[X_n])\,(Y_{n+m}-E[Y_{n+m}])]/(\sigma_{X_n}\sigma_{Y_{n+m}})$$
 * cross covariance||$$\gamma_{XY}(m)=E[ (X_n-E[X])\,(Y_{n+m}-E[Y])]$$
 * }
 * cross covariance||$$\gamma_{XY}(m)=E[ (X_n-E[X])\,(Y_{n+m}-E[Y])]$$
 * }