TSBAYSEA Call |
The TSBAYSEA subroutine performs Bayesian seasonal adjustment modeling.
The input arguments to the TSBAYSEA subroutine are as follows:
specifies a (or ) data vector.
specifies the order of trend differencing. The default is order=2.
specifies the order of seasonal differencing. The default is sorder=1.
specifies the rigidity of the seasonal pattern. The default is rigid=1.
specifies the length of the forecast beyond the available observations. The default is npred=0.
specifies the options vector.
specifies the number of seasonal periods (speriod). By default, opt[1]=12.
specifies the year when the series starts (year). If opt[2]=0, there will be no trading day adjustment. By default, opt[2]=0.
specifies the month when the series starts (month). If opt[2]=0, this option is ignored. By default, opt[3]=1.
specifies the upper limit value for outlier determination (rlim). Outliers are considered as missing values. If this value is less than or equal to 0, TSBAYSEA assumes that the input data does not contain outliers. The default is rlim=0. See the section Missing Values.
refers to the number of time periods processed at one time (span). The default is opt[5]=4.
specifies the number of time periods to be shifted (shift). By default, opt[6]=1.
controls the transformation of the original series (logt). If opt[7]=1, log transformation is requested. No transformation (opt[7]=0) is the default.
specifies control values for the TSBAYSEA subroutine. These values are automatically set. Be careful if you change these values.
controls the adaptivity of the trading day adjustment component (wtrd). The default is cntl[1]=1.0.
controls the sum of seasonal components within a period (zersum). The larger the value of cntl[2], the closer to zero this sum is. By default, cntl[2]=1.0.
controls the leap year effect (delta). The default is cntl[3]=7.0.
specifies the prior variance of the initial trend (alpha). The default is cntl[4]=0.01.
specifies the prior variance of the initial seasonal component (beta). The default is cntl[5]=0.01.
specifies the prior variance of the initial sum of seasonal components (gamma). The default is cntl[6]=0.01.
requests the power spectrum and the estimated and forecast values of time series components. If print=2, the spectra of irregular, differenced trend and seasonal series are printed, together with estimates and forecast values. If print=1, only the estimates and forecast values of time series components are printed.
If print=0, printed output is suppressed. The default is print=0.
The TSBAYSEA subroutine returns the following values:
refers to the estimate and forecast of the trend component.
refers to the estimate and forecast of the seasonal component.
refers to the smoothed and forecast values of the time series.
refers to the seasonally adjusted series.
refers to the value of ABIC from the final estimates.
The TSBAYSEA subroutine performs Bayesian seasonal adjustments. The smoothness of the trend and seasonal components is controlled by the prior distribution. The Akaike Bayesian information criterion (ABIC) is defined to compare with alternative models. The basic TSBAYSEA procedure processes the block of data in which the length is SPAN*SPERIOD, while the first block of data consists of length (2*SPAN-1)*SPERIOD. The block of data is shifted successively by SHIFT*SPERIOD.
The TSBAYSEA subroutine decomposes the series into the following form:
where is a trend component, denotes a seasonal component, and is an irregular component. To estimate the seasonal and trend components, some constraints are imposed such that the sum of squares of , , and is small, where and are difference operators. Then the solution can be obtained by minimizing
where measures the smoothness of the trend and seasonality, measures the smoothness of the trend, and is a smoothness constant for the sum of the seasonal variability. The value of is estimated while the constants, and , are chosen a priori. The value of is equal to , and the constant is determined as ZERSUM*RIGID/SPERIOD. The larger the constant RIGID, the more rigid the seasonal pattern is. See the section Bayesian Constrained Least Squares for more information.
To analyze the monthly data with rigidity 0.5, you can specify either of the following two statements:
call tsbaysea(trend,season,series,adj,abic) data=z order=2 sorder=1 rigid=0.5 npred=10 print=2;
call tsbaysea(trend,season,series,adj,abic,z,2,1,0.5,10,,,2);
The TREND, SEASON, and SERIES components contain 10-period-ahead forecast values in addition to the smoothed estimates. The detailed result is also printed since the PRINT=2 option is specified.