PART XIII · Chapter 106 · 599 / 660

Lesson 599. The law of large numbers, the central limit theorem and the sample size you need

Chapter 106. Statistical Foundations of Backtesting: Fat Tails, Bayes, CLT & Bootstrap

"It was computed from 1,260 daily data points over five years, so the sample is large enough." This sentence appears often in backtest reports. Judged by the number of observations, it sounds reasonable. But what you need to measure the average return precisely is not the number of observations but the length of the period observed, and that period has to be much longer than you might think.

This lesson uses assumed numbers and synthetic data made with fixed seeds to check three things. The first is the speed at which the sample mean approaches the expected value (the law of large numbers). The second is the reason the sample mean can be read with a normal distribution (the central limit theorem). The third is how many years are needed to tell an average return apart from 0. The standard error of the Sharpe ratio and the minimum track record length formula were covered in Lesson 589, so this lesson deals with the estimation of the mean that underlies them.

1. The law of large numbers: the mean approaches, but slowly

The law of large numbers is the property that, as observations from the same distribution increase, the sample mean approaches the expected value. The problem is the speed. If observations are independent of each other, the standard error of the sample mean is the standard deviation ÷ √number of observations, so you have to multiply the observations by four to halve the swing.

Let us check this with synthetic data. Daily returns were drawn from a normal distribution so that the expected annual return is 8% and the annual volatility 20% (fixed seed 20261119). The data were deliberately built with a mean other than 0; this is a setting, not a property of real markets. The annualized mean of this path was −21.9% after year 1, 1.3% after year 5, 5.0% after year 10 and 5.8% after year 30. The true value of 8% is still far away after 30 years.

The running annualized mean of one path of synthetic daily returns and the band of the true value 8% ± 1.96 × 20% ÷ √years. The running mean is −21.9% after year 1, 1.3% after year 5, 5.0% after year 10 and 5.8% after year 30, inside the band for all 30 years; even after 30 years the band is wide, about 0.8% to 15.2%.

The band in the figure is the true value ± 1.96 × 20% ÷ √years. For 1 year it is 8 ± 39.2%, and even after 30 years it runs from about 0.8% to 15.2%. The path stayed inside the band for all 30 years; the width of the band is not a quirk of this path but the difficulty of measuring an average return itself.

2. The period sets the mean, the frequency sets the volatility

Whether you measure the same five years daily or monthly, the precision of the average return is almost the same. The standard error of the annualized mean is the annual volatility ÷ √years, which has nothing to do with how finely each year is cut. Merton (1980) set out this property: the accuracy of an estimate of the expected return depends only on the total length of the observation period.

We made 200 sets of synthetic data with the same settings as section 1, with fixed seeds 20261120 to 20261319 (20 years each). The first 5 years of each path were estimated separately from daily data and from monthly data formed by grouping 21 days at a time.

200 five-year samples (synthetic data) Estimated daily Estimated monthly
Standard deviation of the annualized mean 8.94 percentage points 9.00 percentage points
Standard deviation of annual volatility 0.40 percentage points 1.80 percentage points

The swing of the mean equals the approximation 20% ÷ √5 = about 8.94%, and switching to daily data did not reduce it. Volatility is the opposite: the daily estimate was more than four times as precise as the monthly one. So volatility and correlation (Lesson 598) can be measured quite precisely with frequent observations over a short period, but the average return cannot.

Because of this difference, 18% of the 200 five-year samples gave an annualized mean below 0. The true expected value was 8% in every one of them. With 20-year samples in the same experiment, the standard deviation of the mean fell to 4.55 percentage points, and the samples below 0 fell to 3%.

3. The central limit theorem: why the mean can be read with a normal distribution

The central limit theorem is the property that, when you add up or average many independent observations, the distribution of the sum approaches a normal distribution whatever the shape of the original distribution, as long as its variance is finite. So even if daily returns have fat tails, the confidence interval of a five-year mean can be built with a normal approximation.

We checked this with synthetic returns from a fat-tailed t distribution (4 degrees of freedom) with the same mean and volatility (200 paths with fixed seeds 20261320 to 20261519, 30 years each). The 95% interval commonly used for a five-year mean (mean ± 1.96 × standard error) covered the true value in 92.5% of 200 runs, and in 94.0% of the 200 normal data sets of section 2. Even with fat tails, the approximation did not go far wrong.

What approaches a normal distribution is the sum, not the daily return. In the same t-distribution data, the share of moves beyond 3 times the true standard deviation was 1.34% for single days, 0.53% for 21-day sums and 0.47% for 252-day sums. For a normal distribution it would be 0.27%. There are few 252-day sums, so this share itself swings a lot. The longer the grouping period, the closer it gets to a normal distribution, but the tails of single days (Lesson 596) remain. The interval for the mean can be built with a normal approximation, but the probability of a daily loss must not be read that way.

