Free lesson · Statistics
Gauss–Markov theorem: what a regression hedge ratio guarantees
Open interactive lessonPractice calculationsExplore labs
Start with the idea
- If the inputs contain enough separate information, errors have mean zero given those inputs, and errors have equal variance with no correlation across observations, OLS has the smallest covariance among linear unbiased estimators. BLUE means best linear unbiased estimator.
Symbols, units & horizon
- x_i,y_i: synchronous one-day instrument returns in basis points
- i: daily observation index
- x̄,ȳ: sample means
- β̂: dimensionless estimated slope or return hedge ratio
- α̂: estimated intercept in basis points per day
- denominator must be positive
When and why to use this
Use OLS to estimate return betas or a candidate hedge ratio, then check residual dependence, stability and instrument units. A return beta must be converted into tradable quantities using prices and contract multipliers.
Start here · the same idea in everyday words
| Technical term | Everyday meaning | Concrete example |
|---|---|---|
| Residual | The observed value minus the fitted value. | If a model predicts 3 bp and the observed return is 5 bp, the residual is 2 bp. |
| Exogeneity | For any given input values, the model errors average to zero under the assumed probability model. | The inputs must not systematically conceal part of the error; running a regression does not prove this. |
| Homoskedasticity | The model errors have the same conditional variance across observations. | The assumed error spread does not grow merely because the input gets larger. |
Unpack a technical sentence
Technical wording: Under a full-rank design and spherical error covariance, OLS is BLUE.
Read it as: If the inputs contain enough separate information, errors have mean zero given those inputs, and errors have equal variance with no correlation across observations, OLS has the smallest covariance among linear unbiased estimators. BLUE means best linear unbiased estimator.
A slower worked example · one step at a time
- Use daily returns x=[−1,0,1] bp and y=[−1,1,3] bp. The mean of x is 0 and the mean of y is 1.
- Subtract the means: centred x is [−1,0,1] and centred y is [−2,0,2].
- Multiply matching centred entries and add: 2+0+2=4 bp². Add centred x squares: 1+0+1=2 bp². Divide 4 by 2 to get slope 2.
- The intercept is mean y minus slope times mean x: 1−2 times 0=1 bp. At x=1 bp the fitted y is 1+2 times 1=3 bp.
- If a new observation has x=1 bp and y=5 bp, its residual is 5−3=2 bp. One residual does not establish the model assumptions; inspect errors across the sample and evaluate later observations separately.
Self-assessed: Does “best” mean OLS is the best possible forecast model?
No. The theorem compares a defined class of estimators under defined assumptions. It is not a ranking of all possible forecasting methods.
Study loop: predict the result, work through the arithmetic, run the Python, then explain which assumption would make the result unreliable.
- For one regressor with an intercept, centre both series. The OLS slope is centred cross-product divided by centred regressor sum of squares.
- Assume a full-rank design, zero conditional mean errors and conditional error covariance equal to a common variance times the identity. OLS is then best linear unbiased: it has the smallest covariance among estimators linear in the outcomes and unbiased under the model. Gaussian errors are not required for this theorem.
- Here “linear” refers to the estimator as a function of the outcomes. “Best” does not mean lowest forecast loss among every machine-learning model. Heteroskedasticity or serial correlation breaks the spherical-error premise; robust standard errors address inference under additional conditions, not omitted-variable bias.
Before reading the working, evaluate 4/2. Give the result in dimensionless slope.
The fitted return equation has intercept 1 bp per day and slope 2. This exact synthetic fit is a coding benchmark, not evidence of a profitable hedge.
Gauss–Markov theorem: what a regression hedge ratio guarantees
- Use x=[−1,0,1] and y=[−1,1,3] bp. Their means are 0 and 1 bp.
- Centred cross-products sum to (−1)(−2)+0×0+1×2=4 bp². Centred x squares sum to 1+0+1=2 bp².
- Slope is 4/2=2 and intercept is 1−2×0=1 bp per day.
The fitted return equation has intercept 1 bp per day and slope 2. This exact synthetic fit is a coding benchmark, not evidence of a profitable hedge.
An analogy to remember
A fitted ruler summarises how two measurements move together. The theorem compares the precision of particular ways to fit that ruler.
How this becomes a building block
A beta estimation component should return aligned observations and residual diagnostics alongside the fitted coefficients.
Python · run and reuse
Architecture pseudocode
# Python 3.10+; standard library only unless NumPy is imported.
# Synthetic teaching inputs; no historical performance claim.
import numpy as np
def ols_one_feature(x,y):
# NumPy dependency; matched synchronous daily returns in bp.
x,y = np.asarray(x,dtype=float),np.asarray(y,dtype=float)
if x.ndim != 1 or x.shape != y.shape or x.size < 2 or not np.isfinite(x).all() or not np.isfinite(y).all():
raise ValueError("Matching finite one-dimensional samples required")
xc,yc = x-x.mean(),y-y.mean()
denominator = xc@xc
if denominator <= 0: raise ValueError("Regressor must vary")
beta = (xc@yc)/denominator
return float(y.mean()-beta*x.mean()),float(beta)
print(ols_one_feature([-1,0,1],[-1,1,3]))
# Replay the slower, synthetic example above. Units are stated in its steps.
def plain_language_example():
from math import exp, e # Standard library; no extra dependency.
return {
"slope": 4/2,
"intercept": 1-2*0,
"fitted": 1+2*1,
"residual": 5-(1+2*1),
}
print(plain_language_example())Self-assessed: explain the calculation, its output units, and one condition under which it fails.
Use OLS to estimate return betas or a candidate hedge ratio, then check residual dependence, stability and instrument units. A return beta must be converted into tradable quantities using prices and contract multipliers. Conditional mean-zero errors are substantive. Endogeneity, asynchronous data or regime changes can invalidate the interpretation even if a regression runs successfully.
Python implementation
Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.
# Python 3.10+; standard library only unless NumPy is imported.
# Synthetic teaching inputs; no historical performance claim.
import numpy as np
def ols_one_feature(x,y):
# NumPy dependency; matched synchronous daily returns in bp.
x,y = np.asarray(x,dtype=float),np.asarray(y,dtype=float)
if x.ndim != 1 or x.shape != y.shape or x.size < 2 or not np.isfinite(x).all() or not np.isfinite(y).all():
raise ValueError("Matching finite one-dimensional samples required")
xc,yc = x-x.mean(),y-y.mean()
denominator = xc@xc
if denominator <= 0: raise ValueError("Regressor must vary")
beta = (xc@yc)/denominator
return float(y.mean()-beta*x.mean()),float(beta)
print(ols_one_feature([-1,0,1],[-1,1,3]))
# Replay the slower, synthetic example above. Units are stated in its steps.
def plain_language_example():
from math import exp, e # Standard library; no extra dependency.
return {
"slope": 4/2,
"intercept": 1-2*0,
"fitted": 1+2*1,
"residual": 5-(1+2*1),
}
print(plain_language_example())Continue learning
Statistics & Probability — all lessons- Start with counts, probabilities and averages
- Random outcomes, sample averages and the limits of the bell curve
- Conditional probability: update a belief with evidence
- Prediction markets: probability, price and net expected value
- Expected value: measure the payoff before choosing the risk
- Correlation: how many strategies do you really have?
- Conditional probability and Bayes: where the edge actually lives
- The central limit theorem: sampling means under explicit assumptions
- Law of large numbers: what averaging can and cannot establish
- Central limit theorem, standard errors and confidence intervals
- Total expectation and total variance: within-regime and between-regime risk
- Markov, Chebyshev and Jensen: bounds without a full distribution
- Gauss–Markov theorem: what a regression hedge ratio guarantees
- Delta method: propagate estimator uncertainty through a smooth function
- Multiple testing and the union bound: account for the whole search
- Estimation uncertainty and Bayesian updating
Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations