Risk & volatility

Covariance

Covariance is a measure of how two variables, such as stock returns, move together relative to their respective averages.

What it means

When comparing two stocks, covariance helps describe whether their returns have tended to rise and fall together. Positive covariance means above-average returns for one have generally coincided with above-average returns for the other. Negative covariance means above-average returns for one have generally coincided with below-average returns for the other. A value near zero indicates little linear co-movement in the observations used.

Covariance is not a probability or a percentage return. Its size depends on the scale and units of the inputs. If both inputs are daily returns expressed as decimals, the result is in squared decimal-return units. Using percentage-point returns instead changes the numerical result by a factor of 10,000. Correlation standardizes covariance, making the strength of linear co-movement easier to compare across pairs.

How it is calculated

For a sample of observations, use sample covariance = Σ[(xᵢ − x̄)(yᵢ − ȳ)] / (n − 1).

  • xᵢ and yᵢ are the two variables' values in the same observation period, such as the daily returns of stocks X and Y on day i.
  • x̄ and ȳ are their respective sample-average returns.
  • n is the number of paired observations; at least two are needed for this sample formula.
  • Σ means add the products across all n observations.

The denominator n − 1 is conventional when estimating covariance from a sample. If the observations constitute the entire population being described, population covariance instead divides by n. State which convention you use when comparing results.

Worked example

Suppose two hypothetical stocks have paired daily returns over three days. Returns below are in percentage points, not decimal form.

Day Stock X Stock Y
1 1% 2%
2 2% 1%
3 3% 3%
  1. Find each average: X is (1 + 2 + 3) / 3 = 2%; Y is (2 + 1 + 3) / 3 = 2%.
  2. Subtract the averages. X's deviations are −1, 0, +1 percentage points; Y's are 0, −1, +1 percentage points.
  3. Multiply the paired deviations and add: (−1 × 0) + (0 × −1) + (1 × 1) = 1 squared percentage point.
  4. Divide by n − 1 = 2. Sample covariance is 0.5 squared percentage points, or 0.00005 when returns are expressed as decimals.

The positive result reflects co-movement in this tiny hypothetical sample. Three days are not enough to establish a stable relationship or predict future returns.

Why it matters before you trade

A stock basket's risk depends not just on each holding's volatility, but also on how their returns move together. In a two-stock portfolio, the covariance term in return variance is 2 × wX × wY × Cov(X,Y), where wX and wY are portfolio weights expressed as fractions and Cov(X,Y) is return covariance. Positive covariance increases that term; negative covariance reduces it. Other variance terms still matter, and past relationships can change.

Before placing an order, a pre-trade check can use covariance to examine whether an added position changes estimated portfolio risk. This is different from concentration by name, sector or country: stocks in separate sectors can still move together.

How PreTrAIde uses it

PreTrAIde's product facts do not state that it calculates or displays covariance. Its pre-trade analysis instead includes stock-level volatility estimates, a 1-day 95% value-at-risk calculation, and basket breakdowns and concentration measures. These provide other views of risk but should not be presented as a covariance matrix or a measurement of pairwise return co-movement. PreTrAIde's GO, NO-GO and MODIFY verdicts are decision support, not recommendations.

Common mistakes

  • Treating covariance as correlation: Covariance has units and no fixed −1 to +1 range; correlation is unitless and bounded by that range.
  • Mixing return formats: Decimal returns and percentage-point returns produce differently scaled covariance values.
  • Pairing mismatched dates: Calculate from returns covering the same periods, with consistent treatment of missing observations.
  • Assuming a negative value guarantees protection: Historical co-movement can change, including during market stress.
  • Confusing covariance with causation: Moving together does not establish why two stocks moved.

Frequently asked questions

What does negative covariance mean for two stocks?

In the observations measured, above-average returns for one stock tended to coincide with below-average returns for the other. It does not mean they will always move in opposite directions.

What is the difference between covariance and correlation?

Covariance retains the scale of the two inputs. Correlation divides covariance by the product of their standard deviations, producing a unitless number from −1 to +1 when both standard deviations are nonzero.

Can covariance be greater than one?

Yes. Covariance is not bounded by −1 and +1; its numerical size depends on the variables' units and variability. Correlation, not covariance, has that range.

Related terms

Risk & volatility

Historical volatility Implied volatility Annualized volatility Daily volatility Parkinson volatility estimator Yang-Zhang volatility estimator GARCH model Value at risk (VaR) All glossary terms →

Check your next trade before you place it

Build a basket, run a pre-trade analysis, and get a GO, NO-GO or MODIFY verdict with the cost, liquidity and risk behind it.

Start your free trial Try the free tools

Educational content, not investment advice. PreTrAIde is analysis software, not a broker: it never executes orders, and its verdicts are decision support, not recommendations to buy or sell.