statsmodels/deprecated-var-seed
| Rule | deprecated-var-seed |
|---|---|
| Pack | statsmodels |
| Severity | warning |
| Fix | safe, with xpd check --fix |
| Library versions | statsmodels 0.15 and later |
Statsmodels 0.15 renamed seed to rng on the VAR result methods
simulate_var and irf_errband_mc. The old keyword emits a
FutureWarning and forwards its value to the same argument.
result.simulate_var(steps=10, seed=42)result.simulate_var(steps=10, rng=42)What the rule reports
Section titled “What the rule reports”The rule follows results from VAR(...).fit(...) and their local
assignments. It checks calls without argument unpacking or a separate
value for rng. Both methods returned identical arrays with the two
spellings for the same integer seed in 0.15.0.
How to fix it
Section titled “How to fix it”Use xpd check --fix to rename the keyword. This requires statsmodels 0.15
or later. If your application needs a particular random stream across future
statsmodels releases, pass an explicitly constructed random number generator
or RandomState as appropriate.
Statsmodels RNG migration · simulate_var · irf_errband_mc
Message
Section titled “Message”xpd prints this message with the issue. A name that starts with $ stands for code from your file.
Statsmodels 0.15 deprecated seed on VAR results. Pass the same value as rng.Browse the other rules of the statsmodels pack.