F2-conf-03 — Coverage of OLS slope confidence intervals in a small heteroskedastic fixed design
Question
Model: y_i = 1 + 0.5 x_i + σ_i ε_i, with i = 1…30, ε_i iid N(0,1), and x_i, σ_i held fixed at the values in data/design.csv. Do nominal 95% intervals β̂ ± t_{0.975}(28)·se reach 95% coverage when se is (a) the conventional OLS standard error, or (b) the HC1 robust standard error? The task also asks for (c) the exact SD of β̂ and (d) E[se_conv].
Data and exclusions
data/design.csv has 30 rows (n_input_rows) and SHA-256 b1a17a52…74f0. It has no missing values, no duplicates, and every σ is positive. No rows were excluded (out/exclusions.csv: 30 − 0 = 30). No data issues were found, so data_issues = []. In this design σ_i is smallest near x = 0 and largest at the extreme x values (largest of all at x = 1.99). That means the error variance is highest at the high-leverage points. See out/state/data_audit.md.
Method
- Exact SD. β̂ − β = Σ w_i σ_i ε_i, with w_i = (x_i − x̄)/S_xx. So SD(β̂) = sqrt(Σ w_i² σ_i²) (
sd_beta_exact). No simulation is involved. - Monte Carlo. R = 2000 replications (
n_replications), using numpydefault_rngwith seed 20261030 (random_seed). Only ε is redrawn in each replication; x and σ stay fixed. Each replication fits OLS and computes:- se_conv = sqrt(s²/S_xx), where s² = RSS/(n − 2);
- se_HC1 = sqrt(n/(n−2) · Σ(x_i − x̄)² e_i² / S_xx²).
- Coverage is the share of replications with |β̂ − 0.5| ≤ t_{0.975}(28)·se, where t = 2.0484 (
t_critical). - Checks. For replication 1, both SEs match statsmodels to within 1e-10 (
statsmodels_crosscheck_passed). - Decision rule.
conventional_ci_undercoversis true if coverage_conventional < 0.95 − 3·sqrt(0.95·0.05/2000). The binomial standard error here is evaluated at the nominal level, which is the null hypothesis being tested. I also checked the conclusion using the SE evaluated at the estimated coverage.
Results
- Conventional interval (baseline). Coverage is 0.844 (
coverage_conventional), well short of the nominal 0.95. - HC1 interval. Coverage is 0.902 (
coverage_hc1). This is better than the conventional interval but still below 0.95 (hc1_ci_undercovers= true). - SD of β̂. The exact value is 0.2680 (
sd_beta_exact). The Monte Carlo SD is 0.2696 (sd_beta_mc), which agrees with it. The mean of β̂ across replications is 0.4962 (mean_beta_hat), consistent with β̂ being unbiased. - Conventional SE. Its average is 0.1903 (
mean_se_conventional), only 0.71 of the true SD (ratio_mean_se_conv_to_sd_exact). The exact value of sqrt(E[s²]/S_xx) is 0.1932 (sqrt_expected_conv_variance_exact). So the conventional SE is biased downward by design, not by sampling noise: it ignores the fact that the error variance is largest at high-leverage x values. The mean HC1 SE is 0.2408 (mean_se_hc1), closer to the true value but still too small. - Conclusion. The conventional interval does not attain its nominal coverage (
conventional_ci_undercovers= true). The threshold is 0.9354 (undercover_threshold).
Uncertainty
- Coverage estimates (binomial Monte Carlo standard errors):
- conventional: 0.844 ± 0.0081 (
mcse_coverage_conventional); - HC1: 0.902 ± 0.0066 (
mcse_coverage_hc1); - at the nominal level: 0.0049 (
mcse_at_nominal).
- conventional: 0.844 ± 0.0081 (
- Size of the shortfall. The conventional coverage falls about 22 nominal-level MCSEs below 0.95. The conclusion is the same if the MCSE at the estimated coverage is used instead (
conventional_ci_undercovers_using_estimated_mcse= true). - SD estimate. The Monte Carlo standard error of
sd_beta_mcis about 0.0043 (mcse_sd_beta_mc_approx). The gap from the exact value (0.0017) is within that noise. - What the numbers depend on. All values are for this seed and this R. A different seed would shift the coverages by roughly ±1–2 MCSE.
Limitations and open issues
- The results apply only to this fixed design, this σ pattern, n = 30 and Gaussian errors. They should not be generalised to other designs.
- E[se_conv] is estimated by simulation, as the task specifies. Only E[s²] is available in closed form, and it is reported as a diagnostic.
- The undercoverage flag depends on how "binomial standard error" is defined, so I checked two definitions: SE at p = 0.95 and SE at the estimated p. Both give the same conclusion.
- HC1 also undercovers in this small, high-leverage sample. Alternatives such as HC2/HC3 or wild bootstrap were not evaluated because the task does not ask for them.
- Feasibility: complete.