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:\WinX13\x13as')
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:\Users\usr\WinX13\x13as')
----> 3 result = sm.tsa.x13_arima_analysis(s, x12path=PATH)
File ~\AppData\Roaming\Python\Python39\site-packages\pandas\util\_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:\ProgramData\Anaconda3\lib\site-packages\statsmodels\tsa\x13.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:\ProgramData\Anaconda3\lib\site-packages\statsmodels\tsa\x13.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.
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.