Skip to content

Commit e8a7f91

Browse files
docs: align README / README_CN / docs/index.md to v1.0.1 for PyPI release
Replaces stale v0.9.3 headline banners and citations with v1.0.1 release messaging. Function-count claim bumped 550+ → 800+ to match the v1.0 registry size. Adds a compact release-highlights history table (v1.0.1 → v0.9.0) in docs/index.md. What changed - README.md and README_CN.md: headline section rewritten around the v1.0 stable-API release and the independent code-review pass (3 Critical + 5 High + 6 Medium + 2 Low, all fixed and pinned). - docs/index.md: "Current release" callout updated, release-highlights table expanded to cover v1.0.1 / v1.0.0 / v0.9.17 alongside v0.9.0-3. - BibTeX ``version`` field in README.md, README_CN.md, and docs/index.md bumped 0.9.3 → 1.0.1 so academic citations match. - Function count: "550+ functions" → "800+ functions". Release state after this commit - pyproject.toml / __version__ / CHANGELOG / docs all report 1.0.1. - git tag v1.0.1 already points at commit 1126f9f (the NEEDS_VERIFICATION closeout) — this commit refreshes the docs on top of that. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1126f9f commit e8a7f91

3 files changed

Lines changed: 45 additions & 43 deletions

File tree

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,23 @@
99
[![PyPI Downloads](https://static.pepy.tech/personalized-badge/statspai?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads)](https://pepy.tech/projects/statspai)
1010
[![status](https://joss.theoj.org/papers/9f1c837b1b1df7adfcdd538c3698e332/status.svg)](https://joss.theoj.org/papers/9f1c837b1b1df7adfcdd538c3698e332)
1111

12-
StatsPAI is the **agent-native** Python package for causal inference and applied econometrics. One `import`, **550+ functions**, covering the complete empirical research workflow — from classical econometrics to cutting-edge ML/AI causal methods to publication-ready tables in Word, Excel, and LaTeX.
12+
StatsPAI is the **agent-native** Python package for causal inference and applied econometrics. One `import`, **800+ functions**, covering the complete empirical research workflow — from classical econometrics to cutting-edge ML/AI causal methods to publication-ready tables in Word, Excel, and LaTeX.
1313

1414
**Designed for AI agents**: every function returns structured result objects with self-describing schemas (`list_functions()`, `describe_function()`, `function_schema()`), making StatsPAI the first econometrics toolkit purpose-built for LLM-driven research workflows — while remaining fully ergonomic for human researchers.
1515

1616
It brings R's [Causal Inference Task View](https://cran.r-project.org/web/views/CausalInference.html) (fixest, did, rdrobust, gsynth, DoubleML, MatchIt, CausalImpact, ...) and Stata's core econometrics commands into a single, consistent Python API.
1717

18-
**🎉 NEW in v0.9.3Econometric Overhaul: Stochastic Frontier + Mixed Models + GLMM Hardening + 3 New Causal Pillars**
18+
**🎉 NEW in v1.0.1Stable API release: research-frontier capstone + independent-review correctness pass**
1919

20-
Four simultaneous deep overhauls plus author-attribution correction. **⚠️ Critical correctness fix** in `sp.frontier`: a latent Jondrow posterior sign error in all prior versions produced systematically biased efficiency scores; the `dist='exponential'` path additionally returned NaN for unit efficiency. **Re-run any prior frontier analyses.**
20+
StatsPAI 1.0 is the capstone of three years of development. Semantic-versioning starts here: the public API is the set of names in `statspai.__all__` as of this tag. **Every Critical / High / Medium finding from the independent code-review-expert pass has been fixed and pinned by regression tests** — including the Katz RR SE, inverse-variance Cochran Q, PCMCI Fisher-z effective-sample-size, cluster-robust cohort-anchored DiD, TMLE regime-offset, real HDR conformal density, IPW-based EWM bridge, MVMR conditional F, BCF point/CI alignment, conformal-fair small-group fallback, and the LLM-prompt sanitization. v1.0.1 additionally closes the two `NEEDS_VERIFICATION` items with paper-grounded implementations (Abadie κ-weighted complier QTE and a real dual-path PCI bridge).
2121

22-
| Area | Highlights |
22+
| Area | v1.0 Highlights |
2323
| --- | --- |
24-
| **Stochastic Frontier** (`sp.frontier` / `sp.xtfrontier`) | Stata/R parity + more: heteroskedastic `usigma` / `vsigma` / `emean`, Battese-Coelli (1988) TE, LR mixed-χ̄² test, bootstrap unit-efficiency CIs. Panel: Pitt-Lee, BC92, BC95, Greene (2005) TFE/TRE with Dhaene-Jochmans (2015) jackknife bias correction. `vce='opg' / 'robust' / 'cluster' / 'bootstrap'`, metafrontier, conditional `predict()`, RTS. **New:** `sp.zisf` (Zero-Inefficiency SFA), `sp.lcsf` (Latent-Class SFA), `sp.malmquist` (Malmquist TFP index, M = EC × TC), `sp.translog_design` (translog helper). |
25-
| **Multilevel / Mixed-Effects** (`sp.multilevel`) | lme4/Stata `mixed` parity: unstructured random-effect covariance (new default), three-level nested models, BLUP posterior SEs, Nakagawa-Schielzeth R². **New:** `sp.melogit` / `sp.mepoisson` / `sp.meglm` (Laplace GLMMs), `sp.icc` (delta-method CI), `sp.lrtest` (Self-Liang χ̄² boundary correction). |
26-
| **GLMM hardening** (AGHQ + 3 new families) | Adaptive Gauss-Hermite quadrature via new `nAGQ` argument — `nAGQ=1` reduces exactly to Laplace (verified 1e-10), `nAGQ>1` matches Stata `intpoints(7)` / R `lme4::glmer(nAGQ=7)` accuracy on small clusters. **New families:** `sp.megamma` (Gamma GLMM with ML-estimated dispersion), `sp.menbreg` (Negative Binomial NB-2, reduces to Poisson as α → 0), `sp.meologit` (random-effects ordinal logit, Stata `meologit` / R `ordinal::clmm`). Cross-family AIC comparability: Poisson/Binomial log-likelihoods now include full normalisation constants so `mepoisson` vs `menbreg` AIC is unbiased. |
27-
| **Econometric Trinity** (P0 Pillars) | **`sp.dml(model='pliv')`** — DML Partially Linear IV (Chernozhukov et al. 2018) with cross-fitted nuisances. **`sp.mixlogit`** — Random-coefficient MNL via simulated ML with Halton draws (Python's first full implementation). **`sp.ivqreg`** — Chernozhukov-Hansen IV quantile regression via inverse-QR profile. |
28-
| **Smart workflow** | **`sp.verify`** / **`sp.verify_benchmark`** — posterior verification engine for `sp.recommend()` outputs. Aggregates bootstrap stability + placebo pass rate + subsample agreement into a `verify_score ∈ [0, 100]`. Opt-in via `recommend(verify=True)`. |
29-
30-
Multilevel, frontier, and econ-trinity passed independent oracle + code-reviewer audits (multilevel: 4 BLOCKER + 5 HIGH fixed; econ-trinity: 4 BLOCKER + 7 HIGH fixed; frontier: self-audit fixed Mills-tail, TVD-loop, cost-panel, summary-dump). Author attribution corrected to **Biaoyue Wang**.
24+
| **Three-school completion** (v0.9.17 → v1.0) | `sp.epi` (OR / RR / Mantel-Haenszel / standardization / Bradford-Hill / ROC / kappa), `sp.longitudinal` (unified MSM / g-formula / IPW dispatcher + safe regime DSL), `sp.question` (estimand-first `causal_question()` DSL with `identify → estimate → report`), full MR suite (`mr_presso`, `mr_steiger`, `mr_radial`, `mr_mode`, `mr_f_statistic`, `mr_multivariable`, `mr_mediation`, `mr_bma`), DAG `recommend_estimator()`, unified `result.sensitivity()`, `preregister()` / `load_preregister()`. |
25+
| **Research-frontier capstone** (v1.0) | **`sp.bridge`** (6 bridging theorems: DiD≡SC, EWM≡CATE, CB≡IPW, KinkRDD, DR-calib, Surrogate≡PCI). **`sp.fairness`** (Kusner counterfactual fairness + demographic-parity / eq-odds / audit). **`sp.surrogate`** (Athey-Chetty surrogate index + Ghassami 2024 + Imbens-Kallus-Mao 2026). **Time-series causal discovery** (`pcmci`, `lpcmci`, `dynotears`). **Conformal frontiers** (debiased / density-HDR / fair / multi-DP). **Proximal frontiers** (fortified / bidirectional / MTP / proxy selection). **Sequential SDID**, **BCF longitudinal**, **LTMLE survival**, **ML bounds**. |
26+
| **Target Trial Emulation flagship** | JAMA 2022 7-component protocol + **JAMA/BMJ 2025 TARGET Statement 21-item reporting checklist** auto-filled from the protocol + result pair. `target_trial_report(result, fmt='markdown'/'latex'/'target')` renders a STROBE-compatible paper block. |
27+
| **Agent-native platform** | `sp.list_functions()` / `sp.describe_function()` / `sp.function_schema()` expose OpenAI/Anthropic tool-calling schemas for 785+ registered estimators. `sp.agent.mcp_server` ships a scaffold MCP server so external LLMs can call every StatsPAI function via natural-language tool invocation. |
28+
| **Independent review transparency** | 3 Critical + 5 High + 6 Medium + 2 Low findings from code-review-expert, documented and closed in the v1.0.0 + v1.0.1 commits. 2 706+ tests passing, zero regressions across the pre-existing suite. Pinning regression tests in `tests/test_v100_review_fixes.py` and `tests/test_v101_verified_fixes.py` lock every correctness fix. |
3129

3230
**Previously in v0.9.2 — Decomposition Analysis**: **18 first-class decomposition methods across 13 modules (~6,200 LOC, 54 tests)**, unified under `sp.decompose(method=...)`. Mean (Blinder-Oaxaca/Gelbach/Fairlie/Bauer-Sinning/Yun), distributional (RIF/FFL/DFL/Machado-Mata/Melly/CFM), inequality (Theil/Atkinson/Dagum/Shapley/Lerman-Yitzhaki), demographic (Kitagawa/Das-Gupta), and causal (gap_closing/mediation_decompose/disparity_decompose). Closed-form influence functions for Theil/Atkinson, weighted O(n log n) Dagum Gini, cross-method consistency checks.
3331

@@ -970,7 +968,7 @@ pytest
970968
author={Wang, Biaoyue},
971969
year={2026},
972970
url={https://github.com/brycewang-stanford/statspai},
973-
version={0.9.3}
971+
version={1.0.1}
974972
}
975973
```
976974

README_CN.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,23 @@
99
[![PyPI Downloads](https://static.pepy.tech/personalized-badge/statspai?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads)](https://pepy.tech/projects/statspai)
1010
[![status](https://joss.theoj.org/papers/9f1c837b1b1df7adfcdd538c3698e332/status.svg)](https://joss.theoj.org/papers/9f1c837b1b1df7adfcdd538c3698e332)
1111

12-
StatsPAI 是一个**面向 AI Agent** 的 Python 因果推断与应用计量经济学工具包。一个 `import`**550+ 个函数**,覆盖从经典计量经济学到前沿 ML/AI 因果推断方法,再到论文级 Word、Excel、LaTeX 输出表格的完整实证研究流程。
12+
StatsPAI 是一个**面向 AI Agent** 的 Python 因果推断与应用计量经济学工具包。一个 `import`**800+ 个函数**,覆盖从经典计量经济学到前沿 ML/AI 因果推断方法,再到论文级 Word、Excel、LaTeX 输出表格的完整实证研究流程。
1313

1414
**为 AI Agent 而生**:每个函数都返回结构化结果对象,附带自描述 schema(`list_functions()``describe_function()``function_schema()`),使 StatsPAI 成为首个专为 LLM 驱动的研究流程设计的计量工具包——同时对人类研究者也完全友好。
1515

1616
它将 R 的 [Causal Inference Task View](https://cran.r-project.org/web/views/CausalInference.html)(fixest、did、rdrobust、gsynth、DoubleML、MatchIt、CausalImpact、sfaR、lme4、oaxaca、ddecompose……)和 Stata 的核心计量命令(`frontier``xtfrontier``mixed``meglm``mixlogit``ivqreg`……),统一到一个一致的 Python API 中。
1717

18-
**🎉 v0.9.3 新功能计量经济学大升级:随机前沿 + 混合效应 + GLMM 硬化 + 三大因果新支柱**
18+
**🎉 v1.0.1 新版本正式稳定版:研究前沿 capstone + 独立代码审查正确性修复**
1919

20-
四项同时进行的深度重写,外加作者署名更正。**⚠️ 关键正确性修复**`sp.frontier` 所有旧版本(≤ 0.9.2)存在 Jondrow 后验符号错误,导致效率分数系统性偏误;`dist='exponential'` 路径还会返回 NaN。**请重新估计此前任何前沿分析结果**
20+
StatsPAI 1.0 是三年研发的 capstone 版本。语义化版本号从这里开始:公开 API 是 `statspai.__all__` 在此 tag 时点的符号集合。**独立 code-review-expert 审查发现的全部 Critical / High / Medium 问题已全部修复并由回归测试锁死**,包括 Katz RR 标准误、逆方差加权 Cochran Q、PCMCI Fisher-z 有效样本量、cluster-robust 队列锚定 DiD、TMLE regime-offset、真正的 HDR 条件密度 conformal、基于 IPW 的 EWM bridge、MVMR 条件 F 统计量、BCF 点估计/CI 对齐、fair-conformal 小群 fallback 以及 LLM prompt 注入清洗。v1.0.1 额外关闭了两项 `NEEDS_VERIFICATION` 标记的遗留项(Abadie κ-加权 complier QTE 与真正的对偶路径 PCI bridge)
2121

22-
| 模块 | 亮点 |
22+
| 模块 | v1.0 亮点 |
2323
| --- | --- |
24-
| **随机前沿** (`sp.frontier` / `sp.xtfrontier`) | Stata/R 对标并超越:异方差 `usigma` / `vsigma` / `emean`、Battese-Coelli (1988) TE、LR 混合-χ̄² 检验、bootstrap 单位效率 CI。面板:Pitt-Lee、BC92、BC95、Greene (2005) TFE/TRE + Dhaene-Jochmans (2015) jackknife 纠偏。`vce='opg' / 'robust' / 'cluster' / 'bootstrap'`、元前沿、条件 `predict()`、规模报酬。**新增:** `sp.zisf`(零无效率 SFA)、`sp.lcsf`(潜在类 SFA)、`sp.malmquist`(Malmquist TFP 指数,M = EC × TC)、`sp.translog_design`(translog 设计矩阵助手)。 |
25-
| **多层/混合效应** (`sp.multilevel`) | lme4/Stata `mixed` 对标:随机效应协方差非约束(新默认)、三层嵌套模型、BLUP 后验 SE、Nakagawa-Schielzeth R²。**新增:** `sp.melogit` / `sp.mepoisson` / `sp.meglm`(Laplace GLMM)、`sp.icc`(delta 法 CI)、`sp.lrtest`(Self-Liang χ̄² 边界校正)。 |
26-
| **GLMM 硬化**(AGHQ + 3 个新族) | 自适应高斯-埃尔米特积分,新增 `nAGQ` 参数:`nAGQ=1` 严格退化到 Laplace(1e-10 验证),`nAGQ>1` 在小簇二元结局下匹配 Stata `intpoints(7)` / R `lme4::glmer(nAGQ=7)` 精度。**新家族:** `sp.megamma`(Gamma GLMM,ML 估计离散度)、`sp.menbreg`(负二项 NB-2,α → 0 时退化到 Poisson)、`sp.meologit`(随机效应有序 logit,K−1 阈值重参数化保证严格排序)。跨族 AIC 可比:Poisson/Binomial 似然包含完整规范化常数,`mepoisson` vs `menbreg` AIC 比较不再有偏。 |
27-
| **计量三大新支柱**(P0) | **`sp.dml(model='pliv')`** — DML 部分线性 IV(Chernozhukov et al. 2018),交叉拟合 nuisance。**`sp.mixlogit`** — 随机系数多项 logit,Halton 模拟 ML(Python 首个完整实现)。**`sp.ivqreg`** — Chernozhukov-Hansen 工具变量分位数回归,inverse-QR profile。 |
28-
| **智能工作流** | **`sp.verify`** / **`sp.verify_benchmark`**`sp.recommend()` 输出的后验验证引擎:聚合 bootstrap 稳定性 + 安慰剂通过率 + 子样本一致性,输出 `verify_score ∈ [0, 100]`。通过 `recommend(verify=True)` 开启。 |
29-
30-
**先前版本亮点:** v0.9.2 分解分析(`sp.decompose` 18 方法统一入口);v0.9.1 断点回归(18+ 估计量,14 模块);v0.9.0 合成控制(20 估计量 + 6 推断策略 + 完整研究工作流);v0.8.0 空间计量全栈(38 API 符号)。详见 [CHANGELOG](CHANGELOG.md)
24+
| **三派融合** (v0.9.17 → v1.0) | `sp.epi`(OR / RR / Mantel-Haenszel / 标准化 / Bradford-Hill / ROC / kappa)、`sp.longitudinal`(MSM / g-formula / IPW 统一调度 + 安全 regime DSL)、`sp.question`(estimand-first `causal_question()` DSL,`identify → estimate → report` 三段式)、MR 全家桶(`mr_presso``mr_steiger``mr_radial``mr_mode``mr_f_statistic``mr_multivariable``mr_mediation``mr_bma`)、DAG `recommend_estimator()`、统一 `result.sensitivity()``preregister()` / `load_preregister()` 预注册。 |
25+
| **研究前沿 capstone** (v1.0) | **`sp.bridge`**(6 个 bridging theorem:DiD≡SC、EWM≡CATE、CB≡IPW、KinkRDD、DR-calib、Surrogate≡PCI)。**`sp.fairness`**(Kusner 反事实公平性 + demographic-parity / eq-odds / 审计)。**`sp.surrogate`**(Athey-Chetty 代理指数 + Ghassami 2024 + Imbens-Kallus-Mao 2026)。**时序因果发现**`pcmci``lpcmci``dynotears`)。**conformal 前沿**(debiased / density-HDR / fair / multi-DP)。**proximal 前沿**(fortified / bidirectional / MTP / proxy selection)。**Sequential SDID****BCF 纵向****LTMLE 生存****ML bounds**|
26+
| **Target Trial Emulation flagship** | JAMA 2022 7-component protocol + **JAMA/BMJ 2025 TARGET Statement 21-item 报告清单**从 protocol+result 自动填充。`target_trial_report(result, fmt='markdown'/'latex'/'target')` 生成 STROBE 合规的论文 Methods + Results 段落。 |
27+
| **Agent-native 平台** | `sp.list_functions()` / `sp.describe_function()` / `sp.function_schema()` 为 785+ 个已注册的估计量提供 OpenAI/Anthropic tool-calling schema。`sp.agent.mcp_server` 提供 MCP 服务器脚手架,外部 LLM 可通过自然语言工具调用每个 StatsPAI 函数。 |
28+
| **独立审查透明度** | 3 Critical + 5 High + 6 Medium + 2 Low 全部记录并在 v1.0.0 + v1.0.1 commits 中闭环。**2 706+ 测试全部通过,已有测试零回归**。所有正确性修复均由 `tests/test_v100_review_fixes.py``tests/test_v101_verified_fixes.py` pinning 回归测试锁死。 |
3129

3230
**v0.6 新功能**`sp.interactive(fig)` —— 类似 Stata Graph Editor 的 WYSIWYG 图表编辑器,支持 29 种学术主题、实时预览、自动生成可复现代码。
3331

@@ -364,7 +362,7 @@ pytest
364362
author={Wang, Biaoyue},
365363
year={2026},
366364
url={https://github.com/brycewang-stanford/statspai},
367-
version={0.9.3}
365+
version={1.0.1}
368366
}
369367
```
370368

0 commit comments

Comments
 (0)