Time Series Analysis Package
DECOMP Object
The DECOMP class object functions perform the seasonal decomposition or analysis of the time series arrays and output all the values and results.
Table 7 summarizes the methods that are associated with the DECOMP object.
Table 7: Methods of the DECOMP Object
| Method | Description |
|---|---|
| GetResult | Get the analysis results |
| Initialize | Initialize the DECOMP object |
| Run | Run the analysis |
| SetLambda | Set the Hodrick-Prescott filter parameter for trend-cycle decomposition |
| SetMode | Set the type of decomposition |
| SetResults | Set the analysis results to be generated |
| SetSeasonality | Set the length of the seasonal cycles |
| SetY | Set the time series array |
Figure 5 diagrams the methods of the DECOMP object.
Figure 5: DECOMP Data Flow

DECOMP Synopsis
DECLARE OBJECT obj (DECOMP);
Method syntax, in order of typical usage:
rc=obj.SetY (YSeries);
rc=obj.SetMode ('Name');
rc=obj.SetResults ('Name'<,'Name',…>);
rc=obj.SetSeasonality (Value);
rc=obj.SetLambda (Value);
rc=obj.Run ();
rc=obj.GetResult ('Name',OutputArray);
DECOMP Methods
DECOMP.GetResult Method
rc=obj.GetResult ('Name',OutputArray);
Outputs the selected results to an array.
Input Arguments
You must specify the following input arguments:
- Name
-
specifies a string that identifies the result series to return. You can specify the following values within single quotation marks:
- tcc
returns the trend-cycle component.
- sic
returns the seasonal-irregular component.
- sc
returns the seasonal component.
- scstd
returns the seasonal component standard errors.
- tcs
returns the trend-cycle-seasonal component.
- ic
returns the irregular component.
- sa
returns the seasonally adjusted series.
- pcsa
returns the percentage of change in seasonally adjusted series.
- tc
returns the trend component.
- cc
returns the cycle component.
- OutputArray
specifies a numeric array to receive the result series.
DECOMP.Initialize Method
rc=obj.Initialize ();
Initializes a DECOMP object to an empty state. This method must be called before the time series array and other attributes are specified for the DECOMP object.
Arguments
There are no arguments associated with this method.
DECOMP.Run Method
rc=obj.Run ();
Runs the DECOMP object to perform the seasonal decomposition or analysis by using the time series array YSeries that has been specified for it. Upon successful completion, various results can be extracted from the DECOMP object.
Arguments
There are no arguments associated with this method.
DECOMP.SetLambda Method
rc=obj.SetLambda (Value);
Sets the Hodrick-Prescott filter parameter for trend-cycle decomposition.
Input Arguments
You must specify the following input argument:
- Value
specifies the length of the seasonal cycle. The default value is 1.
DECOMP.SetMode Method
rc=obj.SetMode (Value);
Sets the type of decomposition to be used to decompose the time series.
Input Arguments
You can specify one of the following Values:
- ADD ADDITIVE
specifies additive decomposition.
- LOGADD LOGADDITIVE
specifies log-additive decomposition.
- MULT MULTIPLICATIVE
specifies multiplicative decomposition.
- MULTORADD
specifies multiplicative or additive decomposition, depending on the data.
- PSEUDOADD PSEUDOADDITIVE
specifies pseudo-additive decomposition.
DECOMP.SetResults Method
rc=obj.SetResults ('Name'<,'Name',…>);
Set a group of results to be generated in the DECOMP object.
Input Arguments
You must specify the following input arguments:
- Name
-
specifies one or multiple strings that identify the result series to be generated. You can specify the following values within single quotation marks:
- tcc
specifies the trend-cycle component.
- sic
specifies the seasonal-irregular component.
- sc
specifies the seasonal component.
- scstd
specifies the seasonal component standard errors.
- tcs
specifies the trend-cycle-seasonal component.
- ic
specifies the irregular component.
- sa
specifies the seasonally adjusted series.
- pcsa
specifies the percentage of change in seasonally adjusted series.
- tc
specifies the trend component.
- cc
specifies the cycle component.
- OutputArray
specifies a numeric array to receive the result series.
DECOMP.SetSeasonality Method
rc=obj.SetSeasonality (Value);
Sets the length of seasonal cycles for the DECOMP object.
Input Arguments
You must specify the following input argument:
- Value
specifies the length of the seasonal cycle, which must be either an integer greater than 1 or _SEASONALITY_. The predefined symbol _SEASONALITY_ is the length of the seasonal cycle that is computed by using the seasonality or the time ID interval that you specify in a PROC TSMODEL step or a
runTimeCodeaction call. For more information about predefined symbols, see the section "Predefined Symbols" in Chapter 16, TSMODEL Procedure (SAS Visual Forecasting: Forecasting Procedures). For more information about seasonality, see the section "Seasonality in Models" in Chapter 17, Forecasting Details (SAS Visual Forecasting: Time Series Packages). The default value is _SEASONALITY_.