Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceProbability & MeasureStochastic ModelsMarket MicrostructureGuide
Guide
Derivatives pricing0 / 17
01Forwards, calls and puts02Combining positions03Arbitrage and the forward price04Put–call parity05The one-step binomial model06Risk-neutral probabilities07Multi-step trees and backward induction08American options and early exercise09Delta and hedging10Geometric Brownian motion11The Black–Scholes formula12The Greeks: gamma, vega, theta and rho13Options on dividend-paying stocks, indices, currencies and futures14Implied volatility and the volatility smile15Stochastic volatility and the Heston model16Static replication: Breeden–Litzenberger and Carr–Madan17Exotic options: barriers, Asians and digitals
Portfolio & risk0 / 12
01Returns and volatility02Diversification and correlation03The efficient frontier and the capital market line04Risk aversion and the optimal complete portfolio05CAPM, beta and the security market line06Performance measures: Sharpe, Treynor, Jensen and information ratio07Factor models and systematic risk08The Fama–French factor models09Value at Risk and expected shortfall10Systemic risk and contagion11Portfolio constraints and the no-short-sales frontier12Estimating expected returns and covariances
Fixed income0 / 10
01Bond prices and yields02Duration and convexity03Immunization and duration matching04Spot rates, forward rates and the yield curve05Non-parallel curve moves and key-rate durations06Bond futures and the cheapest-to-deliver07Interest rate swaps08Callable bonds and negative convexity09Credit risk: default probabilities and credit spreads10Real rates, inflation and inflation-linked bonds
Corporate finance0 / 10
01Interest, compounding and discounting02Annuities, perpetuities and loan amortization03Net present value and internal rate of return04Project risk: sensitivity, scenarios and Monte Carlo NPV05The weighted average cost of capital06Capital structure and the Modigliani–Miller theorems07Dividends, payout policy and the dividend discount model08Discounted cash flow valuation09Relative valuation with multiples10Real options: the value of flexibility
Probability and measure0 / 13
01Measuring the size of sets02σ-algebras and Borel sets03Lebesgue measure and null sets04Measurable functions05The Lebesgue integral06Convergence theorems07Probability spaces and Kolmogorov's axioms08Random variables and their distributions09Expectation, variance and inequalities10Independence and product measures11Modes of convergence and the law of large numbers12Conditional probability and conditional expectation13Measure theory in option pricing
Stochastic models0 / 17
01Random walks and Brownian motion02The law of large numbers and the central limit theorem03Probability spaces, σ-algebras and random variables04Filtrations, adapted processes and stopping times05Conditional expectation and martingales06Properties of Brownian motion07The reflection principle and first passage times08The Brownian bridge09The Itô integral10Itô's lemma11Kolmogorov equations and the Feynman–Kac formula12Change of measure and Girsanov's theorem13Monte Carlo option pricing14Simulating SDEs: the Euler–Maruyama scheme15Correlated Brownian motions and multi-asset models16Mean reversion: Ornstein–Uhlenbeck and Vasicek17Jumps and the Merton jump-diffusion model
Market microstructure0 / 11
01Market makers and liquidity02The limit order book03Queue position and fill probability04Adverse selection and informed trading05The Glosten–Milgrom model06Measuring and decomposing the bid–ask spread07Informed trading and Kyle's lambda08Price impact and optimal execution09Inventory risk and quote skewing10Optimal quoting: the Avellaneda–Stoikov model11Market making profit and loss attribution
Knowledge graph

© 2026 Quant Sandbox · A study aid for quantitative finance

Privacy & dataNo cookies

This site does not use cookies and asks for no personal data. It keeps a few small settings in your browser's local storage — your chosen theme and language, the sidebar layout, and your progress and answers in the Guides — so it remembers them on your next visit. This data never leaves your device; clearing your browser storage removes it. Inputs you change can also be captured in the page URL, so you can share or bookmark a specific setup. The site uses Vercel Web Analytics, a privacy-friendly, cookieless service that records only anonymous, aggregated usage (such as page views) without identifying you or tracking you across other sites.

Guides/Portfolio & risk/12

Estimating expected returns and covariances

Lesson 12 of 12 · 1 min read

Every optimiser in "The efficient frontier and the capital market line" and "Portfolio constraints and the no-short-sales frontier" takes expected returns, volatilities and correlations as given. In practice they are estimated from a few years of data, and the estimates are noisy. This lesson measures how noisy, shows how the optimiser magnifies the noise, and introduces shrinkage as a remedy. It uses the returns and volatility of "Returns and volatility".

Sample moments

From nnn observed returns r1,…,rnr_1, \dots, r_nr1​,…,rn​ the usual estimates are the sample mean and the sample variance:

μ^=1n∑t=1nrt,σ^2=1n−1∑t=1n(rt−μ^)2.\hat\mu = \frac1n\sum_{t=1}^n r_t, \qquad \hat\sigma^2 = \frac1{n-1}\sum_{t=1}^n (r_t - \hat\mu)^2.μ^​=n1​t=1∑n​rt​,σ^2=n−11​t=1∑n​(rt​−μ^​)2.

Both are unbiased: on average over many samples they equal the truth. But a single sample is one draw, and the estimate for the portfolio is only as good as that draw.

How wrong the estimates are

If returns are independent with volatility σ\sigmaσ, the standard error of the sample mean is

