# F2-conf-03 — Coverage of OLS slope CIs, n = 30, heteroskedastic fixed design ## Question In y_i = 1 + 0.5 x_i + σ_i ε_i (ε_i iid N(0,1), x_i and σ_i fixed from `data/design.csv`, n = 30), what is the true coverage of the nominal 95% intervals β̂ ± t_{0.975}(28)·se for (a) the conventional OLS SE and (b) the HC1 robust SE? Also: (c) exact SD of β̂, (d) E[se_conv]. Does the conventional interval attain 95%? ## Data and exclusions `data/design.csv`: 30 rows read, columns i, x, sigma. No missing values, no duplicate indices, all σ_i > 0; no exclusions, no data issues. The design is strongly heteroskedastic: σ_i rises with |x_i| (from ≈0.60 near x = 0 to 1.79 at x = 1.99), i.e. the error variance is largest exactly at the high-leverage points. ## Method - (c) Analytically: β̂ = a'y with a the slope row of (X'X)⁻¹X', so Var(β̂) = Σ a_i² σ_i²; sd_beta_exact = √ of that. - Monte Carlo: R = 2000 replications, numpy `default_rng(20261030)`, only ε redrawn. In each replication: OLS fit; se_conv = √(s²·[(X'X)⁻¹]₂₂) with s² = RSS/(n−2); se_HC1 = √(n/(n−2) · Σ a_i² e_i²) (HC0 sandwich × n/(n−2)). Critical value t_{0.975}(28) = 2.0484. Coverage = share of replications with |β̂ − 0.5| ≤ t·se. - Undercoverage decision: coverage_conventional < 0.95 − 3·√(0.95·0.05/2000) = 0.95 − 3·0.00487 = 0.9354. - `out/analysis.py` regenerates `out/results.json` deterministically (verified by identical checksums over two runs). ## Results | quantity | value | |---|---| | Coverage, conventional interval | 0.844 | | Coverage, HC1 interval | 0.902 | | Exact SD of β̂ (analytical) | 0.2680 | | MC SD of β̂ (ddof = 1) | 0.2696 | | Mean se_conv | 0.1903 | | (diagnostic, not in results.json) mean se_HC1 | 0.2408 | The conventional SE is on average about 29% too small relative to the true SD of β̂ (0.190 vs 0.268), because it assumes a constant variance while the largest variances sit at the high-leverage x values. Consequently the conventional interval covers β only 84.4% of the time: **it does not attain its nominal 95% coverage** (`conventional_ci_undercovers` = true). HC1 helps substantially (90.2%) but is still clearly below 95% in this small sample, since HC1 is itself downward biased under high leverage (mean se_HC1 0.241 < 0.268). The MC SD of β̂ agrees with the analytical value within MC error, a check on the simulation. ## Uncertainty Binomial Monte Carlo standard errors (R = 2000): - coverage_conventional: √(0.844·0.156/2000) = 0.0081 (≈ 95% MC interval 0.828–0.860). - coverage_hc1: √(0.902·0.098/2000) = 0.0066 (≈ 95% MC interval 0.889–0.915). - At the nominal 0.95, MCSE = 0.0049; the conventional estimate is ≈ 22 such SEs below 0.95, and the HC1 estimate ≈ 10 below, so both shortfalls are far beyond MC noise. - The MC SD of β̂ has relative MC error ≈ 1/√(2(R−1)) ≈ 1.6%; observed deviation from exact is 0.6%. ## Limitations and open issues - Results are specific to this fixed design (heteroskedasticity aligned with leverage) and to Gaussian errors; with other designs the conventional interval may be fine. - Coverage is estimated with a single seed and R = 2000 as prescribed; MC error (~0.7–0.8 pp) is reported above. - Better small-sample alternatives (HC2/HC3, wild bootstrap, Bell–McCaffrey df corrections) were not evaluated because the task did not ask for them; HC1 with t(28) still undercovers here. - E[se_conv] is estimated by MC only, as requested (an exact closed form for E[√s²] is not simple; √E[se_conv²] = 0.1932 analytically, consistent with the MC mean 0.1903 by Jensen's inequality).