This project is read-only.

Simple x13 access from Matlab

Topics: Database Management
Aug 5, 2014 at 11:50 PM
I would like to simply use IRIS as a tool to seasonally adjust matrices of monthly data. I've an n x v matrix of monthly time series data running down the page in a matlab double variable. Could you tell me the simplest way to do that? I have downloaded and installed the Iris toolbox. Thanks!

Best
Dave
Aug 6, 2014 at 9:54 AM
Try "help x12". The name is x12 purely for legacy reasons -- this calls x13 and the help file explains the syntax.
Marked as answer by michaeljohnston on 8/7/2014 at 6:07 AM
Aug 9, 2014 at 1:30 PM
Hi Dave

Note that you first need to convert your data matrices into (multivariate) tseries objects (time series objects). Let's say X is your N-by-K matrix with monthly data organized columnwise (i.e. there are K time series with N periods of observations in each).

Convert X to a tseries object
>> XX = tseries( mm(2010,1), X )
where mm(2010,1) is an IRIS command to create a monthly date (here, January 2010) which indicates the start date of your series (of course, use whatever date is relevant in your case). The variables XX is now a tseries object.

Then, run x12 on the new variable XX (it will be, in fact, a call to x13 but as Michael said, the name of the procedure is still x12 for backward compatibility reasons)
>> XXsa = x12(XX);
This is a basic call to x13. There are tons of options you can use to modify the behavior, see help tseries/x12 or idoc tseries/x12 or the IRIS reference manual.

The output argument, XXsa, is a tseries object with seasonally adjusted data. To convert the tseries object back to a plain matrix, simply type
>> Xsa = double(XXsa);
Hope this helps.

Best,
Jaromir
Marked as answer by jaromirbenes on 8/9/2014 at 5:30 AM