添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
  • 4.8.1. statsmodels.tsa.api
  • 4.8.2. statsmodels.tsa.adfvalues
  • 4.8.3. statsmodels.tsa.ar_model
  • 4.8.4. statsmodels.tsa.descriptivestats
  • 4.8.5. statsmodels.tsa.interp.denton
  • 4.8.6. statsmodels.tsa.kalmanf.kalmanfilter
  • 4.8.7. statsmodels.tsa.mlemodel
  • 4.8.8. statsmodels.tsa.seasonal
  • 4.8.9. statsmodels.tsa.tsatools
  • 4.8.10. statsmodels.tsa.varma_process
  • 4.8.11. statsmodels.tsa.x13
    • 4.8.11.1. Notes
    • 4.8.11.2. Functions
    • 4.8.11.3. Classes
    • 4.8.11.4. Exceptions
    • 4.8.12. statsmodels.tsa.base.datetools
    • 4.8.13. statsmodels.tsa.base.tsa_model
    • 4.8.14. statsmodels.tsa.filters.api
    • 4.8.15. statsmodels.tsa.filters._utils
    • 4.8.16. statsmodels.tsa.filters.bk_filter
    • 4.8.17. statsmodels.tsa.filters.cf_filter
    • 4.8.18. statsmodels.tsa.filters.filtertools
    • 4.8.19. statsmodels.tsa.filters.hp_filter
    • statsmodels.tsa.x13. x13_arima_analysis ( endog , maxorder=(2 , 1) , maxdiff=(2 , 1) , diff=None , exog=None , log=None , outlier=True , trading=False , forecast_years=None , retspec=False , speconly=False , start=None , freq=None , print_stdout=False , x12path=None , prefer_x13=True ) [source]

      Perform x13-arima analysis for monthly or quarterly data.

      Parameters:

      endog : array-like, pandas.Series

      The series to model. It is best to use a pandas object with a DatetimeIndex or PeriodIndex. However, you can pass an array-like object. If your object does not have a dates index then start and freq are not optional.

      maxorder : tuple

      The maximum order of the regular and seasonal ARMA polynomials to examine during the model identification. The order for the regular polynomial must be greater than zero and no larger than 4. The order for the seaonal polynomial may be 1 or 2.

      maxdiff : tuple

      The maximum orders for regular and seasonal differencing in the automatic differencing procedure. Acceptable inputs for regular differencing are 1 and 2. The maximum order for seasonal differencing is 1. If diff is specified then maxdiff should be None. Otherwise, diff will be ignored. See also diff .

      diff : tuple

      Fixes the orders of differencing for the regular and seasonal differencing. Regular differencing may be 0, 1, or 2. Seasonal differencing may be 0 or 1. maxdiff must be None, otherwise diff is ignored.

      exog : array-like

      Exogenous variables.

      log : bool or None

      If None, it is automatically determined whether to log the series or not. If False, logs are not taken. If True, logs are taken.

      outlier : bool

      Whether or not outliers are tested for and corrected, if detected.

      trading : bool

      Whether or not trading day effects are tested for.

      forecast_years : int

      Number of forecasts produced. The default is one year.

      retspec : bool

      Whether to return the created specification file. Can be useful for debugging.

      speconly : bool

      Whether to create the specification file and then return it without performing the analysis. Can be useful for debugging.

      start : str, datetime

      Must be given if endog does not have date information in its index. Anything accepted by pandas.DatetimeIndex for the start value.

      freq : str

      Must be givein if endog does not have date information in its index. Anything accapted by pandas.DatetimeIndex for the freq value.

      print_stdout : bool

      The stdout from X12/X13 is suppressed. To print it out, set this to True. Default is False.

      x12path : str or None

      The path to x12 or x13 binary. If None, the program will attempt to find x13as or x12a on the PATH or by looking at X13PATH or X12PATH depending on the value of prefer_x13.

      prefer_x13 : bool

      If True, will look for x13as first and will fallback to the X13PATH environmental variable. If False, will look for x12a first and will fallback to the X12PATH environmental variable. If x12path points to the path for the X12/X13 binary, it does nothing.

      Returns:

      res : Bunch

      A bunch object with the following attributes:

    • results : str The full output from the X12/X13 run.
    • seasadj : pandas.Series The final seasonally adjusted endog
    • trend : pandas.Series The trend-cycle component of endog
    • irregular : pandas.Series The final irregular component of endog
    • stdout : str The captured stdout produced by x12/x13.
    • spec : str, optional Returned if retspec is True. The only thing returned if speconly is True.
    • Notes

      This works by creating a specification file, writing it to a temporary directory, invoking X12/X13 in a subprocess, and reading the output directory, invoking exog12/X13 in a subprocess, and reading the output back in.

  •