Skip to content

Commit 2d8ae3e

Browse files
docs: update README + CHANGELOG for v0.8.0 release
- README: add v0.8.0 headline, update API-at-a-Glance with all new modules (spatial 38 symbols, time series, discovery, matching, etc.), update comparison table (spatial no longer an R advantage), add spatial row to pain-point table - CHANGELOG: full v0.8.0 release notes covering all 10 sub-projects - Fix function count: 390+ → 450+ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c36362d commit 2d8ae3e

2 files changed

Lines changed: 146 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,69 @@
22

33
All notable changes to StatsPAI will be documented in this file.
44

5+
## [0.8.0] - 2026-04-16
6+
7+
### Spatial Econometrics Full-Stack + 10-Domain Breadth Upgrade
8+
9+
**Largest release in StatsPAI history. 60+ new functions across 10 domains.**
10+
11+
#### Spatial Econometrics (NEW — 38 API symbols)
12+
13+
From 3 functions / 419 LOC to **38 functions / 3,178 LOC / 69 tests**. Python's first unified spatial econometrics package.
14+
15+
- **Weights (L1)**: `W` (sparse CSR), `queen_weights`, `rook_weights`, `knn_weights`, `distance_band`, `kernel_weights`, `block_weights`
16+
- **ESDA (L2)**: `moran` (global + local), `geary`, `getis_ord_g`, `getis_ord_local`, `join_counts`, `moran_plot`, `lisa_cluster_map`
17+
- **ML Regression (L3)**: `sar`, `sem`, `sdm`, `slx`, `sac` — sparse-backed, dual log-det path (exact + Barry-Pace), scales to N=100K
18+
- **GMM (L3)**: `sar_gmm`, `sem_gmm`, `sarar_gmm` — Kelejian-Prucha (1998/1999), heteroskedasticity-robust
19+
- **Diagnostics**: `lm_tests` (Anselin 1988 full battery), `moran_residuals`
20+
- **Effects**: `impacts` (LeSage-Pace 2009 direct/indirect/total + simulated SE)
21+
- **GWR (L4)**: `gwr`, `mgwr` (Multiscale GWR), `gwr_bandwidth` (AICc/CV golden-section)
22+
- **Spatial Panel (L5)**: `spatial_panel` (SAR-FE / SEM-FE / SDM-FE, entity + twoways)
23+
- **Cross-validated**: Columbus rtol<1e-7 vs PySAL spreg 1.9.0; Georgia GWR bit-identical vs mgwr 2.2.1; GMM rtol<1e-4 vs spreg GM_*
24+
25+
#### Time Series
26+
27+
- `local_projections` — Jordà (2005) IRF with Newey-West HAC
28+
- `garch` — GARCH(p,q) MLE with multi-step forecast
29+
- `arima` — ARIMA/SARIMAX with auto (p,d,q) AICc grid search
30+
- `bvar` — Bayesian VAR with Minnesota (Litterman) prior
31+
32+
#### Causal Discovery
33+
34+
- `lingam` — DirectLiNGAM (Shimizu 2011), bit-identical vs lingam package
35+
- `ges` — Greedy Equivalence Search (Chickering 2002)
36+
37+
#### Matching
38+
39+
- `optimal_match` — Hungarian 1:1 matching (min total Mahalanobis distance)
40+
- `cardinality_match` — Zubizarreta (2014) LP-based matching with balance constraints
41+
42+
#### Decomposition & Mediation
43+
44+
- `rifreg` — RIF regression (Firpo-Fortin-Lemieux 2009)
45+
- `rif_decomposition` — RIF Oaxaca-Blinder for distributional statistics
46+
- `mediate_sensitivity` — Imai-Keele-Yamamoto (2010) ρ-sensitivity
47+
48+
#### RD & Survey
49+
50+
- `rdpower`, `rdsampsi` — power/sample-size for RD designs
51+
- `rake`, `linear_calibration` — survey calibration (Deville-Särndal 1992)
52+
53+
#### Survival
54+
55+
- `cox_frailty` — Cox with shared gamma frailty (Therneau-Grambsch)
56+
- `aft` — Accelerated Failure Time (exponential/Weibull/lognormal/loglogistic)
57+
58+
#### ML-Causal (GRF)
59+
60+
- `CausalForest.variable_importance()`, `.best_linear_projection()`, `.ate()`, `.att()`
61+
- **Bugfix**: honest leaf values now correctly vary per-leaf
62+
63+
#### Infrastructure
64+
65+
- OLS/IV `predict(data, what='confidence'|'prediction')` with intervals
66+
- Pre-release code review: 3 critical + 2 high-priority bugs fixed
67+
568
## [0.7.1] - 2026-04-15
669

