|
2 | 2 |
|
3 | 3 | All notable changes to StatsPAI will be documented in this file. |
4 | 4 |
|
| 5 | +## [1.3.0] — 2026-04-21 — v3-frontier sprint (Sprint 1 of the 知识地图 v3 roadmap) |
| 6 | + |
| 7 | +Builds on top of the v1.2.0 doc-alignment work by implementing the |
| 8 | +eleven highest-leverage frontier methods identified in the 2026-04-20 |
| 9 | +*Causal-Inference Method Family 万字剖析 v3* gap analysis. Every new |
| 10 | +public function is wired into the registry + agent schema so it |
| 11 | +surfaces through `sp.list_functions`, `sp.describe_function`, and |
| 12 | +`sp.all_schemas` for LLM agents. |
| 13 | + |
| 14 | +### Added — P0 frontier (4 methods, within-sprint week 1) |
| 15 | + |
| 16 | +- **`sp.synth_experimental_design`** — Abadie & Zhao (2025/2026) |
| 17 | + inverse synthetic controls: picks the best ``k`` candidate units to |
| 18 | + treat by minimising the sum of per-unit pre-period SC MSPEs. |
| 19 | + Produces a ranking table, recommended treatment assignment, and a |
| 20 | + variance-gain benchmark against random allocation. |
| 21 | + [`synth/experimental_design.py`] |
| 22 | + |
| 23 | +- **`sp.rdrobust(..., bootstrap='rbc', n_boot=999, random_state=...)`** |
| 24 | + — Cattaneo, Jansson & Ma (arXiv:2512.00566, 2026) robust-bias-corrected |
| 25 | + studentised percentile bootstrap. Empirically delivers CIs ~3–15% |
| 26 | + shorter than the analytic robust CI without sacrificing coverage. |
| 27 | + New ``model_info['rbc_bootstrap']`` block exposes the CI, p-value, |
| 28 | + length-ratio, and effective replicate count. |
| 29 | + |
| 30 | +- **`sp.fairness.evidence_without_injustice`** — Kwak & Pleasants |
| 31 | + (arXiv:2510.12822, 2025) counterfactual-fairness test that freezes |
| 32 | + admissible-evidence features at their factual values and tests |
| 33 | + whether predictions still change under ``do(A = a')``. Returns a |
| 34 | + bootstrap CI, p-value, and per-alternative breakdown. |
| 35 | + [`fairness/evidence_test.py`] |
| 36 | + |
| 37 | +- **`sp.target_trial.to_paper(..., fmt='jama' | 'bmj')`** — renders a |
| 38 | + JAMA / BMJ-ready manuscript with all 21 TARGET Statement (JAMA/BMJ |
| 39 | + 2025-09) items auto-filled where derivable plus `(supply text)` |
| 40 | + placeholders elsewhere. Supports `authors`, `funding`, |
| 41 | + `registration`, `data_availability`, `background`, `limitations` |
| 42 | + keyword arguments. |
| 43 | + |
| 44 | +### Added — P1 frontier (4 methods, within-sprint week 2) |
| 45 | + |
| 46 | +- **`sp.harvest_did`** — Borusyak et al. MIT/NBER WP 34550 (2025) |
| 47 | + Harvesting DID + event-study framework: extracts every valid 2×2 |
| 48 | + DID comparison from a staggered panel, combines them via |
| 49 | + inverse-variance weights, and reports event-study + pretrend Wald |
| 50 | + tests. Uses a not-yet-treated-at-max(t₁, t₂) clean-control filter |
| 51 | + that correctly handles placebo horizons. [`did/harvest.py`] |
| 52 | + |
| 53 | +- **`sp.bcf_ordinal`** — Zorzetto et al. (2026) BCF for ordered / dose |
| 54 | + treatments. Chains pairwise binary BCF between consecutive levels |
| 55 | + to yield cumulative dose-response CATEs with per-level ATEs. |
| 56 | + [`bcf/ordinal.py`] |
| 57 | + |
| 58 | +- **`sp.bcf_factor_exposure`** — arXiv:2601.16595 (2026) BCF on |
| 59 | + PCA-factor scores of a high-dimensional exposure vector. SVD or |
| 60 | + user-supplied loadings compress the exposure to ``K`` factors; one |
| 61 | + BCF is fit per factor. Returns per-factor ATEs, loadings, scores, |
| 62 | + and an aggregate mixture-ATE with CI. [`bcf/factor_exposure.py`] |
| 63 | + |
| 64 | +- **`sp.causal_llm.causal_mas`** — arXiv:2509.00987 (2025/09) multi- |
| 65 | + agent causal discovery framework. Runs proposer / critic / |
| 66 | + domain-expert / synthesiser agents over several debate rounds with |
| 67 | + per-edge confidence scores and a full auditable transcript. |
| 68 | + Offline heuristic backend by default; accepts any |
| 69 | + ``chat(role, prompt)`` / ``complete(prompt)`` LLM client. |
| 70 | + [`causal_llm/causal_mas.py`] |
| 71 | + |
| 72 | +- **`sp.shift_share_political`** — Park & Xu (arXiv:2603.00135, 2026) |
| 73 | + political-science variant of the Bartik IV. Long-difference 2SLS |
| 74 | + with AKM shock-cluster SEs, Rotemberg top-K diagnostic, and |
| 75 | + share-balance F-test against pre-treatment covariates. |
| 76 | + [`bartik/political.py`] |
| 77 | + |
| 78 | +### Added — P2 frontier + testing (2 methods + 2 test suites) |
| 79 | + |
| 80 | +- **`sp.assimilation.causal_kalman`**, |
| 81 | + **`sp.assimilation.assimilative_causal`** — |
| 82 | + *Assimilative Causal Inference* (Nature Communications 2026): a |
| 83 | + Kalman filter over streaming causal-effect estimates. Produces a |
| 84 | + running posterior with effective-sample-size diagnostics, pluggable |
| 85 | + dynamics (static or random-walk), and an end-to-end wrapper that |
| 86 | + runs a user-supplied per-batch estimator. New subpackage |
| 87 | + [`assimilation/`]. |
| 88 | + |
| 89 | +- **`tests/reference_parity/test_mr_parity.py`** — 7 analytic-truth |
| 90 | + checks over the MR suite (IVW consistency, Egger intercept under |
| 91 | + balanced pleiotropy, Egger directional-pleiotropy detection, |
| 92 | + weighted-median robustness, PRESSO outlier flag, LOO stability, |
| 93 | + Radial-Wald exact agreement). All 7 pass. |
| 94 | + |
| 95 | +- **`tests/external_parity/test_causalml_book.py`** — 7 CausalMLBook |
| 96 | + (Chernozhukov et al. 2024–2025) canonical-DGP checks: DML-PLR, |
| 97 | + Causal Forest, T-learner, 2SLS, Callaway–Sant'Anna DID, rdrobust, |
| 98 | + and rbc-bootstrap vs analytic parity. All 7 pass. |
| 99 | + |
| 100 | +### Registry + agent schema |
| 101 | + |
| 102 | +- 9 hand-written `FunctionSpec` entries for every new public function: |
| 103 | + `synth_experimental_design`, `evidence_without_injustice`, |
| 104 | + `harvest_did`, `bcf_ordinal`, `bcf_factor_exposure`, `causal_mas`, |
| 105 | + `shift_share_political`, `causal_kalman`, `assimilative_causal`. |
| 106 | + Each entry ships with NumPy-style parameter docs, examples, tags, |
| 107 | + and paper references for LLM-agent consumption. |
| 108 | + |
| 109 | +### Backwards compatibility |
| 110 | + |
| 111 | +- All v1.2.x public APIs remain stable. The only changes to existing |
| 112 | + signatures are additive kwargs: |
| 113 | + - `sp.rdrobust` — `bootstrap`, `n_boot`, `random_state` |
| 114 | + - `sp.target_trial.to_paper` — `journal`, `authors`, `funding`, |
| 115 | + `registration`, `data_availability`, `background`, `limitations` |
| 116 | + |
5 | 117 | ## [1.2.0] — 2026-04-21 — Doc-alignment sprint (v3 reference document) |
6 | 118 |
|
7 | 119 | Closes the remaining gaps between the *Causal-Inference Method Family |
@@ -89,6 +201,14 @@ parameter docs, examples, references, and tags. |
89 | 201 | being multiplied 42× by an implicit string-concat × `"=" * 42` |
90 | 202 | precedence bug (`"title\n" "=" * 42` parsed as |
91 | 203 | `("title\n" + "=") * 42`). Replaced with explicit f-string concatenation. |
| 204 | +- `question.CausalQuestion.save` — added `TYPE_CHECKING` import for |
| 205 | + `pathlib.Path` so the stringified return annotation stops tripping |
| 206 | + `flake8 F821` in CI. |
| 207 | +- Added `tabulate>=0.9.0` to core dependencies. `pandas.to_markdown()` |
| 208 | + dispatches to `tabulate`, which was previously a pandas-optional |
| 209 | + dep; user-facing `sp.causal(...).report('markdown' | 'html')` |
| 210 | + triggered an `ImportError` on systems (Windows, fresh envs) that |
| 211 | + didn't happen to transitively install `tabulate`. |
92 | 212 |
|
93 | 213 | ### Test coverage |
94 | 214 |
|
|
0 commit comments