You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2020-11-06.12:54:02.207>created_at=<Date2020-11-06.12:44:20.321>labels= ['3.8', 'type-bug', 'library']
title='Bug in adfuller test and a suggested fix'updated_at=<Date2020-11-06.12:54:02.204>user='https://bugs.python.org/gyllila'
Sometimes comes error message:
UnboundLocalError: local variable ‘bestlag’ referenced before assignment
I found the reason: when using t-stat, bestlag is only assigned, when the last lag becomes significant the first time, so if no lag has a significant t-value, then bestlag is never assigned
I fixed this bug this way: open the file stattools.py and find the lines:
elif method == “t-stat”:
#stop = stats.norm.ppf(.95)
stop = 1.6448536269514722
Then add here following two lines:
bestlag = startlag
icbest = np.abs(results[startlag].tvalues[-1])
This way, the code won’t crash again and t-stat simply uses no lag when there is no significant value
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: