-
-
Save dpbac/b5d7f8c33017665c8b6a3f54cc58636e to your computer and use it in GitHub Desktop.
original from https://www.statsmodels.org/stable/examples/notebooks/generated/stationarity_detrending_adf_kpss.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from statsmodels.tsa.stattools import adfuller | |
| def adf_test(timeseries): | |
| print ('Results of Dickey-Fuller Test:') | |
| dftest = adfuller(timeseries, autolag='AIC') | |
| dfoutput = pd.Series(dftest[0:4], index=['Test Statistic','p-value','#Lags Used','Number of Observations Used']) | |
| for key,value in dftest[4].items(): | |
| dfoutput['Critical Value (%s)'%key] = value | |
| print (dfoutput) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment