Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/307.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python中时间序列的平稳性问题_Python_Time Series - Fatal编程技术网

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

我有一系列清晰可见的上升趋势和随时间变化的变化。当我在python中尝试
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