x13.season
Interface to X13-Arima seasonal adjustment procedure
Syntax
[outputSeries, outputSeries, ..., info] = x13.season(inputSeries, ...)
[outputSeries, outputSeries, ..., info] = x13.season(inputSeries, range, ...)
Input Arguments
inputSeries [ Series ]
Input time series that will be subjected to a X13-ARIMA seasonal adjustment procedure.
range=Inf [ Dater ]
Date range on which the seasonal adjustment will be performed; any observations outside the
rangewill be clipped off before running the procedure; if not specified, all observations available will be used.
Output Arguments
outputSeries [ Series ]
One or more output time series that correspond to the type of output requested in the option
Output.
info [ struct ]
Information struct with details on the X13-ARIMA procedure run. The
infostruct includes the following fields and nested fields:
.InputFiles- a struct with nested fields named after the extensions of the individual input files, with the content of the these input files.
.OutputFiles- a struct with with nested fields named after the extensions of the individual output files produced by the X13-ARIMA procedure, with the content of these output files. The output files always included are.log,.out, and.err. Additional output files are included based on the output series (output tables) requested in the optionOutput.
.Message- the screen output of the X13-ARIMA procedure; this output is also printed on the screen when the optionDisplay=true.
.OutputSpecs- selected specs based on the information captured from some output files; the output specs may includeOutputSpecs.X11_Mode,OutputSpecs.Arima_Model,OutputSpecs.Arima_AR,OutputSPecs.Arima_MA.
.Path- the entire path to the input and output files, including the file name wkithout and extension (the same file name with different extensions is used for both input and output files); whenCleanup=true, the input and output files are all deleted automatically.
General Options
Output="d10" [ string ]
Types of output requested to be returned as time series from the X13-ARIMA procedure; see the Output Tables in Description; the number of the
outputSeriesarguments corresponds to the number of elements in this option.
Range=Inf [ Dater ]
Date range that will be extracted from the
inputSeriesbefore running the X13-ARIMA procedure; the observations outside the range will be discarded.
Display=false [ true | false ]
Print the screen output produced by the X13-ARIMA procedure; the message is also captured in the output argument
info.Message.
Cleanup=true [ true | false ]
Delete all input and output files automatically.
X13-ARIMA Options
Below are listed the X13-ARIMA specs that are supported in the current implemenation; refer to the X13-ARIMA-SEATS manual for details and explanation. To assign values to the individual specs and their settings, follow these rules:
-
if a numeric scalar or vector is expected, assign the option a numeric scalar or vector;
-
if a "yes" or "no" value is expected, assign a
trueorfalse; -
if a text value or a list of more than onetext values is expected (such as
loginTransform_Function, ortd lpyearinRegression_Variables), enter a single double-quoted string, or an array of strings (such as"log"or["td", "lpyear"]); -
if time series data are expected (such as in
Regression_Data), enter a time series object; -
if a fixed numeric value is expected (such as fixed coefficients in
Arima_AR, as opposed to initial values in the same spec), enter an imaginary value (such as0.8i); imaginary values will be printed with an extraFin the input files (such as0.8F);
Series Spec
Series_TitleSeries_SpanSeries_ModelSpanSeries_PrecisionSeries_DecimalsSeries_CompTypeSeries_CompWeightSeries_AppendBcstSeries_AppendFcstSeries_TypeSeries_Save
X11 Spec
X11_SeasonalMAX11_TrendMAX11_SigmaLimX11_TitleX11_AppendFcstX11_AppendBcstX11_FinalX11_PrintX11_SaveX11_SaveLog
Transform Spec
Transform_FunctionTransform_PowerTransform_AdjustTransform_TitleTransform_AicDiffTransform_PrintTransform_SaveTransform_SaveLog
Estimate Spec
Estimate_TolEstimate_MaxIterEstimate_ExactEstimate_OutOfSampleEstimate_PrintEstimate_SaveEstimate_SaveLog
Automdl Spec
Automdl_MaxOrderAutomdl_MaxDiffAutomdl_DiffAutomdl_AcceptDefaultAutomdl_CheckMuAutomdl_LjungBoxLimitAutomdl_MixedAutomdl_PrintAutomdl_SaveLog
Pickmdl Spec
Pickmdl_MethodPickmdl_ModePickmdl_PrintPickmdl_SaveLog
Arima Spec
Arima_ModelArima_ARArima_MAArima_Title
Force Spec
Force_TypeForce_LambdaForce_RhoForce_RoundForce_StartForce_TargetForce_UseFcstForce_PrintForce_Save
Forecast Spec
Forecast_MaxLeadForecast_MaxBackForecast_ExcludeForecast_LogNormalForecast_PrintForecast_Save
Regression Spec
Regression_VariablesRegression_TestAllEasterRegression_DataRegression_UserRegression_UserTypeRegression_AicTestRegression_AicDiffRegression_PVAicTestRegression_TLimitRegression_Chi2TestRegression_Chi2TestCVRegression_PrintRegression_SaveRegression_SaveLog
X11Regression Spec
X11Regression_VariablesX11Regression_DataX11Regression_UserX11Regression_UserTypeX11Regression_AicTestX11Regression_AicDiffX11Regression_TDPriorX11Regression_PriorX11Regression_SpanX11Regression_SigmaX11Regression_CriticalX11Regression_OutlierMethodX11Regression_OutlierSpanX11Regression_PrintX11Regression_SaveX11Regression_SaveLog
Seats Spec
Seats_AppendFcstSeats_HpCycleSeats_NoAdmissSeats_QMaxSeats_RModSeats_OutSeats_StatSeasSeats_TabTablesSeats_PrintPhtrfSeats_PrintSeats_SaveSeats_SaveLog
Description
Bulding the Input File
With no options specified, all specs (see their list above) are empty, meaning they are not included in the input file at all and the X13-ARIMA default values (see the X13-ARIMA-SEATS manual) are assumed, with the following exceptions:
-
Series_Start,Series_DataandSeries_Periodare automatically created based on theinputSeries; -
Series_PrecisionandSeries_Decimalsare both set to5(the maximum precision accepted by the X13-ARIMA procedure); -
Either an
X11spec or a pair ofSeatandAutomdlspecs are included to force the execution of theX11type of seasonal adjustment (ifd..types of output tables are requested inOutput) or the execution of theSEATtype of seasonal adjustment (ifx..types of output tables are requested inOutput).
If no setting within a particular spec is not defined in the options, the
spec itself is not included in the input file. To force the inclusion of
an empty spec in the input file (assuming thus the default values for all
the settings within that spece), use the name of the spec as an option
and set it to true, e.g. (..., "Automdl", true, ...) to force the
estimation of an ARIMA model based on an automatic model selection
procedure.
If at least one setting from a particular spec is specified as an option in the fuction call, that spec is included explicitly in the input file.
Type of Seasonal Adjustment
Two types of seasonal adjustments are available in X13-ARIMA: X11 and
SEATS. Which one is invoked depends on the type of output requested in
the option Output: the output tables starting with a d refer to X11
(hence, the default Output="d11" invokes X11 and returns the final
seasonally adjusted series) whereas the output tables starting with an
s refer to SEATS.
Depending on the output tables requested, the correct spec for the respective seasonal adjustment procedure will be included in the input file and invoked.
The two procedures cannot be combined together in one run; i.e. the
option Output cannot combine d.. and s.. output tables.
Output Tables (Output Series)
The following output tables (i.e. output series) can be requested in the option Output:
Name in option Output |
Output table in X13 | Description |
|---|---|---|
"d10" |
X11_d10 |
X11 final seasonal factors |
"d11" |
X11_d11 |
X11 final seasonally adjusted series |
"d12" |
X11_d12 |
X11 final trend-cycle |
"d13" |
X11_d13 |
X11 final irregular component |
"d16" |
X11_d16 |
X11 final combined seasonal and trading day factors |
"d18" |
X11_d18 |
X11 combined holiday and trading day factors |
"s10" |
Seats_s10 |
SEATS final seasonal component |
"s11" |
Seats_s11 |
SEATS final seasonal adjustment component |
"s12" |
Seats_s12 |
SEATS final trend component |
"s13" |
Seats_s13 |
SEATS final irregular component |
"s14" |
Seats_s14 |
SEATS final transitory component |
"s16" |
Seats_s16 |
SEATS final combined adjustment component |
"s18" |
Seats_s18 |
SEATS final adjustment ratio |
"cyc" |
Seats_cyc |
SEATS cycle component |
"a18" |
Series_a18 |
Original series adjusted for regARIMA calendar effects |
"a19" |
Series_a19 |
Original series adjusted for regARIMA outliers |
"b1" |
Series_b1 |
Original series, adjusted for prior effects and forecast extended |
"mva" |
Series_mva |
Original series with missing values replaced by regARIMA estimates |
"saa" |
Force_saa |
Final seasonally adjusted series with constrained yearly totals |
"rnd" |
Force_rnd |
Rounded final seasonally adjusted series |
"fct" |
Forecast_fct |
Point forecasts on the original scale |
"bct" |
Forecast_bct |
Point backcasts on the original scale |
"ftr" |
Forecast_ftr |
Point forecasts on the transformed scale |
"btr" |
Forecast_btr |
Point backcasts on the transformed scale |
Example
A plain vanilla call
xsa = x13.season(x)
or
[xsa, info] = x13.season(x)
produces a seasonally adjusted series xsa with all default settings
(hence no ARIMA model estimated).
Example
Estimate an ARIMA model based on an automatic model selection
procedures, use the ARIMA information in the seasonal
adjustment, and return the estimated ARIMA model in the output info
struct:
[xsa, info] = x13.season(x, "Automdl", true, "Estimate_Save", "mdl")
Example
Request additional output series: the seasonally adjusted series, the seasonal factors and the trend cycle component:
[xsa, xsf, xtc, info] = x13.season(x, "Output", ["d11", "d10", "d12"]);
Example
Run seasonal adjustment based on an automatically selected ARIMA model with dummy variables of additive outliers in period 2017Q3, 2017Q4 and 2018Q1:
xsa = x13.season(x ...
, "Automdl", true ...
, "Regression_Variables", "aos2017.3-2018.1" ...
);
This call is equivalent to creating the dummies manually (a time series
object with three columns), and using the option Regression_Data
instead:
dummy = Series(startDate:endDate, zeros(1, 3));
dummy(qq(2017,3), 1) = 1;
dummy(qq(2017,4), 2) = 1;
dummy(qq(2018,1), 3) = 1;
xsa = x13.season(x ...
, "Automdl", true ...
, "Regression_Data", dummy ...
);