The UCM Procedure

Example 42.10 A Transfer-Function Model for the Italian Traffic Accident Data

(Experimental)

(View the complete code for this example.)

This example is based on a case study described in Pelagatti (2015, chap. 9, sec. 1). In July 2003, Italy introduced a new traffic monitoring system with the aim of improving traffic safety. The case study tried to answer the question, "Was the monitoring system effective in reducing the number of traffic injuries?" The time series plot in Output 42.10.1 shows monthly traffic injuries for the span of January 2001 to December 2013. Visual inspection of the plot clearly shows that the series is seasonal and has an overall downward trend, which appears to be more pronounced after the intervention.

Output 42.10.1: Monthly Traffic Injuries in Italy

Monthly Traffic Injuries in Italy


Pelagatti (2015, chap. 9, sec. 1) suggests the following model for this series:

y Subscript t Baseline equals mu Subscript t Baseline plus psi Subscript t Baseline plus shift 03 beta plus xi Subscript t Baseline plus epsilon Subscript t Baseline

Various terms in the right-hand side of this model are explained as follows:

  • mu Subscript t is the trend component, which is modeled as an integrated random walk.

  • psi Subscript t is the trigonometric seasonal component, which accounts for the monthly seasonality.

  • The effect of the introduction of the monitoring system is modeled using two terms:

    • One term captures a permanent shift, which is a regression effect that is associated with the dummy regressor shift03. This regressor is 0 before July 2003 and 1 thereafter.

    • The other term captures a transient effect that rapidly decays to 0. The transient effect xi Subscript t is a transfer-function effect

      xi Subscript t Baseline equals StartFraction gamma 0 pulse 03 Subscript t Baseline Over left parenthesis 1 minus delta upper B right parenthesis EndFraction

      where pulse03 is a dummy regressor that is 1 at July 2003 and 0 otherwise. In this example, the transfer function xi Subscript t is clearly 0 before July 2003.

  • epsilon Subscript t is the simple irregular component.

The following statements show how to fit this model to the data. The LIKE=MARGINAL option in the ESTIMATE statement causes the parameter estimation to be based on marginal likelihood rather than on diffuse likelihood, which is the default. Since the parameter vector of this model contains delta (the denominator coefficient of the transfer function), the parameter estimations that are based on marginal likelihood and diffuse likelihood can lead to different results. In this example, the results turn out to be similar; however, this is not necessarily the case in general. Generally, parameter estimation that is based on marginal likelihood is the preferred choice in such cases.

proc ucm data=italy;
   id date interval=month;
   model Injured = shift03;
   irregular;
   level variance=0 noest;
   slope;
   season length=12 type=trig;
   tf pulse03 den=1 tfstart=0 plot=smooth;
   estimate plot=(panel residual) like=marginal;
   forecast plot=decomp;
run;

Output 42.10.3 shows the parameter estimates. It shows that soon after the introduction of the monitoring system in July 2003, the accident level decreased by about 5.22 thousand (ModifyingAbove beta With caret plus ModifyingAbove gamma With caret Subscript 0 Baseline equals minus left parenthesis 2.48 plus 2.74 right parenthesis). However, the permanent decrease was only about 2.48 thousand (ModifyingAbove beta With caret equals negative 2.48). The estimate of the decay parameter of the transfer function, delta, is 0.587.

Output 42.10.2: Estimates of the Model Parameters

The UCM Procedure

Final Estimates of the Free Parameters
ComponentParameterEstimateApprox
Std Error
t ValueApprox
Pr > |t|
IrregularError Variance0.554470.092276.01<.0001
SlopeError Variance0.000645860.00045151.430.1526
SeasonError Variance0.000688030.00051901.330.1849
shift03Coefficient-2.479390.70928-3.500.0005
pulse03Coefficient-2.743160.93850-2.920.0035
pulse03DEN_10.587140.178053.300.0010


Output 42.10.3 shows the plot of smoothed estimate of the transfer function xi Subscript t, and Output 42.10.4 shows the plot of the estimate of the trend plus the total effect of the July 2003 intervention.

Output 42.10.3: Decaying Part of the July 2003 Intervention Effect (Smoothed Estimate of xi Subscript t)

Decaying Part of the July 2003 Intervention Effect (Smoothed Estimate of ξt)


Output 42.10.4: Smoothed Estimate of mu Subscript t Baseline plus shift 03 beta plus xi Subscript t Baseline

Smoothed Estimate of μt + shift03 膔 β+ ξt


Finally, the Output 42.10.5 shows the plot of the overall model fit.

Output 42.10.5: Sum of All Model Terms Except the Irregular

Sum of All Model Terms Except the Irregular


Last updated: May 22, 2025