PART XIII · Chapter 106 · 600 / 660

Lesson 600. Confidence intervals and the bootstrap, up to the block bootstrap

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

A report wrote: "Average 20-day holding return 0.69%, 95% confidence interval 0.45 to 0.93%." The interval does not include 0, so it seems you could say the average return is above 0. But this average was computed from 1,241 values, with 20-day returns calculated every day and used with overlap. Recomputing the same data without overlap gives an interval of −0.43 to 1.75%, which comfortably includes 0.

This lab applies five ways of building a confidence interval to synthetic data with a known true value. It repeats the same experiment with 300 seeds to measure what percentage of the time each method's interval actually covers the true value (the coverage rate). The approximation for the standard error was covered in Lesson 589, and the block bootstrap that resamples paths to check a rule's robustness in Lesson 591, so this lesson deals only with building an honest interval for one estimate.

1. What a confidence interval says and does not say

A 95% confidence interval is a range built so that, if you repeated the process of drawing a new sample and building an interval the same way, 95% of those intervals would cover the true value. It does not mean that the probability that the true value lies inside one interval you built is 95%. The true value is either inside the interval or not, and the 95% is a property of the method.

So a way of building intervals can be tested. Make data with a known true value many times and count the share of intervals that cover the true value. If that share is far from 95%, intervals built that way are 95% in name only.

2. Experiment design: synthetic data with a known true value and five intervals

The data are synthetic data made with a fixed seed. Daily returns were drawn from independent normal distributions with a mean of 0.04% and a standard deviation of 1%, for 1,260 periods (about 5 years). The mean was deliberately set above 0 so that the true value is known; this is not a property of real markets. The value to estimate is the average 20-day return, and the true value is 20 × 0.04% = 0.8%. It is a hypothetical example for teaching that estimates the average return of simply holding an asset.

Computed every day, there are 1,241 20-day returns (overlapping); computed in 20-day blocks, there are 63 (nonoverlapping). Overlapping neighbors share 19 of their 20 days, so for this seed the autocorrelation of neighboring values was 0.94.

  • Normal approximation (overlapping): mean ± 1.96 × standard deviation ÷ √1,241
  • Simple bootstrap (overlapping): resample the 1,241 values one at a time at random, compute the mean 400 times, and use the 2.5th and 97.5th percentiles as the interval
  • Block bootstrap (overlapping): resample in chunks of b consecutive values (wrapping around to the start past the end). Baseline b = 20
  • Normal approximation (nonoverlapping): the same formula with the 63 values
  • Daily mean × 20: the mean and standard error of the 1,260 daily values, multiplied by 20

3. The intervals for one seed: same data, different conclusions

Method (synthetic data, seed 20261120) 95% interval Includes 0?
Normal approximation (overlapping) 0.45 to 0.93% No
Simple bootstrap (overlapping) 0.44 to 0.92% No
Block bootstrap (overlapping, b = 20) −0.03 to 1.52% Yes
Normal approximation (nonoverlapping) −0.43 to 1.75% Yes
Daily mean × 20 −0.43 to 1.74% Yes

On the same 1,260 days, the first two methods say "above 0" and the last three say "cannot be told apart from 0." The first two intervals are narrow because they treat the 1,241 values as independent observations. The actual information is only about the 63 values cut every 20 days (Lesson 599 section 5).

The simple bootstrap uses no normal assumption, so it looks safer, but the moment it shuffles the observations one by one it erases the dependence between neighbors. So it came out just as narrow as the normal approximation. Using fewer distributional assumptions and preserving the dependence structure are different problems.

4. Coverage rate: repeating 300 times

We repeated the same experiment with 300 seeds (20261121 to 20261420) and counted the share of intervals that covered the true value of 0.8% and their average width.

Method (synthetic data, 300 seeds) Coverage rate Average width
Normal approximation (overlapping) 34.0% 0.49 percentage points
Simple bootstrap (overlapping) 34.3% 0.49 percentage points
Block bootstrap (overlapping, b = 20) 88.0% 1.76 percentage points
Normal approximation (nonoverlapping) 94.7% 2.19 percentage points
Daily mean × 20 94.7% 2.21 percentage points

Bar chart of the share of 95% intervals, built five ways, that covered the true value of 0.8%. A normal approximation on overlapping 20-day returns gives 34.0%, the simple bootstrap 34.3% and the block bootstrap (block 20) 88.0%; the normal approximation on nonoverlapping cuts and the daily mean × 20 both give 94.7%.

