performs Bayesian seasonal adjustment modeling
- CALL TSBAYSEA( trend, season, series, adjust, abic, data
The inputs to the TSBAYSEA subroutine are as follows:
- <,order, sorder, rigid, npred,
opt, cntl, print>);
The TSBAYSEA subroutine returns the following values:
- specifies a T ×1 (or 1 ×T) 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=12.
- specifies the year when the series starts (year).
If opt=0, there will be no trading day adjustment.
By default, opt=0.
- specifies the month when the series starts (month).
If opt=0, this option is ignored.
By default, opt=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 "Missing Values" section.
- refers to the number of time periods
processed at one time (span).
The default is opt=4.
- specifies the number of time
periods to be shifted (shift).
By default, opt=1.
- controls the transformation of
the original series (logt).
If opt=1, log transformation is requested.
No transformation (opt=0) is the default.
- specifies control values for the TSBAYSEA subroutine.
These values will be automatically set.
Be careful if you change these values.
- controls the adaptivity of the trading
day adjustment component (wtrd).
The default is cntl=1.0.
- controls the sum of seasonal components
within a period (zersum).
The larger the value of cntl,
the closer to zero this sum is.
By default, cntl=1.0.
- controls the leap year effect (delta).
The default is cntl=7.0.
- specifies the prior variance of
the initial trend (alpha).
The default is cntl=0.01.
- specifies the prior variance of the
initial seasonal component (beta).
The default is cntl=0.01. [.03in]
- specifies the prior variance of the initial
sum of seasonal components (gamma).
The default is cntl=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.
- 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.
Bayesian seasonal adjustments are
performed with the TSBAYSEA subroutine.
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 call decomposes the
series yt into the following form:
where Tt is a trend component, St 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 d measures the smoothness of the trend and seasonality,
s measures the smoothness of the trend, and z is a
smoothness constant for the sum of the seasonal variability.
The value of d is estimated while the
constants, s and z, are chosen a priori.
The value of s is equal to [1/RIGID], and the
constant z is determined as ZERSUM*RIGID/SPERIOD1/2.
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
call tsbaysea(trend,season,series,adj,abic) data=z order=2
sorder=1 rigid=0.5 npred=10 print=2;
The TREND, SEASON, and SERIES components contain 10-period-ahead
forecast values as well as the smoothed estimates.
The detailed result is also printed
since the PRINT=2 option is specified.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.