Portfolio construction

Walk-forward testing: does the model hold up?

Why every study also fits each model on the first 75% of the data and measures it on the last 25%, and how to read those OOS columns.

2 min de lectura · Pruébalo en el optimizador de carteras ↗

La idea en pocas palabras

Any model looks good on the data it was fitted to. The honest test is to fit it on one period and judge it on the next, as you would have lived it. A model whose out-of-sample results stay close to its in-sample ones is robust; one whose results collapse was memorising noise.

Cómo se calcula

The study splits the daily returns at 75%. Each model is fitted on the first part only; its weights are then held through the last part, and the same figures are measured there: return, volatility, Sharpe, drawdown, total return.

Fit:   w* = model(r₁ … r_{0.75T})
Test:  metrics(w*, r_{0.75T+1} … r_T)

Cómo usarlo

  • Sort the study by OOS Sharpe as well as Sharpe; prefer models that rank well on both.
  • Use a longer history (3–5 years) so the test part is long enough to mean something.
  • Treat a model that wins in-sample and loses out-of-sample with suspicion, however good its headline numbers are.

Sacar conclusiones

  • Return-chasing models (Kelly, Maximum Sharpe, Markowitz) usually lose the most out of sample, because expected returns are the hardest input to estimate.
  • Risk-based models (risk parity, ERC, HRP, minimum variance) usually keep their character out of sample.

Ejemplo

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). In the example, the return-driven models concentrate in US500 and gold because those two had the best history. If the last quarter of the data had been weak for gold, their OOS Sharpe would fall well below their in-sample 0.63, while ERC, which ignores expected returns, would change much less.

Los datos de entrada del ejemplo son ilustrativos; los pesos y cifras son los que devuelve nuestro optimizador para ellos.

Ten cuidado con

  • One split is one test: a single good OOS period can be luck too.
  • The test part is short with little data; treat small differences as ties.

Un poco de historia

Walk-forward analysis was popularised for trading systems by Robert Pardo (1992). In portfolio research, DeMiguel, Garlappi and Uppal (2009, "Optimal Versus Naive Diversification") found that out of sample, many optimised portfolios fail to beat simple equal weights, a result that shaped how models are judged since.

Solo contenido educativo. Ningún modelo de cartera conoce el futuro: todos trabajan con estimaciones del pasado, y nada de lo aquí expuesto es asesoramiento de inversión.