UCM Procedure

Example 41.1 The Airline Series Revisited

(View the complete code for this example.)

The series in this example, the monthly airline passenger series, has already been discussed earlier; see the section A Seasonal Series with Linear Trend. Recall that the series consists of monthly numbers of international airline travelers (from January 1949 to December 1960). Here additional output features of the UCM procedure are illustrated, such as how to use the ESTIMATE and FORECAST statements to limit the span of the data used in parameter estimation and forecasting. The following statements fit a BSM to the logarithm of the airline passenger numbers. The disturbance variance for the slope component is held fixed at value 0; that is, the trend is locally linear with constant slope. In order to evaluate the performance of the fitted model on observed data, some of the observed data are withheld during parameter estimation and forecast computations. The observations in the last two years, years 1959 and 1960, are not used in parameter estimation, while the observations in the last year, year 1960, are not used in the forecasting computations. This is done using the BACK= option in the ESTIMATE and FORECAST statements. In addition, a panel of residual diagnostic plots is obtained using the PLOT=PANEL option in the ESTIMATE statement.

data seriesG;
   set sashelp.air;
   logair = log(air);
run;
proc ucm data = seriesG;
   id date interval = month;
   model logair;
   irregular;
   level;
   slope var = 0 noest;
   season length = 12 type=trig;
   estimate back=24 plot=panel;
   forecast back=12 lead=24 print=forecasts;
run;

The following tables display the summary of data used in estimation and forecasting (Output 41.1.1 and Output 41.1.2). These tables provide simple summary statistics for the estimation and forecast spans; they include useful information such as the beginning and ending dates of the span, the number of nonmissing values, and so on.

Output 41.1.1: Observation Span Used in Parameter Estimation (partial output)

VariableTypeFirstLastNobsMean
logairDependentJAN1949DEC19581205.43035


Output 41.1.2: Observation Span Used in Forecasting (partial output)

VariableTypeFirstLastNobsMean
logairDependentJAN1949DEC19591325.48654


The following tables display the fixed parameters in the model, the preliminary estimates of the free parameters, and the final estimates of the free parameters (Output 41.1.3, Output 41.1.4, and Output 41.1.5).

Output 41.1.3: Fixed Parameters in the Model

The UCM Procedure

Fixed Parameters in the Model
ComponentParameterValue
SlopeError Variance0


Output 41.1.4: Starting Values for the Parameters to Be Estimated

Preliminary Estimates of the Free Parameters
ComponentParameterEstimate
IrregularError Variance6.64120
LevelError Variance2.49045
SeasonError Variance1.26676


Output 41.1.5: Maximum Likelihood Estimates of the Free Parameters

Final Estimates of the Free Parameters
ComponentParameterEstimateApprox
Std Error
t ValueApprox
Pr > |t|
IrregularError Variance0.000186860.00012121.540.1233
LevelError Variance0.000403140.00015662.570.0100
SeasonError Variance0.000003501.66319E-62.100.0354


Two types of goodness-of-fit statistics are reported after a model is fit to the series (see Output 41.1.6 and Output 41.1.7). The first type is the likelihood-based goodness-of-fit statistics, which include the full likelihood of the data, the diffuse portion of the likelihood (see the section Details: UCM Procedure), and the information criteria. The second type of statistics is based on the raw residuals, residual = observed – predicted. If the model is nonstationary, then one-step-ahead predictions are not available for some initial observations, and the number of values used in computing these fit statistics will be different from those used in computing the likelihood-based test statistics.

Output 41.1.6: Likelihood-Based Fit Statistics for the Airline Data

Likelihood Based Fit Statistics
StatisticValue
Diffuse Log Likelihood180.63
Diffuse Part of Log Likelihood-13.93
Non-Missing Observations Used120
Estimated Parameters3
Initialized Diffuse State Elements13
Normalized Residual Sum of Squares107
AIC (smaller is better)-355.3
BIC (smaller is better)-347.2
AICC (smaller is better)-355
HQIC (smaller is better)-352
CAIC (smaller is better)-344.2


Output 41.1.7: Residuals-Based Fit Statistics for the Airline Data

Fit Statistics Based on Residuals
Mean Squared Error0.00156
Root Mean Squared Error0.03944
Mean Absolute Percentage Error0.57677
Maximum Percent Error2.19396
R-Square0.98705
Adjusted R-Square0.98680
Random Walk R-Square0.86370
Amemiya's Adjusted R-Square0.98630
Number of non-missing residuals used for computing the fit statistics = 107


The diagnostic plots based on the one-step-ahead residuals are shown in Output 41.1.8. The residual histogram and the Q-Q plot show no reasons to question the approximate normality of the residual distribution. The remaining plots check for the whiteness of the residuals. The sample correlation plots, the autocorrelation function (ACF) and the partial autocorrelation function (PACF), also do not show any significant violations of the whiteness of the residuals. Therefore, on the whole, the model seems to fit the data well.

Output 41.1.8: Residual Diagnostics for the Airline Series Using a BSM

Residual Diagnostics for the Airline Series Using a BSM


The forecasts are given in Output 41.1.9. In order to save the space, the upper and lower confidence limit columns are dropped from the output, and only the rows corresponding to the year 1960 are shown. Recall that the actual measurements in the years 1959 and 1960 were withheld during the parameter estimation, and the ones in 1960 were not used in the forecast computations.

Output 41.1.9: Forecasts for the Airline Data

ObsdateForecastStdErrlogairResidual
133JAN606.0500.0386.033-0.017
134FEB605.9960.0445.969-0.027
135MAR606.1560.0496.038-0.118
136APR606.1240.0536.1330.010
137MAY606.1680.0586.157-0.011
138JUN606.3030.0616.282-0.021
139JUL606.4350.0656.433-0.002
140AUG606.4500.0686.407-0.043
141SEP606.2650.0716.230-0.035
142OCT606.1380.0736.133-0.005
143NOV606.0150.0755.966-0.049
144DEC606.1210.0776.068-0.053


Output 41.1.10 shows the forecast plot. The forecasts in the year 1960 show that the model predictions were quite good.

Output 41.1.10: Forecast Plot of the Airline Series Using a BSM

Forecast Plot of the Airline Series Using a BSM


Last updated: June 19, 2025