Chapter Contents |
Previous |
Next |
The MODEL Procedure |
y = a + b*x;is encountered, it is translated into the equations
PRED.y = a + b*x; RESID.y = PRED.y - ACTUAL.y; ERROR.y = PRED.y - y;If the same system is expressed as the following general-form equation, then this equation is used unchanged.
EQ.y = y - a + b*x;This makes it easy to solve for arbitrary variables and to modify the error terms for autoregressive or moving average models.
Use the LIST option to see how this transformation is performed. For example, the following statements produce the listing shown in Figure 14.72.
proc model data=line list; y = a1 + b1*x1 + c1*x2; fit y; run;
PRED.Y is the predicted value of Y, and ACTUAL.Y is the value of Y in the data set. The predicted value minus the actual value, RESID.Y, is then the error term, ,for the original Y equation. ACTUAL.Y and Y have the same value for parameter estimation. For solve tasks, ACTUAL.Y is still the value of Y in the data set but Y becomes the solved value; the value that satisfies PRED.Y - Y = 0.
The following are the equation variable definitions.
GMM_H.name = RESID.name**2 - H.name;
demret = intercept ; if ( _OBS_ = 1 ) then h.demret = arch0 + arch1 * mse.demret + garch1 * mse.demret; else h.demret = arch0 + arch1 * zlag( resid.demret ** 2) + garch1 * zlag(h.demret) ;
NRESID.name = RESID.name/ sqrt(H.name);
The three equation variable prefixes, RESID., ERROR., and EQ. allow for control over the objective function for the FIT, the SOLVE, or both the FIT and the SOLVE stages. For FIT tasks, PROC MODEL looks first for a RESID.name variable for each equation. If defined, the RESID-prefixed equation variable is used to define the objective function for the parameter estimation process. Otherwise, PROC MODEL looks for an EQ-prefixed variable for the equation and uses it instead.
For SOLVE tasks, PROC MODEL looks first for an ERROR.name variable for each equation. If defined, the ERROR-prefixed equation variable is used for the solution process. Otherwise, PROC MODEL looks for an EQ-prefixed variable for the equation and uses it instead. To solve the simultaneous equation system, PROC MODEL computes values of the solution variables (the model variables being solved for) that make all of the ERROR.name and EQ.name variables close to 0.
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.