Skip to content

statsmodels

The statsmodels pack has 7 rules, and xpd can fix 4 of them.

The statsmodels pack checks regression and time-series code against statsmodels 0.15.0. The time-series migration rules apply from 0.15. The other rules check behavior documented in 0.15.0.

Rule Severity Fix What it finds
ols-ignored-weights error none Statsmodels OLS warns and ignores weights.
statsmodels-formula-power-term warning unsafe In a statsmodels OLS formula, Patsy and Formulaic use ** to expand interactions.
glm-logged-exposure warning none A statsmodels GLM with a log link takes the natural log of exposure before adding it to the linear predictor.
compare-f-test-robust-covariance warning none Statsmodels compare_f_test compares residual sums of squares.
rolling-fit-params-only info unsafe A statsmodels rolling regression can compute coefficients without the statistics needed for inference.
Rule Severity Fix What it finds
removed-tsa-arguments error unsafe Statsmodels 0.15 removed old_names from AutoReg and ar_select_order and verbose from grangercausalitytests.
deprecated-var-seed warning safe Statsmodels 0.15 renamed seed to rng on the VAR result methods simulate_var and irf_errband_mc.

The rules use import and local assignment evidence. They cover standard module aliases and direct imports under the API names. Computed formulas, dynamic keyword names, and model results hidden behind arbitrary factories can require manual review.

Statsmodels API reference · 0.15.0 release notes