How sure are you of a Sharpe ratio?
A back-test reports one Sharpe ratio, but it is estimated from noisy returns. A Bayesian estimate treats the daily mean μ and variance σ² as unknown. It starts from a weak prior and updates it with the data. The normal-inverse-gamma pair makes the update a formula with four numbers. Then you sample the posterior: draw a precision, then a mean, and turn each pair into an annual Sharpe ratio μ/σ·√252. The draws give an interval and the probability that the Sharpe ratio is above zero.
The second half is about many stocks. The best-looking average returns are partly luck, so you shrink them toward the grand mean with the hierarchical rule of the last topics. The test is honest. Estimate on the first half of the years, then check how well each method predicts the average returns of the second half. You will also write your own Metropolis sampler. It is the tool for posteriors that have no formula, and here you test it on a posterior whose answer is known.
SPY since 2005 has a Sharpe ratio of about 0.52. The 95% credible interval runs from about 0.09 to 0.94, with a 99% chance of being above zero. Its last 250 days show 1.34, which looks wonderful, but the interval runs from about -0.66 to 3.30 and the chance of being positive is only about 91%. One year cannot separate skill from luck. For the 54 stocks, the spread of the average returns is no larger than noise alone would give, so τ²=0 and everyone is pulled to the grand mean. Predicting the second half, the raw averages have a mean squared error of about 0.0135, the shrunk ones about 0.0106: 22% lower.
- Conjugate update: four numbers (mₙ,kₙ,aₙ,bₙ) describe the whole posterior of the mean and variance.
- Honest error bars: a year of data gives a Sharpe interval so wide that it includes zero.
- Shrinkage test: estimate on the first half, score on the second. Pooling beats raw averages here.
Daily returns are treated as normal and independent, which ignores fat tails and volatility clustering. The weak prior is chosen by hand. The stock sample is survivor-biased, since it only holds large companies that existed throughout, and the stocks move together, so the study is less independent than it looks. The lesson is the method and the width of the error bars, not the exact numbers.
Lab · what's graded
7 tasks · 100 pts- The Sharpe ratio10 pts
- The posterior update15 pts
- Sharpe draws15 pts
- A credible interval10 pts
- Shrinking means15 pts
- A Metropolis sampler20 pts
- The shrinkage study15 pts