4. How many years are needed to tell an average return apart

Solving the standard error of section 1 backward gives the period you need. To say with a 95% confidence interval that the mean is not 0, the annualized mean has to be larger than 1.96 × annual volatility ÷ √years, so the years needed ≈ (1.96 × annual volatility ÷ annual mean)². The annual mean ÷ annual volatility equals the annualized Sharpe ratio with the risk-free rate set to 0.

Assumptions: as in the settings of section 1, an annual mean of 8% and an annual volatility of 20%. The period needed is (1.96 × 20 ÷ 8)² = about 24.0 years. By the same formula, an annualized Sharpe ratio of 0.2 needs about 96 years, 0.6 needs about 10.7 years, and 1.0 needs about 3.8 years.

Bar chart of the approximate number of years needed to say with a 95% interval that the mean is not 0, by annualized Sharpe ratio (annual mean ÷ annual volatility). About 96 years for 0.2, about 24.0 years for 0.4, about 10.7 years for 0.6 and about 3.8 years for 1.0.

The minimum track record length of Lesson 589 computes the same idea with a one-sided 95% (1.645) and the standard error of the Sharpe ratio. The result of about 2.7 years for an annualized 1.0 also equals this formula with 1.645 in place of 1.96: 1.645² = about 2.7. Either way, the conclusion is the same. It is hard to tell a result with a Sharpe ratio around 0.5 apart from 0 with five years of data, and this is also why the power in Lesson 597 was only 30%.

Do this calculation before you see results. Write the Sharpe ratio you expect and the data period available in the plan (Lesson 581), and if the years needed are longer than the data period, record that fact first. If, after an unclear result, you lengthen or shorten the period to find a stretch that differs from 0, that choice of period becomes another trial (Lesson 588). If the data are not enough, it is more honest to leave the Lesson 306 verdict at "not checked".

5. Not the number of observations but the number of independent observations

All of the formulas above assume that observations are independent of each other. If today's return tends to follow yesterday's (autocorrelation), or if 20-day returns are computed every day and used with overlap, the number of observations looks large but the independent information is small.

In the simple case of constant autocorrelation, the number that can count as independent observations (the effective sample size) is approximately the number of observations × (1 − autocorrelation) ÷ (1 + autocorrelation). Assumptions: with 1,260 observations and an autocorrelation of 0.3, 1,260 × 0.7 ÷ 1.3 = about 678. If 20-day returns are used every day with overlap, neighboring observations share 19 days, so the independent observations shrink to roughly the level of the 63 you get by cutting without overlap. Lesson 600 covers how much too narrow the intervals then come out, and Lesson 604 covers the problems this causes in regression.

The record for this lesson is a sample-size box. With the number of observations, write the observation period (years) and the standard error of the annualized mean. Add the approximate number of years needed to tell the mean apart from 0, and the effective sample size if there is autocorrelation or overlap.

Try it yourself

  1. Assumptions: annual volatility 15%, observation period 9 years. Find the standard error of the annualized mean and the half-width of the 95% interval. Does it change if the same 9 years are measured daily?
  2. From the table in section 2, read the standard deviations of the mean and of volatility for the daily and the monthly estimates, and write what sets the precision of each.
  3. Assumptions: annual mean 6%, annual volatility 18%. Use the approximation to find the number of years needed to say with a 95% interval that the mean is not 0.
  4. Assumptions: 2,520 observations, autocorrelation 0.5. What is the approximate effective sample size?

Answers

First, the standard error is 15% ÷ √9 = 5%, and the half-width of the 95% interval is 1.96 × 5% = 9.8%. Measuring the same 9 years daily leaves the standard error of the mean almost unchanged. What shrinks is the error of the volatility estimate.

Second, the standard deviation of the mean is almost the same, daily 8.94 percentage points and monthly 9.00 percentage points, while the standard deviation of volatility is 0.40 percentage points against 1.80 percentage points, much smaller for the daily data. The length of the period sets the precision of the mean, and the frequency of observation sets the precision of volatility.

Third, the Sharpe ratio is 6 ÷ 18 = about 0.33, so (1.96 × 18 ÷ 6)² = about 34.6 years. If the backtest period is 10 years, failing to tell the average return apart from 0 is the natural result.

Fourth, 2,520 × 0.5 ÷ 1.5 = 840. That is one third of the number of observations, so the standard error is about √3 = 1.73 times the value computed from the number of observations.

Related lessons