[time series model] python does adf test

The adf test is a way to test whether the series is stationary, generally speaking, it is a test method in time series.
The ready-made tool statsmodels can be used in python to implement the adf test.

Methods and parameters:

statsmodels.tsa.stattools.adfuller(x, maxlag=None, regression='c', autolag='AIC', store=False, regresults=False)[source]¶
 x: sequence, one-dimensional array
 maxlag: number of differences
 regression:{c: only constants,
            ct: There are constant items and trend items,
            ctt: There are constant terms, linear and quadratic trend terms,
            nc: no options}
 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.}

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324622257&siteId=291194637