UCM Procedure

Example 30.8 ARIMA Modeling

This example shows how you can use the UCM procedure for ARIMA modeling. The parameter estimates and predictions for ARIMA models obtained by using PROC UCM will be close to those obtained by using PROC ARIMA (in the presence of the ML option in its ESTIMATE statement) if the model is stationary or if the model is nonstationary and there are no missing values in the data. For more information about the ARIMA procedure, see Chapter 7, ARIMA Procedure (SAS/ETS User's Guide). However, if there are missing values in the data and the model is nonstationary, then the UCM and ARIMA procedures can produce significantly different parameter estimates and predictions. An article by Kohn and Ansley (1986) suggests a statistically sound method of estimation, prediction, and interpolation for nonstationary ARIMA models with missing data. This method is based on an algorithm that is equivalent to the Kalman filtering and smoothing algorithm used in the UCM procedure. The results of an illustrative example in their article are reproduced here using the UCM procedure. In this example an ARIMA(0,1,1)times(0,1,1)Subscript 12 model is applied to the logarithm of the air series in the sashelp.air data set. Four different missing value patterns are considered to highlight different aspects of the problem:

  • mylib.Data1. The full data set of 144 observations.

  • mylib.Data2. The set of 78 observations that omit January through November in each of the last 6 years.

  • mylib.Data3. The data set with the 5 observations July 1949, June, July, and August 1957, and July 1960 missing.

  • mylib.Data4. The data set with all July observations missing and June and August 1957 also missing.

The following DATA steps create these data sets:


data mylib.Data1;
   set sashelp.air;
   logair = log(air);
run;

data mylib.Data2;
   set mylib.data1;
   if year(date) >= 1955 and month(date) < 12 then logair = .;
run;

data mylib.Data3;
   set mylib.data1;
   if (year(date) = 1949 and month(date) = 7) then logair = .;
   if ( year(date) = 1957 and
       (month(date) = 6 or month(date) = 7 or month(date) = 8))
       then logair = .;
   if (year(date) = 1960 and month(date) = 7) then logair = .;
run;

data mylib.Data4;
   set mylib.data1;
   if month(date) = 7 then logair = .;
   if year(date) = 1957 and (month(date) = 6 or month(date) = 8)
      then logair = .;
run;

The following statements specify the ARIMAleft parenthesis 0 comma 1 comma 1 right parenthesis times left parenthesis 0 comma 1 comma 1 right parenthesis Subscript 12 model for the logair series in the first data set (mylib.Data1):


proc ucm data=mylib.Data1;
   id date interval=month;
   model logair;
   irregular q=1 sq=1 s=12;
   deplag lags=(1)(12) phi=1 1 noest;
   estimate outest=mylib.est1;
   forecast outfor=mylib.for1;
run;

Note that the moving average part of the model is specified by using the Q=, SQ=, and S= options in the IRREGULAR statement and the differencing operator, left parenthesis 1 minus upper B right parenthesis left parenthesis 1 minus upper B Superscript 12 Baseline right parenthesis, is specified by using the DEPLAG statement. The model does not contain an intercept term; therefore no LEVEL statement is needed. The parameter estimates are saved in a data set EST1 by using the OUTEST= option in the ESTIMATE statement and the forecasts and the component estimates are saved in a data set FOR1 by using the OUTFOR= option in the FORECAST statement. The same analysis is performed on the other three data sets, but is not shown here.

Output 30.8.1 resembles Table 1 in Kohn and Ansley (1986). This table is generated by merging the parameter estimates from the four analyses. Only the moving average parameter estimates and their standard errors are reported. The columns EST1 and STD1 correspond to the estimates for mylib.Data1. The parameter estimates and their standard errors for other three data sets are similarly named. Note that the parameter estimates closely match the parameter estimates in the article. However, their standard errors differ slightly. This difference could be the result of different ways of computing the Hessian at the optimum. The white-noise error variance estimates are not reported here, but they agree quite closely with those in the article.

Output 30.8.1: Data Sets 1–4: Parameter Estimates and Standard Errors

parameterest1std1est2std2est3std3est4std4
MA_10.4020.0900.4570.1210.4080.0920.4310.091
SMA_10.5570.0730.7580.2360.5660.0750.5730.074


Output 30.8.2 resembles Table 2 in Kohn and Ansley (1986). It contains forecasts and their standard errors for the four data sets. The numbers are very close to those in the article.

Output 30.8.2: Data Sets 1–4: Forecasts and Standard Errors

DATEfor1std1for2std2for3std3for4std4
JAN616.1100.0376.0840.0526.1100.0376.1110.037
FEB616.0540.0436.0910.0586.0540.0436.0550.043
MAR616.1720.0486.2470.0636.1730.0486.1740.048
APR616.1990.0536.2050.0686.1990.0536.2000.052
MAY616.2330.0576.1990.0726.2320.0586.2330.056
JUN616.3690.0616.3080.0766.3670.0626.3680.060
JUL616.5070.0656.4090.0796.4970.067..
AUG616.5030.0696.4140.0826.5030.0696.5030.067
SEP616.3250.0726.2990.0856.3250.0726.3260.071
OCT616.2090.0756.1740.0876.2090.0766.2090.074
NOV616.0630.0796.0430.0896.0640.0796.0640.077
DEC616.1680.0826.1740.0866.1680.0826.1690.080


Output 30.8.3 is based on Data2. It resembles Table 3 in Kohn and Ansley (1986). The columns S_SERIES and VS_SERIES in the OUTFOR= data set contain the interpolated values of logair and their variances. The estimate column in Output 30.8.3 reports interpolated values (which are the same as S_SERIES), and the std column reports their standard errors (which are computed as square root of VS_SERIES) for January–November 1957. The actual logair values for these months, which are missing in Data2, are also provided for comparison. The numbers are very close to those in the article.

Output 30.8.3: Data Set 2: Interpolated Values and Standard Errors

DATElogairestimatestd
JAN575.7535.7330.045
FEB575.7075.7380.049
MAR575.8755.8930.052
APR575.8525.8500.054
MAY575.8725.8430.055
JUN576.0455.9510.055
JUL576.1426.0510.055
AUG576.1466.0550.054
SEP576.0015.9380.052
OCT575.8495.8120.049
NOV575.7205.6800.045


Output 30.8.4 resembles Table 4 in Kohn and Ansley (1986). These numbers are based on Data3, and they also are very close to those in the article.

Output 30.8.4: Data Set 3: Interpolated Values and Standard Errors

DATElogairestimatestd
JUL494.9975.0130.031
JUN576.0456.0240.030
JUL576.1426.1470.031
AUG576.1466.1480.030
JUL606.4336.4090.031


Output 30.8.5 resembles Table 5 in Kohn and Ansley (1986). As before, the numbers are very close to those in the article.

Output 30.8.5: Data Set 4: Interpolated Values and Standard Errors

DATElogairestimatestd
JUN576.0456.0230.030
AUG576.1466.1470.030


The similarity between the outputs in this example and the results shown in Kohn and Ansley (1986) demonstrate that PROC UCM can be effectively used for nonstationary ARIMA models with missing data.

Last updated: July 09, 2026