statsmodels是一个Python模块,提供了大量统计模型的类和函数。主要功能有:

  1. regression: Generalized least squares (including weighted least squares and least squares with autoregressive errors), ordinary least squares.
  2. glm: Generalized linear models with support for all of the one-parameter exponential family distributions.
    discrete choice models: Poisson, probit, logit, multinomial logit
  3. rlm: Robust linear models with support for several M-estimators.
  4. tsa: Time series analysis models, including ARMA, AR, VAR
  5. nonparametric : (Univariate) kernel density estimators
  6. datasets: Datasets to be distributed and used for examples and in testing.
  7. PyDTA: Tools for reading Stata .dta files into numpy arrays.
  8. stats: a wide range of statistical tests

statsmodels.tsa.stattools.adfuller(x, maxlag=None, regression='c', autolag='AIC', store=False, regresults=False)

迪基-福勒检验Augmented Dickey-Fuller(ADF) Test

  • 参数详解

  1. x (array_like*,* 1d) 数据序列

  2. maxlag (int) – Maximum lag which is included in test, default 12*(nobs/100)^{1/4}

  3. regression ′ c ′ , ′ c t ′ , ′ c t t ′ , ′ n c ′ {'c','ct','ctt','nc'} c,ct,ctt,nc

    Constant and trend order to include in regression

    • ’c’ : constant only (default)
    • ’ct’ : constant and trend
    • ’ctt’ : constant, and linear and quadratic trend
    • ’nc’ : no constant, no trend
  4. autolag ′ A I C ′ , ′ B I C ′ , ′ t − s t a t ′ , N o n e {'AIC', 'BIC', 't-stat', None} AIC,BIC,tstat,None

    • if None, then maxlag lags are used
    • if ‘AIC’ (default) or ‘BIC’, then the number of lags is chosen to minimize the corresponding information criterion
    • ’t-stat’ based choice of maxlag. Starts with maxlag and drops a lag until the t-statistic on the last lag length is significant using a 5%-sized test
  5. store (bool) – If True, then a result instance is returned additionally to the adf statistic. Default is False

  6. regresults (bool*,* optional) – If True, the full regression results are returned. Default is False

Logo

欢迎加入 MCP 技术社区!与志同道合者携手前行,一同解锁 MCP 技术的无限可能!

更多推荐