Skill Tracer
Skills › Scientific Agent Skills › statsmodels › review.md

review.md

86 lines · skills/statsmodels/references/review.md at 5f2bc03

Open on GitHub
1# Maintenance and verification ledger
2
3Reviewed 2026-10-01 against **statsmodels 0.15.0**, with Python 3.13.3,
4NumPy 2.5.3, SciPy 1.18.1, pandas 3.0.6, matplotlib 3.11.2 and
5scikit-learn 1.9.1. The package itself supports Python 3.10+; this exact numerical
6stack requires 3.12+. No remote service endpoint, authentication or pagination is
7part of these statistical workflows.
8
9The current [release notes](https://www.statsmodels.org/stable/release/version0.15.0.html)
10and [tagged source](https://github.com/statsmodels/statsmodels/tree/v0.15.0/statsmodels)
11were checked with the installed wheel. Forty-seven source files covering the model,
12diagnostic, graphics and treatment imports matched the release tag byte for byte.
13The API audit included constructors, fitting options, result attributes and prediction
14semantics in every reference. Source inspection is distinct from numerical execution.
16The quick start is executable in order. Other references contain contextual fragments:
17provide their named inputs and retain the appropriate model result for each section;
18they are not single scripts to concatenate. Native synthetic checks cover the corrected
19contracts, linear/GLM/discrete/time-series models and diagnostics. They establish API
20behavior and numerical identities, not estimator calibration, power for a real study,
21causal identification, or validity of a fitted scientific model. Optional custom
22MLEModel subclasses, manual proportional-odds tests and arbitrary user datasets remain
23illustrative and require separate validation.

Maintenance and verification ledger

Reviewed 2026-10-01 against statsmodels 0.15.0, with Python 3.13.3, NumPy 2.5.3, SciPy 1.18.1, pandas 3.0.6, matplotlib 3.11.2 and scikit-learn 1.9.1. The package itself supports Python 3.10+; this exact numerical stack requires 3.12+. No remote service endpoint, authentication or pagination is part of these statistical workflows.

The current release notes and tagged source were checked with the installed wheel. Forty-seven source files covering the model, diagnostic, graphics and treatment imports matched the release tag byte for byte. The API audit included constructors, fitting options, result attributes and prediction semantics in every reference. Source inspection is distinct from numerical execution.

The quick start is executable in order. Other references contain contextual fragments: provide their named inputs and retain the appropriate model result for each section; they are not single scripts to concatenate. Native synthetic checks cover the corrected contracts, linear/GLM/discrete/time-series models and diagnostics. They establish API behavior and numerical identities, not estimator calibration, power for a real study, causal identification, or validity of a fitted scientific model. Optional custom MLEModel subclasses, manual proportional-odds tests and arbitrary user datasets remain illustrative and require separate validation.

Raw lines 1 to 24
25## Primary API sources and consequential contracts
27- [OLS](https://www.statsmodels.org/stable/generated/statsmodels.regression.linear_model.OLS.html),
28 [robust covariance](https://www.statsmodels.org/stable/generated/statsmodels.regression.linear_model.RegressionResults.get_robustcov_results.html),
29 [RecursiveLS](https://www.statsmodels.org/stable/generated/statsmodels.regression.recursive_ls.RecursiveLS.html),
30 [MixedLM.fit](https://www.statsmodels.org/stable/generated/statsmodels.regression.mixed_linear_model.MixedLM.fit.html):
31 intercept/design alignment; recursive estimates are expanding-window estimates;
32 ML versus REML and covariance assumptions matter.
33- [GLM.fit](https://www.statsmodels.org/stable/generated/statsmodels.genmod.generalized_linear_model.GLM.fit.html),
34 [GLM prediction](https://www.statsmodels.org/stable/generated/statsmodels.genmod.generalized_linear_model.GLMResults.get_prediction.html),
35 [pseudo R-squared](https://www.statsmodels.org/stable/generated/statsmodels.genmod.generalized_linear_model.GLMResults.pseudo_rsquared.html):
36 specify robust covariance during fit, request the intended prediction target, use
37 likelihood-based pseudo-R² and `bic_llf`, and preserve exposure for new data.
38- [Marginal effects](https://www.statsmodels.org/stable/generated/statsmodels.discrete.discrete_model.DiscreteResults.get_margeff.html),
39 [ZIP prediction](https://www.statsmodels.org/stable/generated/statsmodels.discrete.count_model.ZeroInflatedPoisson.predict.html),
40 [OrderedModel](https://www.statsmodels.org/stable/generated/statsmodels.miscmodels.ordinal_model.OrderedModel.html),
41 [ConditionalLogit](https://www.statsmodels.org/stable/generated/statsmodels.discrete.conditional_models.ConditionalLogit.html),
42 [hurdle](https://www.statsmodels.org/stable/generated/statsmodels.discrete.truncated_model.HurdleCountModel.html):
43 `overall` gives AME; `atexog` keys are column numbers; inflation differs from
44 observing zero; ordinal/conditional models prohibit a constant; ordinal threshold
45 increments need transformation. Hurdle zero/count processes share exog.
46- [ADF](https://www.statsmodels.org/stable/generated/statsmodels.tsa.stattools.adfuller.html),
47 [KPSS](https://www.statsmodels.org/stable/generated/statsmodels.tsa.stattools.kpss.html),
48 [SARIMAX forecasting](https://www.statsmodels.org/stable/generated/statsmodels.tsa.statespace.sarimax.SARIMAXResults.get_forecast.html),
49 [Ljung-Box](https://www.statsmodels.org/stable/generated/statsmodels.stats.diagnostic.acorr_ljungbox.html),
50 [VARMAX](https://www.statsmodels.org/stable/generated/statsmodels.tsa.statespace.varmax.VARMAX.html):
51 use named result objects, distinguish test nulls, supply future exog, account for
52 fitted dynamic parameters and initialization, and avoid unidentified unrestricted
53 VARMA specifications. `MarkovRegression.order` does not add AR coefficients.
54- [RESET](https://www.statsmodels.org/stable/generated/statsmodels.stats.diagnostic.linear_reset.html),
55 [AnovaRM](https://www.statsmodels.org/stable/generated/statsmodels.stats.anova.AnovaRM.html),
56 [pairwise comparisons](https://www.statsmodels.org/stable/generated/statsmodels.stats.multicomp.pairwise_tukeyhsd.html),
57 [proportion effect size](https://www.statsmodels.org/stable/generated/statsmodels.stats.proportion.proportion_effectsize.html),
58 [SciPy Levene](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.levene.html):
59 RESET returns a result object; repeated-measures ANOVA requires balanced data and
60 lacks sphericity corrections; 0.15 adds Games-Howell via `use_var="unequal"`;
61 proportion power uses Cohen's h, and CompareMeans has no `test_equal_var` method.
62- [TreatmentEffect](https://www.statsmodels.org/stable/generated/statsmodels.treatment.treatment_effects.TreatmentEffect.html)
63 and its [released implementation](https://github.com/statsmodels/statsmodels/blob/v0.15.0/statsmodels/treatment/treatment_effects.py):
64 OLS outcome modeling remains the supported route. `ipw_ra`/`aipw_wls` GMM still
65 slice the final six selection parameters; non-six-parameter designs raise a shape
66 error. The point-estimate-only route does not provide standard errors. Do not change
67 a scientific design to accommodate that implementation bug.

Primary API sources and consequential contracts

  • OLS, robust covariance, RecursiveLS, MixedLM.fit: intercept/design alignment; recursive estimates are expanding-window estimates; ML versus REML and covariance assumptions matter.
  • GLM.fit, GLM prediction, pseudo R-squared: specify robust covariance during fit, request the intended prediction target, use likelihood-based pseudo-R² and bic_llf, and preserve exposure for new data.
  • Marginal effects, ZIP prediction, OrderedModel, ConditionalLogit, hurdle: overall gives AME; atexog keys are column numbers; inflation differs from observing zero; ordinal/conditional models prohibit a constant; ordinal threshold increments need transformation. Hurdle zero/count processes share exog.
  • ADF, KPSS, SARIMAX forecasting, Ljung-Box, VARMAX: use named result objects, distinguish test nulls, supply future exog, account for fitted dynamic parameters and initialization, and avoid unidentified unrestricted VARMA specifications. MarkovRegression.order does not add AR coefficients.
  • RESET, AnovaRM, pairwise comparisons, proportion effect size, SciPy Levene: RESET returns a result object; repeated-measures ANOVA requires balanced data and lacks sphericity corrections; 0.15 adds Games-Howell via use_var="unequal"; proportion power uses Cohen's h, and CompareMeans has no test_equal_var method.
  • TreatmentEffect and its released implementation: OLS outcome modeling remains the supported route. ipw_ra/aipw_wls GMM still slice the final six selection parameters; non-six-parameter designs raise a shape error. The point-estimate-only route does not provide standard errors. Do not change a scientific design to accommodate that implementation bug.
Raw lines 25 to 68
69## Executed checks and limits
71The isolated suite runs eight native tests, including all 173 Python fenced blocks
72with explicit synthetic contexts (some blocks only import or explain a workflow).
73Assertions cover design shapes, OLS interval width, GLM mean uncertainty and robust
74covariance, AME derivatives, ZIP mixture probabilities, ordinal thresholds, multinomial
75results, selected ARIMA convergence and preserved forecast dates, and treatment-effect
76identities plus the known GMM failure.
78The broad ARIMA grid emits expected nonconvergence warnings for some candidates;
79selection excludes those candidates and retains the selected result. KPSS reports
80table-boundary p-values. Gamma inverse/binomial log links emit domain warnings and
81need an explicit support check on real data. Johansen testing emitted complex-to-real
82cast warnings in the tested NumPy stack; the synthetic eigenvalues had exactly zero
83imaginary parts and finite trace/max-eigenvalue statistics. That fixture check is not
84a general justification to discard complex components on other data. Plotting was
85exercised with the noninteractive Agg backend; no publication-layout certification
86or empirical interval coverage study was performed.

Executed checks and limits

The isolated suite runs eight native tests, including all 173 Python fenced blocks with explicit synthetic contexts (some blocks only import or explain a workflow). Assertions cover design shapes, OLS interval width, GLM mean uncertainty and robust covariance, AME derivatives, ZIP mixture probabilities, ordinal thresholds, multinomial results, selected ARIMA convergence and preserved forecast dates, and treatment-effect identities plus the known GMM failure.

The broad ARIMA grid emits expected nonconvergence warnings for some candidates; selection excludes those candidates and retains the selected result. KPSS reports table-boundary p-values. Gamma inverse/binomial log links emit domain warnings and need an explicit support check on real data. Johansen testing emitted complex-to-real cast warnings in the tested NumPy stack; the synthetic eigenvalues had exactly zero imaginary parts and finite trace/max-eigenvalue statistics. That fixture check is not a general justification to discard complex components on other data. Plotting was exercised with the noninteractive Agg backend; no publication-layout certification or empirical interval coverage study was performed.

Raw lines 69 to 86