SE(μ^)=σn,SE(σ^)≈σ2n.\mathrm{SE}(\hat\mu) = \frac{\sigma}{\sqrt n}, \qquad \mathrm{SE}(\hat\sigma) \approx \frac{\sigma}{\sqrt{2n}}.SE(μ^​)=n​σ​,SE(σ^)≈2n​σ​.

With nnn counted in years and σ\sigmaσ annual, a stock with 20% volatility observed for 5 years has a mean known to within 8.9 percentage points, for 20 years within 4.5 points, and even after 100 years within 2.0 points. The equity risk premium itself is a few percentage points, so a lifetime of data barely separates a good asset from a mediocre one. More frequent observations do not help the mean: it depends on the length of the sample, not on how often it is cut. Volatilities and correlations, by contrast, are estimated much more precisely, and sampling daily improves them.

Error maximisation

The optimiser treats the estimates as truth and puts the most weight where the estimated return is highest relative to risk. An asset that was lucky in the sample looks attractive, and the optimiser buys a lot of it; an unlucky one is sold short. The portfolio is therefore built on the errors, which is why it is called an error maximiser.

The figure shows two assets with true expected returns 4% and 10%, volatilities 10% and 20%, no correlation and a risk-free rate of 2%. The true tangency portfolio holds 50% in each. The faint curves are frontiers estimated from 20 random samples of 60 months (5 years): they scatter widely around the true one. The middle half of the estimated tangency weight in asset 1 runs from 47% to 97%, against the true 50%, and the portfolios built from these estimates lose on average 0.160 of Sharpe ratio, compared with 0.447 for the true optimum. Move the sample to 600 months and the loss falls to 0.020.

Figure: Estimating expected returns and covariancesOpen in Portfolio Optimization
60
12600
0.00
01
Estimated frontiersTrue frontier
Standard error of a mean (asset 2)
8.9%
Estimated weight in asset 1, middle half
47% to 97%
True tangency weight
50%
Average Sharpe lost
0.160

Shrinkage

A remedy is to pull the noisy estimates towards a sensible target. For expected returns the simplest target is the average over all assets, μˉ\bar\muμˉ​:

μ~i=(1−k) μ^i+k μˉ,0≤k≤1.\tilde\mu_i = (1 - k)\,\hat\mu_i + k\,\bar\mu, \qquad 0 \le k \le 1.μ~​i​=(1−k)μ^​i​+kμˉ​,0≤k≤1.

With k=0k = 0k=0 nothing changes, and with k=1k = 1k=1 all assets get the same expected return. Another target is the prior implied by "CAPM, beta and the security market line", under which expected returns differ only through beta. Shrinkage adds a little bias but removes much variance. At 60 months, k=0.5k = 0.5k=0.5 cuts the average Sharpe loss in the figure from 0.160 to 0.097.

Covariances are easier

The relative error of a volatility estimate is SE(σ^)/σ=1/2n\mathrm{SE}(\hat\sigma)/\sigma = 1/\sqrt{2n}SE(σ^)/σ=1/2n​: with 240 monthly observations that is about 4.6%, against a mean that is uncertain by more than its own size. The difficulty with covariances is a different one, their number: NNN assets have N(N+1)/2N(N+1)/2N(N+1)/2 variances and covariances, so a sample of a few years cannot pin them down for hundreds of stocks. Imposing a factor structure, as in "Factor models and systematic risk", replaces most of them with a handful of parameters, which is another form of shrinkage.

Worked example

How long a sample the mean needs

  1. Standard error of the mean of a 20%-volatility asset after 5 years, in percentage points.

    SE=σn\displaystyle \mathrm{SE} = \frac{\sigma}{\sqrt n}SE=n​σ​=8.94
  2. After 20 years.

    SE=20%20\displaystyle \mathrm{SE} = \frac{20\%}{\sqrt{20}}SE=20​20%​=4.47
  3. A 95% band around the estimate after 20 years is about 1.96 standard errors either side; its half-width in percentage points.

    1.96⋅SE\displaystyle 1.96\cdot\mathrm{SE}1.96⋅SE=8.76
  4. Years of data needed to bring the standard error down to 1 percentage point.

    n=(σSE)2\displaystyle n = \left(\frac{\sigma}{\mathrm{SE}}\right)^2n=(SEσ​)2=400

Summary

  • Sample moments are unbiased but noisy: the standard error of a mean is σ/n\sigma/\sqrt nσ/n​ and does not improve with more frequent data.
  • An optimiser overweights assets with lucky samples, so the frontier built from estimates is unstable and loses Sharpe ratio in reality.
  • Shrinking the means towards a common target adds a little bias and removes much variance.
  • Covariances are estimated better than means; the problem there is their number, handled with factor structure.

The Monte Carlo lessons later in the stochastic track use the same standard-error idea for simulated averages.

Try itEstimate a frontier from a sample in the Efficient Frontier lab
2 questions on this lesson at the end of the series
Previous · 11Portfolio constraints and the no-short-sales frontierNextBack to Portfolio & risk
Connections

Estimating expected returns and covariances

Open the full graph
Builds on
02.11Portfolio constraints and the no-short-sales frontier02.03The efficient frontier and the capital market line02.01Returns and volatility02.05CAPM, beta and the security market line02.07Factor models and systematic risk
See it in the knowledge graph
Labs for this lesson
Portfolio OptimizationRisk & Return