从看statsmodels.tsa.x13 的源代码 http://statsmodels.sourceforge.net/devel/_modules/statsmodels/tsa/x13.html你需要有x12a
or x13as
系统上安装的二进制应用程序。
除此之外,这些二进制文件所在的文件夹的路径必须在您的用户中设置PATH
环境变量。
您没有提及您正在运行的操作系统,因此这里有一个页面,其中包含左侧操作系统特定下载页面的链接,可帮助您安装所需的软件。https://www.census.gov/srd/www/x13as/ https://www.census.gov/srd/www/x13as/
这是我引用的来源的链接,以找出您的环境中缺少的内容:http://statsmodels.sourceforge.net/devel/_modules/statsmodels/tsa/x13.html http://statsmodels.sourceforge.net/devel/_modules/statsmodels/tsa/x13.html
def 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):
...
x12path = _check_x12(x12path)
if not isinstance(endog, (pd.DataFrame, pd.Series)):
if start is None or freq is None:
raise ValueError("start and freq cannot be none if endog is not "
"a pandas object")
endog = pd.Series(endog, index=pd.DatetimeIndex(start=start,
periods=len(endog),
freq=freq))
...
def _check_x12(x12path=None):
x12path = _find_x12(x12path)
if not x12path:
raise X13NotFoundError("x12a and x13as not found on path. Give the "
"path, put them on PATH, or set the "
"X12PATH or X13PATH environmental variable.")
return x12path
...
def _find_x12(x12path=None, prefer_x13=True):
"""
If x12path is not given, then either x13as[.exe] or x12a[.exe] must
be found on the PATH. Otherwise, the environmental variable X12PATH or
X13PATH must be defined. If prefer_x13 is True, only X13PATH is searched
for. If it is false, only X12PATH is searched for.
"""