SPB Git

spb/wp29_uqo

Public
3.4 KB · 42 lines markdown
1# F2-conf-03 — Coverage of OLS slope CIs in a small heteroskedastic sample23## Question4In the fixed-design model y_i = 1 + 0.5 x_i + σ_i ε_i (n = 30, ε_i iid N(0,1), x_i and σ_i from `data/design.csv`), what is the true coverage of nominal 95% intervals β̂ ± t_{0.975}(28)·se for (a) conventional and (b) HC1 standard errors? We also want (c) the exact SD of β̂ and (d) E[se_conv], and whether the conventional interval reaches its nominal coverage.56## Data and exclusions7`data/design.csv` has 30 rows, no missing values, all σ_i > 0, and the index runs 1–30. Nothing was excluded and no data issues were found. σ_i rises with |x_i| (roughly 0.60 near x = 0 up to 1.79 at x = 1.99), so the largest error variances sit at the high-leverage points.89## Method10- Exact SD (c): β̂ = A y with A = (X'X)⁻¹X', so Var(β̂₁) = Σ a₁ᵢ² σᵢ². This is computed analytically, with no simulation.11- Monte Carlo: R = 2000 replications using `numpy.random.default_rng(20261030)`. Each replication redraws only ε; x and σ stay fixed. In every replication:12  - β̂ is computed by OLS.13  - se_conv = sqrt(s²·[(X'X)⁻¹]₂₂), with s² = RSS/(n−2).14  - se_HC1 = sqrt(n/(n−2) · Σ a₁ᵢ² eᵢ²), i.e. the HC0 sandwich scaled by n/(n−2).15- Both intervals use t_{0.975}(28) = 2.0484. Coverage is the share of replications whose interval contains 0.5.16- Undercoverage rule: coverage_conv < 0.95 − 3·sqrt(0.95·0.05/2000), i.e. below 0.9354.17- Running `out/analysis.py` regenerates `out/results.json` deterministically. Two runs produced identical output.1819## Results20| Quantity | Value |21|---|---|22| Coverage, conventional CI | 0.844 |23| Coverage, HC1 CI | 0.902 |24| SD(β̂), exact | 0.2680 |25| SD(β̂), Monte Carlo (ddof=1) | 0.2696 |26| Mean se_conv | 0.1903 |27| Mean se_HC1 (supplementary) | 0.2408 |2829The conventional SE is badly biased downward. Its mean (0.190) is about 29% below the true SD (0.268). The exact E[se_conv²] = 0.0373 gives sqrt ≈ 0.193, which agrees with the Monte Carlo mean once Jensen's inequality is taken into account. As a result, the conventional interval covers only about 84.4% of the time against the nominal 95%. **The conventional interval does not attain nominal coverage** (`conventional_ci_undercovers = true`). HC1 does much better (90.2%) but still undercovers: on average it also falls short of the true SD, as is typical for HC0/HC1 at n = 30 with high-leverage points.3031## Uncertainty32- Binomial Monte Carlo SE at the nominal p = 0.95: 0.0049. This is the value used in the decision rule.33- MCSE at the estimates: conventional 0.0081 (approx. 95% MC interval 0.828–0.860); HC1 0.0066 (approx. 0.889–0.915).34- The conventional shortfall (0.106) is about 22 MCSEs, so the conclusion is not sensitive to Monte Carlo noise.35- The MC SD of β̂ (0.2696) is within sampling error of the exact value (0.2680). The relative SE of a sample SD with R = 2000 is about 1.6%.3637## Limitations and open issues38- The results apply only to this single fixed design, with normal errors and one seed. Other designs or error distributions would give different coverage.39- R = 2000 limits precision to about ±0.8 percentage points on each coverage estimate.40- (d) was estimated by Monte Carlo as the task requires. The analytic E[se_conv²] is reported only as a check.41- HC2/HC3 or wild-bootstrap intervals, which would probably improve on HC1 here, were not part of the task and were not evaluated.42
Files · main
Menu

Theme