SPB Git

spb/wp29_uqo

Public
4.4 KB · 55 lines markdown
1# F2-conf-03 — Coverage of OLS slope confidence intervals under heteroskedasticity23## Question4In the fixed-design model y_i = 1 + 0.5 x_i + σ_i ε_i (n = 30, with x_i and σ_i from `data/design.csv` and ε_i iid N(0,1)), do nominal 95% intervals β̂ ± t_0.975(28)·se cover β = 0.5 with probability 0.95? The question is asked for (i) the conventional OLS standard error and (ii) the HC1 robust standard error.56## Data and exclusions7The only input is `data/design.csv`: 30 rows, columns i, x, sigma. Its SHA-256 matches the bundle manifest. It has no missing values and no duplicate rows, and every σ is positive (`n_input_rows`). No rows were excluded (`out/exclusions.csv`: 30 → 30), and no data issues were found (`data_issues` = []). σ_i is largest at the extreme x values, so the heteroskedasticity sits on the high-leverage points. Full audit: `out/state/data_audit.md`.89## Method10- **Exact SD of β̂ (computed analytically):** sqrt(Σ w_i² σ_i²), with w_i = (x_i − x̄)/S_xx. I confirmed it against the sandwich matrix formula.11- **Monte Carlo:** R = 2000 replications (`n_replications`), n = 30 (`n_obs_per_replication`), numpy `default_rng` with seed 20261030 (`random_seed`). Only ε is redrawn; x and σ are held fixed.12- **Standard errors in each replication:**13  - se_conv = sqrt(s²/S_xx), where s² uses divisor n − 2.14  - se_HC1 = sqrt(n/(n−2) · Σ(x_i−x̄)² e_i² / S_xx²).15- **Critical value:** t_0.975(28) = 2.0484 (`t_crit_28`).16- **Coverage:** the share of replications with |β̂ − 0.5| ≤ t·se.17- **Undercoverage decision:** the conventional interval is declared to undercover if 0.95 − coverage > 3 × sqrt(0.95·0.05/2000). This uses the binomial MC standard error at the nominal level (`mcse_at_nominal` = 0.00487), which gives a threshold of 0.9354 (`undercoverage_threshold`).18- **Baseline:** the conventional interval is the naïve baseline.19- **Cross-check:** statsmodels OLS/HC1 on the same draws reproduced every number exactly.2021## Results22| quantity | value | key |23|---|---|---|24| Coverage, conventional interval | 0.844 | `coverage_conventional` |25| Coverage, HC1 interval | 0.902 | `coverage_hc1` |26| Exact SD of β̂ | 0.2680 | `sd_beta_exact` |27| MC SD of β̂ | 0.2696 | `sd_beta_mc` |28| Mean se_conv | 0.1903 | `mean_se_conventional` |29| Mean se_HC1 | 0.2408 | `mean_se_hc1` |30| Mean β̂ | 0.4962 | `mean_bhat_mc` |31| Conventional CI undercovers | true | `conventional_ci_undercovers` |3233**The conventional interval does not reach its nominal 95% coverage.**34- Its coverage of 0.844 is about 10.6 points below 0.95, far beyond the three-MC-SE threshold of 0.9354.35- On average, se_conv (0.190) understates the true sampling SD (0.268) by about 29%. Its mean is close to the homoskedastic-formula SD (0.196, `sd_beta_homoskedastic_formula`), which ignores the fact that error variance is concentrated at high-leverage x.3637**HC1 helps but also undercovers in this small sample.**38- HC1 coverage is 0.902 and its mean SE is 0.241. Both are better than the conventional interval but still below nominal.39- No formal three-SE test was specified for HC1. Even so, 0.902 is about 7 binomial MC SEs at the estimate (≈ 0.0066) below 0.95.4041The MC SD of β̂ agrees with the exact SD (z ≈ 0.39), and mean β̂ is consistent with unbiasedness (`out/state/checks.md`).4243## Uncertainty44- **Conventional coverage:** MC standard error at the estimate is sqrt(p(1−p)/R) = 0.0081 (`mcse_coverage_conventional`), giving an approximate 95% MC interval of 0.828–0.860.45- **HC1 coverage:** MC standard error is 0.0066 (`mcse_coverage_hc1`), giving an approximate interval of 0.889–0.915.46- **At the nominal level:** the MC SE is 0.0049 (`mcse_at_nominal`).47- **SD estimate:** sd_beta_mc has a sampling SE of about sd/sqrt(2(R−1)) ≈ 0.0042.48- **Other sources:** the results depend on the single seed 20261030. Under the stated model the analytic SD has no uncertainty.4950## Limitations and open issues51- The results apply only to this specific synthetic design (n = 30, these x and σ) with normal errors. They should not be generalised to other designs or error distributions.52- I used one seed and R = 2000, as the task specifies. Coverage figures are therefore accurate only to about ±0.016 (2 MC SEs).53- The undercoverage rule uses the binomial SE at the nominal 0.95. Using the SE at the estimate (0.0081) gives the same conclusion.54- Small-sample HC variants (HC2, HC3, wild bootstrap) were outside scope and were not evaluated.55
Files · main
Menu

Theme