Covariance

The covariance of two Random Variables is

More generally, for two random vectors ,

Covariance as an Inner Product

Covariance is like an Inner Product (it is indeed an inner product for centralized Random Variables). We have

  • and iff (semi-positiveness)
  • where is a constant
    • Generalization:
  • Independence (orthogonal)
  • Cauchy-Schwarz Inequality: , and the equality holds iff for some constant .

Correlation

Denote . Then , and iff a.s. for some .

Sample Covariance

For two samples of of size , their sample covariance is

For centered random vectors, we have

where .

Sample Correlation Coefficient

For two samples of of size , their sample correlation coefficient is

where is the sample Variance of .

Properties

When , we say the sample data pairs are positively correlated; When , we say the sample data pairs are negatively correlated.

have some properties:

  • if and
  • if and
  • if is the sample correlation coefficient for , then it is also the sample correlation coefficient for provided that have the same sign.