The first two intervals, called 95%, covered the true value only about once in three tries. If such intervals are written in a report, even a result with no edge or a small edge is easily described as statistically above 0. The block bootstrap improved greatly to 88.0%, and the two methods that switched to a form without dependence were close to 95%.

5. Block length and the limits

The coverage rate of the block bootstrap depends on the block length. It was 34.3% for block 1 (the same as the simple bootstrap), 65.0% for 5, 78.7% for 10, 88.0% for 20, 91.0% for 40, 90.7% for 60 and 89.7% for 120. Blocks shorter than the length of the dependence (here 20 days) cut the dependence and narrow the interval, and from about twice that length, making them longer does not help.

A line of the coverage rate of block bootstrap 95% intervals by block length. It rises from 34.3% at block 1 to 65.0% at 5, 78.7% at 10 and 88.0% at 20, and at 40, 60 and 120 it rises no further, at 91.0%, 90.7% and 89.7%, short of the 95% target.

Lengthening the blocks did not reach 95% because of a limit of resampling from the sample. The dependence inside a chunk is kept, but the dependence between chunks is cut, so unless the blocks are comfortably longer than the dependence, the swing is still underestimated. Conversely, with very long blocks only a dozen or so chunks fit in 1,241 values, and the distribution of the resampled means itself becomes coarse. So read a block bootstrap interval not as the right answer but as an interval that is less wrong than one that ignores dependence. Set the block length from the dependence length of the data before seeing results, and write the results for two or three lengths together (the same principle as Lesson 591).

The Sharpe ratio is also written as an interval. For this seed's daily returns, the annualized Sharpe ratio was 0.53 (true value set at 0.63); the simple bootstrap interval was −0.36 to 1.36 and the block (b = 20) interval was −0.33 to 1.42. The interval built from the standard error of the Lesson 589 approximation is −0.35 to 1.41, almost the same. The three methods came out similar because the daily returns are independent of each other; for returns with dependence, they split apart as in sections 3 and 4. Either way, 0.53 over five years is a number that cannot be told apart from 0.

The record for this lesson is an interval column. For each estimate in the results table, write the interval method, whether observations overlap and the length of the dependence, and the block length and number of resamples. Where possible, put next to it an interval recomputed in a nonoverlapping form.

Try it yourself

  1. From the table in section 3, compute the interval widths of the normal approximation (overlapping) and the normal approximation (nonoverlapping), and find how many times wider one is than the other.
  2. From the table in section 4, read the methods with the lowest and the highest coverage rate, and write their difference from 95% in percentage points.
  3. A colleague says, "The bootstrap uses no distributional assumption, so it is safe even for overlapping data." Answer with the numbers of this lesson.
  4. Assumptions: you computed 5-day returns every day from daily returns, with overlap, and took their average. How would you set the block length of the block bootstrap? Base your answer on this lesson's results by block length.

Answers

First, the overlapping interval is 0.93 − 0.45 = 0.48 percentage points wide and the nonoverlapping interval 1.75 − (−0.43) = 2.18 percentage points, about 4.5 times. This matches the fact that when the independent observations shrink from 1,241 to about 63, the standard error grows roughly √(1,241 ÷ 63) = about 4.4 times.

Second, the lowest is the normal approximation (overlapping) at 34.0%, which is 61.0 percentage points below 95%. The highest are the nonoverlapping normal approximation and the daily mean × 20 at 94.7%, only 0.3 percentage points below.

Third, on the overlapping data the coverage rate of the simple bootstrap was 34.3%, the same as the normal approximation's 34.0%. Using fewer distributional assumptions and preserving the dependence between observations are different things, so for overlapping data use the block bootstrap or a calculation recomputed in a nonoverlapping form.

Fourth, the dependence created by the overlap is 5 days long, so set the blocks longer than 5, for example two lengths, 10 and 20, before seeing results. In this lesson, blocks shorter than the dependence length (20) lowered the coverage rate sharply (65.0% at block 5), and lengths of twice the dependence or more did not help further (91.0%, 90.7%).

Data: synthetic data (fixed seed 20261120; independent normal daily returns with a mean of 0.04% and a standard deviation of 1%; 1,260 periods) and seeds 20261121 to 20261420 (300 seeds) with the same settings. The bootstrap resampled 400 times for each interval and 1,000 times for the Sharpe ratio interval. Every number was read from the results tables computed from these data.

Related lessons