770
DID-focused polish release. Brings the Wooldridge (2021) ETWFE

README.md

Lines changed: 83 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ StatsPAI is the **agent-native** Python package for causal inference and applied
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.6**: `sp.interactive(fig)` — a Stata Graph Editor-style WYSIWYG plot editor for Jupyter, with 29 academic themes, real-time preview, and auto-generated reproducible code.
18+
**NEW in v0.8.0**: **Spatial Econometrics Full-Stack** — 38 new API symbols covering weights, ESDA, ML/GMM regression, GWR/MGWR, and spatial panel. Plus: local projections, GARCH, ARIMA, BVAR, LiNGAM, GES, optimal matching, cardinality matching, RIF decomposition, mediation sensitivity, Cox frailty, AFT survival, rdpower, survey calibration. **60+ new functions across 10 domains.**
1919

2020
![StatsPAI interactive plot editor](https://raw.githubusercontent.com/brycewang-stanford/statspai/main/image-1.png)
2121

@@ -33,7 +33,8 @@ It brings R's [Causal Inference Task View](https://cran.r-project.org/web/views/
3333
| Heterogeneity analysis | Manual subgroup splits + forest plots | Manual `lapply` + `ggplot` | **`subgroup_analysis()` with Wald test** |
3434
| Modern ML causal | Limited (no DML, no causal forest) | Fragmented (DoubleML, grf, SuperLearner separate) | **DML, Causal Forest, Meta-Learners, TMLE, DeepIV** |
3535
| Neural causal models | None | None | **TARNet, CFRNet, DragonNet** |
36-
| Causal discovery | None | `pcalg` (complex API) | **`notears()`, `pc_algorithm()`** |
36+
| Causal discovery | None | `pcalg` (complex API) | **`notears()`, `pc_algorithm()`, `lingam()`, `ges()`** |
37+
| Spatial econometrics | None | 5 packages (spdep+spatialreg+sphet+splm+GWmodel) | **38 functions: weights→ESDA→ML/GMM→GWR/MGWR→panel** |
3738
| Policy learning | None | `policytree` (standalone) | **`policy_tree()` + `policy_value()`** |
3839
| Result objects | Inconsistent across commands | Inconsistent across packages | **Unified `CausalResult` with `.summary()`, `.plot()`, `.to_latex()`, `.cite()`** |
3940
| Interactive plot editing | Graph Editor (no code export) | None | **`sp.interactive()` — GUI editing with auto-generated code** |
@@ -545,14 +546,14 @@ sp.subgroup_analysis(df, formula="wage ~ education + experience",
545546
| **`ggplot2` visualization** | R's grammar of graphics is more flexible than matplotlib for complex figures. |
546547
| **`modelsummary`** | R's `modelsummary` is the gold standard for regression tables — StatsPAI's is close but not yet identical. |
547548
| **CRAN quality control** | R packages go through peer review. Python packages vary in quality. |
548-
| **Spatial econometrics** | `spdep`, `spatialreg`R has a deeper spatial ecosystem. |
549+
| **Spatial econometrics** | ~~`spdep`, `spatialreg`~~**As of v0.8.0, StatsPAI matches R's 5-package spatial stack** (spdep + spatialreg + sphet + splm + GWmodel) in a single unified API, with numerical parity to PySAL spreg at rtol<1e-7 on the Columbus benchmark. |
549550

550551
---
551552

552553
## API at a Glance
553554

554555
```text
555-
390+ public functions/classes
556+
450+ public functions/classes
556557
557558
Regression: regress, ivreg, glm, logit, probit, mlogit, ologit, poisson, nbreg, ppmlhdfe,
558559
tobit, heckman, qreg, truncreg, fracreg, betareg, sureg, three_sls, gmm
@@ -565,16 +566,26 @@ Matching: match, ebalance, ipw, aipw
565566
Synth: synth, sdid, gsynth, augsynth, staggered_synth, conformal_synth
566567
ML Causal: dml, causal_forest, deepiv, metalearner, tmle
567568
Neural: tarnet, cfrnet, dragonnet
568-
Discovery: notears, pc_algorithm
569+
Spatial: sar, sem, sdm, slx, sac, sar_gmm, sem_gmm, sarar_gmm, ← NEW v0.8
570+
moran, geary, getis_ord_g, join_counts, lm_tests, impacts,
571+
gwr, mgwr, gwr_bandwidth, spatial_panel,
572+
queen_weights, rook_weights, knn_weights, distance_band, kernel_weights
573+
Discovery: notears, pc_algorithm, lingam, ges ← NEW v0.8
569574
Policy: policy_tree, policy_value
570-
Survival: cox, kaplan_meier, survreg, logrank_test
571-
Time Series: var, granger_causality, irf, structural_break, johansen, engle_granger
575+
Survival: cox, kaplan_meier, survreg, logrank_test, cox_frailty, aft ← NEW v0.8
576+
Time Series: var, granger_causality, irf, structural_break, johansen,
577+
local_projections, garch, arima, bvar ← NEW v0.8
572578
Nonparametric: lpoly, kdensity
573579
Experimental: randomize, balance_check, attrition_test, optimal_design
580+
Matching: match, ebalance, optimal_match, cardinality_match ← NEW v0.8
581+
Decomposition: oaxaca, gelbach, rifreg, rif_decomposition ← NEW v0.8
574582
Imputation: mice, mi_estimate
575583
Frontier: frontier (stochastic frontier analysis)
576584
Structural: blp (BLP demand estimation)
585+
Survey: svydesign, svymean, svytotal, svyglm, rake, linear_calibration ← NEW v0.8
577586
MR: mendelian_randomization, mr_ivw, mr_egger, mr_median
587+
Mediation: mediate, mediate_sensitivity ← NEW v0.8
588+
RD: rdrobust, rdplot, rddensity, rdmc, rdms, rdpower, rdsampsi ← NEW v0.8
578589
Smart Workflow: recommend, compare_estimators, assumption_audit,
579590
sensitivity_dashboard, pub_ready, replicate
580591
Output: modelsummary, outreg2, sumstats, balance_table, tab, coefplot, binscatter
@@ -585,6 +596,71 @@ Plot Editor: interactive (WYSIWYG editor), set_theme (29 academic themes)
585596

586597
## Release Notes
587598

599+
### v0.8.0 (2026-04-16) — Spatial Econometrics Full-Stack + 10-Domain Breadth Upgrade
600+
601+
**60+ new functions, 450+ total API, 1,230+ tests passing. Largest release in StatsPAI history.**
602+
603+
**Spatial Econometrics (NEW — 38 API symbols, 3,178 LOC, 69 tests):**
604+
605+
- **Weights**: `W` (sparse CSR), `queen_weights`, `rook_weights`, `knn_weights`, `distance_band`, `kernel_weights`, `block_weights`
606+
- **ESDA**: `moran` (global + local LISA), `geary`, `getis_ord_g`, `getis_ord_local`, `join_counts`, `moran_plot`, `lisa_cluster_map`
607+
- **ML Regression**: `sar`, `sem`, `sdm`, `slx`, `sac` (SARAR) — sparse-aware, scales to N=100K
608+
- **GMM Regression**: `sar_gmm`, `sem_gmm`, `sarar_gmm` (Kelejian-Prucha 1998/1999, het-robust)
609+
- **Diagnostics**: `lm_tests` (Anselin 1988 — LM-err/LM-lag/Robust-LM/SARMA), `moran_residuals`
610+
- **Effects**: `impacts` (LeSage-Pace 2009 direct/indirect/total with simulated SE)
611+
- **GWR**: `gwr`, `mgwr` (Multiscale GWR), `gwr_bandwidth` (AICc/CV golden-section)
612+
- **Spatial Panel**: `spatial_panel` (SAR-FE / SEM-FE / SDM-FE, entity + twoways)
613+
- **Cross-validated**: Columbus SAR/SEM rtol<1e-7 vs PySAL spreg; Georgia GWR bit-identical vs mgwr
614+
615+
**Time Series (4 new estimators):**
616+
617+
- `local_projections` — Jordà (2005) horizon-by-horizon IRF with Newey-West HAC
618+
- `garch` — GARCH(p,q) volatility model, MLE, multi-step forecast
619+
- `arima` — ARIMA/SARIMAX with auto (p,d,q) selection via AICc grid
620+
- `bvar` — Bayesian VAR with Minnesota (Litterman) prior, closed-form posterior
621+
622+
**Causal Discovery (2 new algorithms):**
623+
624+
- `lingam` — DirectLiNGAM (Shimizu 2011), bit-identical match vs lingam package
625+
- `ges` — Greedy Equivalence Search (Chickering 2002), BIC-based CPDAG learning
626+
627+
**Matching (2 new methods):**
628+
629+
- `optimal_match` — global 1:1 matching via Hungarian algorithm (min total Mahalanobis distance)
630+
- `cardinality_match` — Zubizarreta (2014) LP-based matching with SMD balance constraints
631+
632+
**Decomposition & Mediation:**
633+
634+
- `rifreg` — RIF regression (Firpo-Fortin-Lemieux 2009), unconditional quantile partial effects
635+
- `rif_decomposition` — RIF Oaxaca-Blinder for distributional statistics
636+
- `mediate_sensitivity` — Imai-Keele-Yamamoto (2010) ρ-sensitivity analysis
637+
638+
**RD & Design:**
639+
640+
- `rdpower`, `rdsampsi` — power calculations for RD designs (Cattaneo et al. 2019)
641+
642+
**Survey:**
643+
644+
- `rake` — iterative proportional fitting (Deming-Stephan) for survey calibration
645+
- `linear_calibration` — Deville-Särndal (1992) chi-squared distance calibration
646+
647+
**Survival (2 new models):**
648+
649+
- `cox_frailty` — Cox proportional hazards with shared gamma frailty
650+
- `aft` — Accelerated Failure Time (exponential/Weibull/lognormal/loglogistic)
651+
652+
**ML-Causal (GRF extensions):**
653+
654+
- `CausalForest.variable_importance()` — permutation-based feature importance for CATE
655+
- `CausalForest.best_linear_projection()` — BLP heterogeneity test (Chernozhukov et al. 2020)
656+
- `CausalForest.ate()`, `.att()` — convenience accessors
657+
- **Bugfix**: honest leaf values now correctly vary per-leaf (was overwriting all leaves)
658+
659+
**Infrastructure:**
660+
661+
- OLS/IV `predict(data, what='confidence'|'prediction')` — out-of-sample with intervals
662+
- Pre-release code review: 3 critical + 2 high-priority bugs fixed before release
663+
588664
### v0.6.0 (2026-04-05) — Complete Econometrics Toolkit + Smart Workflow Engine
589665

590666
**30 new modules, 390+ public API, 860+ tests passing, 83K+ lines of code.**

0 commit comments

Comments
 (0)