Skip to content

statsmodels/removed-tsa-arguments

Rule removed-tsa-arguments
Pack statsmodels
Severity error
Fix unsafe, with xpd check --fix --unsafe-fixes
Library versions statsmodels 0.15 and later

Statsmodels 0.15 removed old_names from AutoReg and ar_select_order and verbose from grangercausalitytests. These keywords now raise TypeError. Passing literal None as the third positional argument or as nlags in kpss now raises ValueError. Parentheses around None have the same effect.

AutoReg(y, lags=2, old_names=True)
grangercausalitytests(series, maxlag=2, verbose=False)
kpss(y, nlags=None)
AutoReg(y, lags=2)
grangercausalitytests(series, maxlag=2)
kpss(y, nlags="auto")

Remove old_names and update any code that reads legacy parameter labels. Remove verbose and use the returned Granger test dictionary if you need to display results. Replace nlags=None with nlags="auto" to keep the lag selection that statsmodels 0.14 used for None.

Use xpd check --fix --unsafe-fixes for the KPSS edit. It changes a call that raises into one that runs.

Statsmodels 0.15 removals

xpd prints this message with the issue. A name that starts with $ stands for code from your file.

Statsmodels 0.15 removed old_names from AutoReg and ar_select_order. Drop the keyword and update any code that reads the old parameter labels.

Browse the other rules of the statsmodels pack.