Which Seasonal Adjustment Program should I use with Statsmodels X-13-ARIMA

Question:

I have downloaded Win X-13 from Census, and unpacked it on my drive.

My code looks like this:

import pandas as pd
from pandas import Timestamp
import os
import statsmodels.api as sm

s = pd.Series(
    {Timestamp('2013-03-01 00:00:00'): 838.2,
     Timestamp('2013-04-01 00:00:00'): 865.17,
     Timestamp('2013-05-01 00:00:00'): 763.0,
     Timestamp('2013-06-01 00:00:00'): 802.99,
     Timestamp('2013-07-01 00:00:00'): 875.56,
     Timestamp('2013-08-01 00:00:00'): 754.4,
     Timestamp('2013-09-01 00:00:00'): 617.48,
     Timestamp('2013-10-01 00:00:00'): 994.75,
     Timestamp('2013-11-01 00:00:00'): 860.86,
     Timestamp('2013-12-01 00:00:00'): 786.66},
    name='Cost')

PATH = os.chdir(r'C:WinX13x13as')

result = sm.tsa.x13_arima_analysis(s, x12path=PATH)

This return error:

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
Input In [10], in <cell line: 3>()
      1 PATH = os.chdir(r'C:UsersusrWinX13x13as')
----> 3 result = sm.tsa.x13_arima_analysis(s, x12path=PATH)

File ~AppDataRoamingPythonPython39site-packagespandasutil_decorators.py:207, in deprecate_kwarg.<locals>._deprecate_kwarg.<locals>.wrapper(*args, **kwargs)
    205     else:
    206         kwargs[new_arg_name] = new_arg_value
--> 207 return func(*args, **kwargs)

File C:ProgramDataAnaconda3libsite-packagesstatsmodelstsax13.py:457, in x13_arima_analysis(endog, maxorder, maxdiff, diff, exog, log, outlier, trading, forecast_periods, retspec, speconly, start, freq, print_stdout, x12path, prefer_x13, tempdir)
    455     print(p.stdout.read())
    456 # check for errors
--> 457 errors = _open_and_read(ftempout.name + '.err')
    458 _check_errors(errors)
    460 # read in results

File C:ProgramDataAnaconda3libsite-packagesstatsmodelstsax13.py:206, in _open_and_read(fname)
    204 def _open_and_read(fname):
    205     # opens a file, reads it, and make sure it's closed
--> 206     with open(fname, 'r', encoding="utf-8") as fin:
    207         fout = fin.read()
    208     return fout

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\usr\AppData\Local\Temp\tmp0d23o_q8.err'

What am I doing wrong here? Am I donwloading the wrong Seasonal Adjustment Program? Or using it wrong. I found little help online. This solution from SO did not helt me.

Asked By: NRVA

||

Answers:

If anyone have similar issues, I needed to download another Seasonal Adjustment Program to make this work. Scroll down to Previous Versions and download Version 1.1. Ascii-version works for me.

Answered By: NRVA
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.