[issue42276] Bug in adfuller test and a suggested fix

2020-11-06 Thread Ronald Oussoren
Ronald Oussoren added the comment: Statsmodel is not part of the Python standard library. The issue tracker for this packages seems to be at: https://github.com/statsmodels/statsmodels/issues -- nosy: +ronaldoussoren resolution: -> third party stage: -> resolved status: open -> cl

[issue42276] Bug in adfuller test and a suggested fix

2020-11-06 Thread Guo
New submission from Guo : from statsmodels.tsa.stattools import adfuller adf = adfuller(x, regression=‘c’, autolag=‘t-stat’) Sometimes comes error message: UnboundLocalError: local variable ‘bestlag’ referenced before assignment I found the reason: when using t-stat, bestlag is only assigned,