Time Series Analysis Package
SEASONALDECOMP Method
rc = TSA.SEASONALDECOMP (y, s, 'mode', <lambda>, <tcc>, <sic>, <sc>, <scstd>, <tcs>, <ic>, <sa>, <pcsa>, <tc>, <cc>);
The SEASONALDECOMP function performs the seasonal decomposition or analysis of the time series arrays, and it outputs the values and results.
Required Arguments
You must specify the following arguments, separated by commas:
- y
specifies the times series array to decompose.
- s
specifies the length of the seasonal cycle, where s 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).- 'mode'
-
specifies the type of decomposition to be used to decompose the time series.
You can specify the following values within single quotation marks:
- ADD ADDITIVE
specifies additive decomposition.
- LOGADD LOGADDITIVE
specifies log-additive decomposition.
- MULT MULTIPLICATIVE
specifies multiplicative decomposition.
- MULTORADD
specifies multiplicative or additive decomposition, depending on data.
- PSEUDOADD PSEUDOADDITIVE
specifies pseudo-additive decomposition.
Optional Arguments
You can also specify the following argument, separated by a comma from arguments that precede it. If you want to use a default value for this argument, enter a space for it.
- lambda
specifies the Hodrick-Prescott filter parameter for trend-cycle decomposition. The default value is 1,600. Filtering applies when the trend component or the cycle component is requested. If filtering is not specified, this option is ignored.
Returned Values
The SEASONALDECOMP function returns the following values:
- rc
-
returns one of the following scalar return codes:
rc Termination Reason 0 Success < 0 Computational failure
Optional Returned Values
You can also specify the following arguments, separated by commas, to request additional returned values. If you do not want the value to be returned, enter a space for it.
- 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.
Example
This example uses the TSMODEL procedure to compute the seasonal indices on the time series array Air:
proc tsmodel data=mylib.air outarray=mylib.outarray;
id date interval=month;
var air;
outarrays ADJUSTED;
require tsa;
submit;
declare object TSA(tsa);
rc=TSA.SEASONALDECOMP(air, _SEASONALITY_, 'ADD', , , , , , , , ADJUSTED, , , );
endsubmit;
run;