Skip to content
Learning path Gold Professional operator

Covariance

An unstandardised measure of joint linear movement and the central matrix in portfolio-risk calculations, interpreted only with its units, sample and estimation method.

Who this is for — Readers who need to interpret a risk matrix, calculate portfolio variance or distinguish dependence expressed in the original units from standardised correlation.

Covariance measures how two variables depart jointly from their respective means. It is positive when deviations with the same sign tend to occur together, negative when a positive deviation in one tends to accompany a negative deviation in the other, and near zero when the sample shows little joint linear movement. It is not standardised: its size and units depend on the variables.

In a portfolio, covariance connects component risk with aggregate risk. Two volatile assets do not necessarily produce an equally volatile portfolio when their returns do not always move together. The relationship is estimated from a dataset, window and conventions; it is not a permanent property of ticker symbols.

Covariance and the portfolio matrix The diagonal holds variances; off-diagonal cells hold pairwise dependencies Covariance and the portfolio matrix The diagonal holds variances; off-diagonal cells hold pairwise dependencies σₚ² = wᵀΣw ; cov(i,j) = ρᵢⱼ σᵢ σⱼ ABCDσ²(A)cov(A,B)cov(A,C)cov(A,D)cov(A,B)σ²(B)cov(B,C)cov(B,D)cov(A,C)cov(B,C)σ²(C)cov(C,D)cov(A,D)cov(B,D)cov(C,D)σ²(D)variancescovariances Diagonal An asset's covariance with itself is its variance. Off diagonal Sign and magnitude depend on scale, frequency andsample. Estimation Missing data and instability can make the matrixfragile. Cyclepedia · educational diagram: state conventions, period and data
The diagonal measures each component's own variance; off-diagonal elements describe joint linear movement. Weights and the full matrix determine estimated portfolio variance.

Population definition and sample estimate

For random variables X and Y with finite means, population covariance is:

Cov(X,Y) = E[(X − μₓ)(Y − μᵧ)]

In practice, analysts usually have n aligned observations. When both means are estimated from that sample, a common convention is:

sₓᵧ = [1 / (n − 1)] × ∑ₜ₌₁ⁿ (xₜ − x̄)(yₜ − ȳ)

The denominator n−1 denotes a sample covariance adjusted for degrees of freedom. Some libraries, maximum-likelihood estimators and descriptive statistics use n. Neither output is fully interpretable unless the convention is known.

Observations must cover the same economic intervals. Pairing a European close with a US return measured over a different window may introduce asynchronous pricing rather than dependence. Financial covariance is normally estimated on returns or consistently scaled P&L, not on cumulative price levels whose common trends may create spurious relationships.


Units: why covariance is not correlation

Covariance retains the product of the variables' units. If both returns are expressed in percentage points, the unit is percentage-points squared; if both are decimals, it is decimals squared. Rescaling changes the number without changing the underlying economic relationship.

Correlation removes that scale:

ρₓᵧ = Cov(X,Y) / (σₓ × σᵧ)

When both standard deviations are positive, ρ is dimensionless and lies between −1 and +1. If either standard deviation is zero, correlation is undefined even though covariance with a constant variable is zero. Equal correlation across two pairs does not imply equal covariance because their volatilities may differ.

For example, returns with volatilities of 10% and 20% and correlation 0.25 have decimal covariance 0.10 × 0.20 × 0.25 = 0.005. Expressed in percentage points it is 10 × 20 × 0.25 = 50. The factor of 10,000 is only a change of units. Mixing a decimal volatility with a percentage volatility is a unit error, not another view of risk.


From a pair to the covariance matrix

For p returns collected in vector R, the covariance matrix Σ contains one entry per pair:

Σᵢⱼ = Cov(Rᵢ,Rⱼ)

It is symmetric; variances σᵢ² occupy the diagonal and covariances the off-diagonal entries. With portfolio weights w under a consistent linear model:

σₚ² = wᵀΣw

Using 10% and 20% volatilities, covariance 0.005 and weights 60% and 40%:

σₚ² = 0.60²×0.10² + 0.40²×0.20² + 2×0.60×0.40×0.005 = 0.0124

Estimated volatility is therefore √0.0124 ≈ 11.14%. This formula does not measure maximum loss, liquidity risk or nonlinear payoffs; it measures variance in the specified model.


Positive semidefinite does not mean invertible

A valid covariance matrix is positive semidefinite (PSD):

aᵀΣa ≥ 0   for every vector a

The expression is the variance of a linear combination and cannot be negative. PSD does not mean positive definite. The matrix can be singular when one series is a linear combination of others, duplicates are present, or effective observations are too few for the number of variables. Its ordinary inverse then does not exist.

Even an invertible matrix can be ill-conditioned, so small changes in inputs cause large changes in optimised weights. Ledoit and Wolf propose shrinkage toward a structured target to reduce estimation error and improve conditioning. Shrinkage, factor models and regularisation are methodological choices to document, not repairs that make the data “true”.

A sample matrix built from the same complete observations is normally PSD up to numerical tolerance. Pairwise deletion for missing data can use a different sample for every element and yield an indefinite matrix. Aggressive rounding, hand-edited correlations or volatilities from different dates can do the same. Clipping negative eigenvalues changes the estimate and requires an audit trail.


Data, window and annualisation

A reproducible estimate states the universe, currency, return type, frequency, calendar, window, handling of missing data, corporate actions, outliers and estimator. A local-currency matrix is not the same matrix from the perspective of an investor's base currency: exchange rates add variance and covariance.

A short window is responsive but contains fewer observations; a long one may reduce some sampling noise while mixing regimes. Stale valuations can suppress contemporaneous covariance. Common extreme events can dominate it. There is no universal correct window.

Multiplying daily covariance by the number of periods per year is coherent only under suitable temporal-aggregation assumptions. In general, aggregated covariance also contains lead–lag terms. Serial dependence and asynchronous pricing make linear annualisation a model choice, not an identity.


Interpretation limits and controls

Covariance is a second-moment measure of linear dependence. Zero covariance does not prove independence, establish causality or describe nonlinear, asymmetric or tail dependence. Dependence may rise under stress just when diversification is most needed. A historical matrix contains no direct model of gaps, default, liquidity, impact or margin calls.

Before using it, reconcile units, currency, timestamps and returns; report the effective sample and missing-data rule; test symmetry, diagonal, eigenvalues and conditioning; compare windows and estimators; add stress scenarios where relevant; and preserve data, code and parameters. Estimation, forecast input and portfolio decision are separate stages.

Common error — Treating a unitless-looking matrix built on different samples as a stable forecast. PSD, invertibility and accuracy are distinct properties, and no universal threshold makes covariance “good”.


Sources