python中时间序列的平稳性问题
我有一系列清晰可见的上升趋势和随时间变化的变化。当我在python中尝试python中时间序列的平稳性问题,python,time-series,Python,Time Series,我有一系列清晰可见的上升趋势和随时间变化的变化。当我在python中尝试adfuller()时,它给出了这些结果(这不是更多的统计/计量经济学问题,而不是编程问题吗? from statsmodels.tsa.stattools import adfuller def adf_test(timeseries): #Perform Dickey-Fuller test: print ('Results of Dickey-Fuller Test:') dftest = a
adfuller()
时,它给出了这些结果(这不是更多的统计/计量经济学问题,而不是编程问题吗?
from statsmodels.tsa.stattools import adfuller
def adf_test(timeseries):
#Perform Dickey-Fuller test:
print ('Results of Dickey-Fuller Test:')
dftest = adfuller(timeseries)
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)
#apply adf test on the series
adf_test(df['Count'])
=====================================================
Results of Dickey-Fuller Test:
Test Statistic -4.456561
p-value 0.000235
#Lags Used 45.000000
Number of Observations Used 18242.000000
Critical Value (1%) -3.430709
Critical Value (5%) -2.861698
Critical Value (10%) -2.566854
dtype: float64