Table of Contents
What Is Covariance?
Covariance measures how two variables change together. A positive covariance means they tend to increase together; negative means one increases when the other decreases. Unlike correlation, covariance is not standardized, so its magnitude depends on the units of measurement.
Covariance is essential in finance for portfolio analysis, in machine learning for PCA, and in multivariate statistics. It tells you direction but not strength of the relationship, which is why correlation (standardized covariance) is often preferred for interpretation.
Formula
Covariance vs Correlation
| Feature | Covariance | Correlation |
|---|---|---|
| Range | -∞ to +∞ | -1 to +1 |
| Units | Units of X × Y | Unitless |
| Standardized | No | Yes |
| Comparability | Hard to compare | Easy to compare |
Applications
In finance, a covariance matrix helps optimize portfolios by quantifying how assets move together. Low or negative covariance between assets provides diversification benefits. In PCA, covariance matrices identify the directions of maximum variance in multivariate data.
Frequently Asked Questions
Can covariance be zero?
Yes. Zero covariance means no linear relationship, though non-linear relationships may exist. Always visualize data alongside numerical measures.
Why sample vs population?
Sample covariance divides by n-1 (Bessel's correction) to provide an unbiased estimate when working with a subset of data. Population covariance divides by n when you have all data points.
How is covariance related to variance?
Variance is a special case: Cov(X,X) = Var(X). The covariance matrix generalizes both concepts to multiple variables simultaneously.