SPB Git

spb/wp29_uqo

Public
4.1 KB · 39 lines markdown
1# F2-conf-03 — Monte Carlo coverage of OLS confidence intervals in a small heteroskedastic sample23## Scientific question4How 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.56## Inputs7- `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.89## Information-availability rules10- 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 σ.1112## Required outputs13- `out/results.json` with the keys:1415| key | type | unit | meaning |16|---|---|---|---|17| `task_id` | string | – | "F2-conf-03" |18| `coverage_conventional` | number | proportion | share of the 2000 replications in which the conventional interval contains β = 0.5 — the naïve baseline |19| `coverage_hc1` | number | proportion | share of the 2000 replications in which the HC1 interval contains β = 0.5 |20| `sd_beta_exact` | number | – | exact standard deviation of β̂ under the design (analytical, no simulation) |21| `sd_beta_mc` | number | – | sample standard deviation (divisor R − 1) of the 2000 simulated β̂ |22| `mean_se_conventional` | number | – | average of se_conv over the 2000 replications |23| `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) |24| `n_replications` | integer | – | number of replications (2000) |25| `n_obs_per_replication` | integer | – | sample size per replication (30) |26| `feasibility` | string | – | "complete", "partial" or "infeasible" |27| `feasibility_reason` | string or null | – | explanation if not complete |28| `data_issues` | array of {"issue","handling"} | – | data problems detected and how handled (empty list if none) |29| `n_input_rows` | object | – | {"design.csv": rows read} |30| `random_seed` | integer | – | the seed used for the simulation (required; the simulation must be reproducible) |3132- `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.33- `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).34- `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.3536## Constraints37- No network access. Python: `~/wp29/venv/bin/python` (numpy, pandas, scipy, statsmodels available). Do not modify `data/`.38- This task is designed to be completed in well under 15 minutes of work; the simulation itself should take seconds.39
Files · 55b92f9bcc679fb8bcbc12d51e0b6519e7f8b07d
Menu

Theme