adf检验是用来检验序列是否平稳的方式,一般来说是时间序列中的一种检验方法。
python中可使用现成的工具statsmodels来实现adf检验。
方法及参数:
statsmodels.tsa.stattools.adfuller(x, maxlag=None, regression='c', autolag='AIC', store=False, regresults=False)[source]¶ x: 序列,一维数组 maxlag:差分次数 regresion:{c:只有常量, ct:有常量项和趋势项, ctt:有常量项、线性和二次趋势项, nc:无任何选项} autolag:{aic or bic: default, then the number of lags is chosen to minimize the corresponding information criterium, None:use the maxlag, t-stat:based choice of maxlag. Starts with maxlag and drops a lag until the t-statistic on the last lag length is significant at the 95 % level.}