Chapter Contents |
Previous |
Next |
The MODEL Procedure |
In the following example, the variable y is modeled as a linear function of x, the first lag of x, the second lag of x, and so forth:
Models of this sort can introduce a great many parameters for the lags, and there may not be enough data to compute accurate independent estimates for them all. Often, the number of parameters is reduced by assuming that the lag coefficients follow some pattern. One common assumption is that the lag coefficients follow a polynomial in the lag length
where d is the degree of the polynomial used. Models of this kind are called Almon lag models, polynomial distributed lag models, or PDLs for short. For example, Figure 14.53 shows the lag distribution that can be modeled with a low order polynomial. Endpoint restrictions can be imposed on a PDL to require that the lag coefficients be 0 at the 0th lag, or at the final lag, or at both.
Figure 14.53: Polynomial Distributed Lags
For linear single-equation models, SAS/ETS software includes the PDLREG procedure for estimating PDL models. See Chapter 15, "The PDLREG Procedure," for a more detailed discussion of polynomial distributed lags and an explanation of endpoint restrictions.
Polynomial and other distributed lag models can be estimated and simulated or forecast with PROC MODEL. For polynomial distributed lags, the %PDL macro can generate the needed programming statements automatically.
To use the %PDL macro in a model program, you first call it to declare the lag distribution; later, you call it again to apply the PDL to a variable or expression. The first call generates a PARMS statement for the polynomial parameters and assignment statements to compute the lag coefficients. The second call generates an expression that applies the lag coefficients to the lags of the specified variable or expression. A PDL can be declared only once, but it can be used any number of times (that is, the second call can be repeated).
The initial declaratory call has the general form
The later calls to apply the PDL have the general form
%PDL( pdlname, expression )
where pdlname is the name of the PDL and expression is the variable or expression to which the PDL is to be applied. The pdlname given must be the same as the name used to declare the PDL.
The following statements produce the output in Figure 14.54:
proc model data=in list; parms int pz; %pdl(xpdl,5,2); y = int + pz * z + %pdl(xpdl,x); %ar(y,2,M=ULS); id i; fit y / out=model1 outresid converge=1e-6; run;
This second example models two variables, Y1 and Y2, and uses two PDLs:
proc model data=in; parms int1 int2; %pdl( logxpdl, 5, 3 ) %pdl( zpdl, 6, 4 ) y1 = int1 + %pdl( logxpdl, log(x) ) + %pdl( zpdl, z ); y2 = int2 + %pdl( zpdl, z ); fit y1 y2; run;
A (5,3) PDL of the log of X is used in the equation for Y1. A (6,4) PDL of Z is used in the equations for both Y1 and Y2. Since the same ZPDL is used in both equations, the lag coefficients for Z are the same for the Y1 and Y2 equations, and the polynomial parameters for ZPDL are shared by the two equations. See Example 14.5 for a complete example and comparison with PDLREG.
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.