Open Family Office Datasets Tickers Strategies Portfolios Research Posts About Changelog

statsmodels: Econometric and Statistical Modeling with Python

Source

Citation. Skipper Seabold and Josef Perktold. "Statsmodels: Econometric and Statistical Modeling with Python". Proceedings of the 9th Python in Science Conference (SciPy 2010), pp. 92–96. doi.org/10.25080/Majora-92bf1922-011. CC BY. The library: statsmodels.org, version 0.15.0, released 27 August 2026. Source: github.com/statsmodels/statsmodels, BSD 3-clause licence. It needs NumPy, SciPy, pandas and patsy.

Status. Used. The maintainer chose statsmodels as a core dependency (#315). open_familyoffice/econometrics.py wraps it with guards against look-ahead. It refits on an expanding window, its Granger tests name the cause, and its regimes are filtered only. A test fails if any module imports a two-sided smoother. The evaluator's own tests stay in the project's code.

Read. Read on 2026-11-28 through a subagent. It read the 2010 paper's PDF and the stable documentation of the eight module groups that #192 names. It read the source where the documentation is silent. Every page came through a fetch that summarises, so long passages weren't seen word for word. The pages of most single functions came back in full. The overview pages, the example notebooks and parts of the source came back only in part. The model-results page for Markov switching failed to load. Statements below about defaults come from the function signatures and the source.

Summary

Claim. The 2010 paper presents statsmodels as a library for statistical and econometric models in Python. Its results are tested against R, SAS and Stata, or against simulations where no other package has them. The authors called it "very much still a work in progress". In 2010 it had linear and generalized regression and outlier-resistant fits, and its time-series models were in development.

Method. A library. The modules that #192 asks about, and what each computes by default:

Findings, as the source reports them. These are the defaults and limits that matter for a backtest.

Setting Number Value
HAC errors, get_robustcov_results automatic lag, and small-sample correction none (maxlags required), and off
multipletests default method Holm–Šidák
VAR.fit with no criterion lags 1
coint_johansen p-values, and most series none, and 12
acorr_ljungbox default lags the smaller of 10 and n/5
Releases major, and patch about every 3 years, several a year

Where the claims go beyond the evidence

Full-sample estimates look like one-sided ones. A state-space model's in-sample predictions are one step ahead, but its parameters come from the whole sample. Smoothed regime probabilities use the whole sample, and the library's example plots only those. The HP filter, STL, LOWESS and the band-pass filters are two-sided. The documentation of most of these doesn't say so.

No refit loop. The documentation advises fitting on a training sample, then using extend or apply on later data. There is no built-in rolling or expanding refit, so each project writes its own.

Some numbers have been wrong. In September 2026 the project fixed five entries of the MacKinnon table behind the ADF p-values (issue #10271). An issue on the Johansen test's accuracy (#7334) is open. KPSS, Ljung–Box and the ACF return confident results on a constant series (#10647). Markov-switching fits can fail to converge (#8416).

The API is still moving. The documentation marks the Markov-switching models and multipletests as subject to change, and calls one FDR method "not verified against another package".

Credit. The project tests against other packages and records each difference in its test suite. It releases often, fixes reported errors, and states in its documentation where a method is unverified or may change.

Use in this repo

The evaluator's statistics stay in the project. The repo already has, in plain Python and checked by mutation testing, the tests that the verdict rests on:

statsmodels has no block bootstrap, DSR, PBO, SPA or StepM, so it would replace none of them. The arch package has SPA, StepM and block bootstraps. #315 proposes it as a development dependency, to cross-check the project's results in a test.

Where statsmodels would help. It fits models that the project doesn't have:

Guards against look-ahead. Each use above needs one, and #315 lists them:

The verdict's look-ahead oracle (#12) can't see these leaks, because the leak is inside a fitted model, not in the data feed.

Multiple testing. multipletests gives the FDR rules that #94 and #187 need, but its default, Holm–Šidák, assumes independence or positive dependence. A graph's or a ledger's tests are dependent, so the resampling methods the project has (StepM) remain the first choice.

The decision. The project already has NumPy, SciPy and pandas through yfinance, so statsmodels would add itself and patsy. #315 proposes an optional extra, not a core dependency, so that the hourly tick and the evaluator don't load it. That is a question for the maintainer.