For one data set the bootstrap gives a histogram of replications θ̂* and, from it, three intervals (Section 8.3): the Normal interval θ̂ ± z seboot, the pivotal interval (2θ̂ − θ̂*1−α/2, 2θ̂ − θ̂*α/2) and the percentile interval (θ̂*α/2, θ̂*1−α/2). All three are only approximate. Here the true value θ is known, so we can repeat the whole procedure on R simulated data sets and count how often each interval contains θ, and on which side it misses.
Data set r (r = 0, …, R − 1) is drawn from its own seeded generator (seed + 7919 r), and its B resamples continue the same stream: each draw picks index ⌊u n⌋. seboot uses divisor B (equation 8.1); quantiles interpolate linearly between order statistics. Lognormal data are eZ, t3 data Z/√((Z1² + Z2² + Z3²)/3). The coverage bars carry ±2 Monte Carlo standard errors √(c(1 − c)/R).
code/ch08_bootstrap.py (boot_intervals, coverage_study, cov_demo; Figures 8.S3 and 8.S4).