Skip to content

Instantly share code, notes, and snippets.

@DihPedroso
DihPedroso / ADF_test.py
Last active November 17, 2018 00:30
Perform and exhibit ADF test
from statsmodels.tsa.stattools import adfuller
def perform_ADF_test(X):
ADF_test = adfuller(X)
print('ADF Statistic: %f' % ADF_test[0])
print('p-value: %f' % ADF_test[1])
print('Critical Values:')
for key, value in ADF_test[4].items():
print('\t%s: %.3f' % (key, value))
perform_ADF_test(vec_S)