Time Series Analysis and Examples


Time Series Analysis and Control Subroutines

This section describes an adaptation of parts of the Time Series Analysis and Control (TIMSAC) package, which was developed by the Institute of Statistical Mathematics (ISM) in Japan (Kitagawa and Akaike 1981; Ishiguro 1987).

Selected routines from the TIMSAC package were converted by SAS Institute staff into SAS/IML routines under an agreement between SAS Institute and ISM. Credit for authorship of these TIMSAC SAS/IML routines goes to ISM, which has agreed to make them available to SAS users without charge.

There are four packages of TIMSAC programs. For more information about the TIMSAC package produced by ISM, see the section ISM TIMSAC Packages. Because these SAS/IML time series analysis subroutines are adapted from the corresponding FORTRAN subroutines in the TIMSAC package produced by ISM, they are collectively referred to in this chapter as "the TIMSAC subroutines."

The output of these routines is not integrated into the SAS ODS system because the FORTRAN routines print directly to the SAS listing. The output appears on the Results tab in SAS Enterprise Guide software or in the Output window of the SAS windowing environment. (Select ViewOutput to display the Output window.) The output also appears in the Output window of SAS/IML Studio. However, you cannot use the ODS system to select or exclude output from these routines, nor can you view the output in ODS destinations such as HTML, PDF, or RTF.

The subroutines analyze and forecast univariate and multivariate time series data. They also analyze nonstationary time series and seasonal adjustment models. These subroutines contain the Bayesian modeling of seasonal adjustment and changing spectrum estimation.

Discrete time series modeling has been widely used to analyze dynamic systems in economics, engineering, and statistics. The Box-Jenkins and Box-Tiao approaches are classical examples of unified time series analysis through identification, estimation, and forecasting (or control). The ARIMA procedure in SAS/ETS software uses these approaches. Bayesian methods are being increasingly applied despite the controversial issues that arise in choosing a prior distribution.

The fundamental idea of the Bayesian method is that uncertainties can be explained by probabilities. If there is a class model $(\Omega )$ that consists of sets of member models ($\omega $), you can describe the uncertainty of $\Omega $ by using a prior distribution of $\omega $. The member model $\omega $ is directly related to model parameters. Let the prior probability density function be $p(\omega )$. When you observe the data $\mb{y}$ that are generated from the model $\Omega $, the data distribution is described as $p(Y|\omega )$, given the unknown $\omega $ with a prior probability density $p(\omega )$, where the function $p(Y|\omega )$ is the usual likelihood function. Then the posterior distribution is the updated prior distribution, given the sample information. The posterior probability density function is proportional to observed likelihood function $\times $ prior density function.

The TIMSAC subroutines contain various time series analysis and Bayesian models. Most of the subroutines are based on the minimum Akaike information criterion (AIC) or on the minimum Akaike Bayesian information criterion (ABIC) method to determine the best model among alternative models. The TSBAYSEA subroutine is a typical example of Bayesian modeling. The following subroutines are supported:

CALL TSBAYSEA

Bayesian seasonal adjustment modeling

CALL TSDECOMP

time series decomposition analysis

CALL TSMLOCAR

locally stationary univariate AR model fitting

CALL TSMLOMAR

locally stationary multivariate AR model fitting

CALL TSMULMAR

multivariate AR model fitting

CALL TSPEARS

periodic AR model fitting

CALL TSPRED

ARMA model forecasting and forecast error variance

CALL TSROOT

polynomial roots or ARMA coefficients computation

CALL TSTVCAR

time-varying coefficient AR model estimation

CALL TSUNIMAR

univariate AR model fitting

For univariate and multivariate autoregressive model estimation, the least squares method is used. The least squares estimate is an approximate maximum likelihood estimate if error disturbances are assumed to be Gaussian. The least squares method is performed by using the Householder transformation method. For more information, see the section Least Squares and Householder Transformation.

The TSUNIMAR and TSMULMAR subroutines estimate the autoregressive models and select the appropriate AR order automatically by using the minimum AIC method. The TSMLOCAR and TSMLOMAR subroutines analyze the nonstationary time series data. The Bayesian time-varying AR coefficient model (TSTVCAR) offers another nonstationary time series analysis method. The state space and Kalman filter method is systematically applied to the smoothness priors models (TSDECOMP and TSTVCAR), which have stochastically perturbed difference equation constraints. The TSBAYSEA subroutine provides a way of handling Bayesian seasonal adjustment, and it can be an alternative to the X11 procedure in SAS/ETS. The TSBAYSEA subroutine employs the smoothness priors idea through constrained least squares estimation, whereas the TSDECOMP and TSTVCAR subroutines estimate the smoothness trade-off parameters by using the state space model and Kalman filter recursive computation. The TSPRED subroutine computes the one-step or multistep predicted values of the ARMA time series model. In addition, the TSPRED subroutine computes forecast error variances and impulse response functions. The TSROOT subroutine computes the AR and MA coefficients, given the characteristic roots of the polynomial equation and the characteristic roots of the AR or MA model.