F2-conf-03 — Coverage of OLS slope confidence intervals in a small heteroskedastic sample
Question
In the fixed-design model y_i = 1 + 0.5 x_i + σ_i ε_i (n = 30, ε_i iid N(0,1); x_i and σ_i taken from data/design.csv), do nominal 95% intervals β̂ ± t₀.₉₇₅(28)·se reach 95% coverage? We compare the conventional OLS SE with the HC1 robust SE.
Data and exclusions
data/design.csv has 30 rows (n_input_rows) and columns i, x, sigma. Its SHA-256 matches the bundle manifest. There are no missing values, duplicates, or invalid σ (all σ > 0), so data_issues = []. We removed nothing (out/exclusions.csv: 30 → 30). This is a feature of the design, not an error: σ_i grows with |x_i| (corr(x², σ²) ≈ 0.99, see out/state/data_audit.md). The error variance is therefore largest at the high-leverage points.
Method
- Exact SD of β̂ (
sd_beta_exact): β̂ = Σ w_i y_i with w = row 2 of (X'X)⁻¹X', so Var(β̂) = Σ w_i² σ_i². No simulation is involved. - Monte Carlo: R = 2000 replications (
n_replications) of n = 30 (n_obs_per_replication). Only ε is redrawn, from numpydefault_rngwith seed 20261030 (random_seed). In each replication the script computes:- β̂;
- se_conv = sqrt(s²·(X'X)⁻¹₂₂), with s² = RSS/(n−2);
- se_HC1 = sqrt(n/(n−2)·Σ w_i² e_i²).
- Both intervals use t₀.₉₇₅(28) = 2.0484 (
t_critical_28). Coverage is the share of replications whose interval contains 0.5. - Decision rule:
conventional_ci_undercoversis true iff coverage_conventional < 0.95 − 3·sqrt(0.95·0.05/2000) = 0.9354 (undercoverage_threshold). - The baseline is the naive conventional interval (
coverage_conventional); the HC1 interval is the comparison. - SEs were cross-checked against statsmodels on one replication and agree to machine precision.
Results
- Conventional interval: estimated coverage is 0.844 (
coverage_conventional). That is far below 95% and below the 0.9354 threshold, soconventional_ci_undercovers= true. The conventional interval does not attain its nominal coverage. - HC1 interval: estimated coverage is 0.902 (
coverage_hc1). It does much better than the conventional interval but is still below 95%. - Exact SD of β̂ is 0.2680 (
sd_beta_exact). The Monte Carlo SD is 0.2696 (sd_beta_mc), which agrees. - The mean of se_conv is only 0.1903 (
mean_se_conventional), about 71% of the true SD. As an exact check, sqrt(E[s²]·(X'X)⁻¹₂₂) = 0.1932 (rms_se_conventional_exact). The conventional SE ignores that the large error variances sit at high-leverage x, so it is biased downward, and this explains the undercoverage. - The mean of se_HC1 is 0.2408 (
mean_se_hc1). It is closer to the true SD but still biased downward in n = 30, which matches HC1's known small-sample bias. - Mean β̂ is 0.4962 (
mean_beta_hat), consistent with OLS being unbiased.
Uncertainty
Binomial Monte Carlo standard errors at R = 2000:
- coverage_conventional: 0.0081 (
mcse_coverage_conventional); - coverage_hc1: 0.0067 (
mcse_coverage_hc1); - at the nominal level 0.95: 0.0049 (
mcse_at_nominal_095).
The conventional shortfall (0.95 − 0.844 = 0.106) is about 22 nominal-level MC SEs, so the conclusion is not sensitive to Monte Carlo noise. The HC1 shortfall (0.048) is also many MC SEs, so HC1 undercoverage is likewise distinguishable from noise. sd_beta_mc differs from the exact value by 0.6%, within the expected sampling error of an SD estimated from 2000 draws (≈1.6%).
Limitations and open issues
- The results apply only to this single fixed design with normal errors. They do not carry over to other designs, error distributions, or sample sizes.
- The coverage estimates depend on the seed within their MC SEs. The yes/no conclusion does not, given its margin.
- The script does not compute exact coverage probabilities (e.g., by numerical integration). Coverage was estimated by Monte Carlo as the task specified.
- The task did not ask for small-sample refinements such as HC2/HC3 or degrees-of-freedom corrections, and none were evaluated.