SPB Git

spb/wp29_uqo

Public

# F2-conf-03 — Monte Carlo coverage of OLS confidence intervals in a small heteroskedastic sample

# Scientific question

How well do nominal 95% confidence intervals for an OLS slope perform in a small sample with heteroskedastic errors? Consider the fixed-design linear model y_i = α + β x_i + σ_i ε_i, i = 1, …, 30, with α = 1, β = 0.5, ε_i independent standard normal, and x_i and σ_i fixed at the values given in data/design.csv (the same 30 values in every replication; only ε is redrawn). The estimands are (a) the true coverage probability of the interval β̂ ± t_{0.975}(28) · se_conv, where se_conv is the conventional OLS standard error (residual variance with divisor n − 2); (b) the true coverage probability of the interval β̂ ± t_{0.975}(28) · se_HC1, where se_HC1 is the heteroskedasticity-robust HC1 standard error (White's HC0 sandwich multiplied by n/(n − 2)); (c) the exact finite-sample standard deviation of β̂ under this design; (d) the expected value of se_conv. Estimate (a), (b) and (d) by Monte Carlo with exactly R = 2000 replications and a fixed seed, compute (c) analytically, and conclude whether the conventional interval attains its nominal coverage.

# Inputs

  • data/design.csv — the fixed design (a synthetic design generated for this exercise; not observed data). Columns: i (observation index 1–30), x (regressor value, dimensionless), sigma (standard deviation of the error for observation i, dimensionless). 30 rows.

# Information-availability rules

  • Use only data/design.csv; the model constants (α = 1, β = 0.5, n = 30, R = 2000, nominal level 95%, t(28) critical value) are given above. Do not redraw x or σ.

# Required outputs

  • out/results.json with the keys:
key type unit meaning
task_id string – "F2-conf-03"
coverage_conventional number proportion share of the 2000 replications in which the conventional interval contains β = 0.5 — the naïve baseline
coverage_hc1 number proportion share of the 2000 replications in which the HC1 interval contains β = 0.5
sd_beta_exact number – exact standard deviation of β̂ under the design (analytical, no simulation)
sd_beta_mc number – sample standard deviation (divisor R − 1) of the 2000 simulated β̂
mean_se_conventional number – average of se_conv over the 2000 replications
conventional_ci_undercovers boolean – true if and only if coverage_conventional is below 0.95 by more than three Monte Carlo standard errors (binomial standard error at R = 2000)
n_replications integer – number of replications (2000)
n_obs_per_replication integer – sample size per replication (30)
feasibility string – "complete", "partial" or "infeasible"
feasibility_reason string or null – explanation if not complete
data_issues array of {"issue","handling"} – data problems detected and how handled (empty list if none)
n_input_rows object – {"design.csv": rows read}
random_seed integer – the seed used for the simulation (required; the simulation must be reproducible)
  • out/report.md with the sections: Question; Data and exclusions; Method; Results; Uncertainty (include the Monte Carlo standard error of each coverage estimate); Limitations and open issues.
  • out/analysis.py — running ~/wp29/venv/bin/python out/analysis.py from the workspace root must regenerate out/results.json from data/ only, deterministically (same seed, same numbers).
  • out/claims.json — a list of the central claims of the report: [{"id": "C1", "text": "...", "results_keys": ["..."], "status": "supported"|"unsupported"|"not_evaluated", "caveat": "..."}]. Include one claim about whether the conventional interval attains its nominal coverage.

# Constraints

  • No network access. Python: ~/wp29/venv/bin/python (numpy, pandas, scipy, statsmodels available). Do not modify data/.
  • This task is designed to be completed in well under 15 minutes of work; the simulation itself should take seconds.
Files · 452964ee0fbbaa40fbbed2c87a54ca798ffd6a85
Menu

Theme