Portfolio construction
Portfolio return, volatility and the covariance matrix
The three numbers every portfolio model starts from: each ticker's expected return, its volatility, and how the tickers move together (the covariance matrix).
The idea in plain words
A portfolio's return is simply the weighted average of its tickers' returns. Its risk is not: two volatile tickers that zig when the other zags can make a calm portfolio. That is why every model needs not only each ticker's own volatility but also how every pair moves together. The covariance matrix holds all of it in one table: volatilities squared on the diagonal, co-movements everywhere else.
How it is calculated
From daily closes, take daily returns (today ÷ yesterday − 1). The expected return is their average, scaled to a year (× about 252 trading days). Volatility is their standard deviation × √252. The covariance of two tickers is the average product of their deviations from their means, also × 252. The portfolio's variance is every pair's covariance weighted by both weights. Our optimiser also pulls the covariances 10% towards zero (a light shrinkage), so the models do not chase correlations that are partly noise.
r(t) = close(t) ÷ close(t−1) − 1
μᵢ = mean(rᵢ) × 252 σᵢ = stdev(rᵢ) × √252
Σᵢⱼ = cov(rᵢ, rⱼ) × 252 (Σᵢᵢ = σᵢ²)
Portfolio return μₚ = Σ wᵢ μᵢ = wᵀμ
Portfolio variance σₚ² = Σᵢ Σⱼ wᵢ wⱼ Σᵢⱼ = wᵀΣwHow to use it
- Read the volatility of each ticker first: it tells you how big a normal year's swing is (one volatility either side covers about two years in three).
- Look at the correlation table next: the pairs near +1 are near-duplicates; the pairs near 0 or below are where diversification comes from.
- Use at least a year of daily data for the estimates, two or more if the tickers allow it.
Drawing conclusions
- A portfolio's volatility is always at most the weighted average of its tickers' volatilities; the gap is the diversification you earned.
- Expected returns from history are the weakest input: a few lucky months move them a lot. Volatilities and correlations are far more stable.
Example
Running example (used in every portfolio guide): US500, GER40, gold (XAUUSD) and EURUSD, two years of daily data. Expected returns 8%, 7%, 7% and 1% a year; volatilities 18%, 20%, 15% and 7%. US500 and GER40 move together (correlation about 0.7); gold hardly moves with the indices (about 0.04). Half US500 and half GER40 gives a volatility of 17.6%, barely below the two tickers' own 18% and 20%, because they move together. Half US500 and half gold gives 12.0%: same total money, a third less risk, simply because gold does not follow the stock indices.
The example's inputs are illustrative; the weights and figures are what our optimiser returns for them.
Watch out for
- History is a sample, not the truth: expected returns especially are measured with large errors.
- Correlations rise in a crash, exactly when you count on them being low.
- Tickers that trade on different days (crypto at weekends, forex in the week) are aligned on the days they all traded.
A little history
Harry Markowitz put variance and covariance at the centre of investing in "Portfolio Selection" (Journal of Finance, 1952), the paper that founded modern portfolio theory and earned him a share of the 1990 Nobel prize in economics.
Educational content only. No portfolio model knows the future: every one of them works on estimates from the past, and nothing here is investment advice.