The MODEL Procedure

Solution Mode Output

The following SAS statements dynamically forecast the solution to a nonlinear equation:

proc model data=sashelp.citimon;
   parameters a 0.010708  b  -0.478849 c 0.929304;
   lhur = 1/(a * ip) + b + c * lag(lhur);
   solve lhur / out=sim forecast dynamic;
run;

The first page of output produced by the SOLVE step is shown in Figure 79. This is the summary description of the model. The error message states that the simulation was aborted at observation 144 because of missing input values.

Figure 79: Solve Step Summary Output

The MODEL Procedure

Model Summary
Model Variables1
Parameters3
Equations1
Number of Statements1
Program Lag Length1

Model VariablesLHUR
Parameters(Value)a(0.010708) b(-0.478849) c(0.929304)
EquationsLHUR


The second page of output, shown in Figure 80, gives more information about the failed observation.

Figure 80: Solve Step Error Message

The MODEL Procedure
Dynamic Single-Equation Forecast


Solution values are missing because of missing input values for observation 144 at NEWTON iteration 0.


Note:Additional information on the values of the variables at this observation, which may be helpful in determining the cause of the failure of the solution process, is printed below.

Observation144Iteration0CC-1.000000
  Missing1  


Iteration Errors - Missing.

                              The MODEL Procedure                               
                        Dynamic Single-Equation Forecast                        
                                                                                
                     --- Listing of Program Data Vector ---                     
_N_:                144     ACTUAL.LHUR:          .     ERROR.LHUR:           . 
IP:                   .     LHUR:           7.10000     PRED.LHUR:            . 
a:              0.01071     b:             -0.47885     c:              0.92930 
                                                                                


Note:Simulation aborted.


From the program data vector, you can see the variable IP is missing for observation 144. LHUR could not be computed, so the simulation aborted.

The solution summary table is shown in Figure 81.

Figure 81: Solution Summary Report

The MODEL Procedure
Dynamic Single-Equation Forecast

Data Set Options
DATA=SASHELP.CITIMON
OUT=SIM

Solution Summary
Variables Solved1
Forecast Lag Length1
Solution MethodNEWTON
CONVERGE=1E-8
Maximum CC0
Maximum Iterations1
Total Iterations143
Average Iterations1

Observations Processed
Read145
Lagged1
Solved143
First2
Last145
Failed1

Variables Solved ForLHUR


This solution summary table includes the names of the input data set and the output data set followed by a description of the model. The table also indicates that the solution method defaulted to Newton’s method. The remaining output is defined as follows:

Maximum CC is the maximum convergence value accepted by the Newton
procedure. This number is always less than the value
for the CONVERGE= option.
Maximum Iterations is the maximum number of Newton iterations performed
at each observation and each replication of Monte
Carlo simulations.
Total Iterations is the sum of the number of iterations required for each
observation and each Monte Carlo simulation.
Average Iterations is the average number of Newton iterations required to
solve the system at each step.
Solved is the number of observations used times the number of
random replications selected plus one, for Monte Carlo
simulations. The one additional simulation is the original
unperturbed solution. For simulations that do not involve Monte
Carlo, this number is the number of observations used.

Summary Statistics

The STATS and THEIL options are used to select goodness-of-fit statistics. Actual values must be provided in the input data set for these statistics to be printed. When the RANDOM= option is specified, the statistics do not include the unperturbed (_REP_=0) solution.

STATS Option Output

The following statements show the addition of the STATS and THEIL options to the model in the previous section:

proc model data=sashelp.citimon;
   parameters a 0.010708  b  -0.478849 c 0.929304;
   lhur= 1/(a * ip) + b + c * lag(lhur) ;
   solve lhur / out=sim dynamic stats theil;
   range date to '01nov91'd;
run;

The STATS output in Figure 82 and the THEIL output in Figure 83 are generated.

Figure 82: STATS Output

The MODEL Procedure
Dynamic Single-Equation Simulation
 
Solution Range DATE = FEB1980 To NOV1991

Descriptive Statistics
VariableN ObsNActualPredictedLabel
MeanStd DevMeanStd Dev
LHUR1421427.08871.45097.24731.1465UNEMPLOYMENT RATE: ALL WORKERS, 16 YEARS

Statistics of fit
VariableNMean ErrorMean % ErrorMean Abs ErrorMean Abs % ErrorRMS ErrorRMS % ErrorR-SquareLabel
LHUR1420.15853.52890.693710.00010.785411.24520.7049UNEMPLOYMENT RATE: ALL WORKERS, 16 YEARS


The number of observations (Nobs), the number of observations with both predicted and actual values nonmissing (N), and the mean and standard deviation of the actual and predicted values of the determined variables are printed first. The next set of columns in the output are defined as follows:

Mean Error StartFraction 1 Over upper N EndFraction sigma-summation Underscript j equals 1 Overscript upper N Endscripts left-parenthesis ModifyingAbove y With caret Subscript j Baseline minus y Subscript j Baseline right-parenthesis
Mean % Error StartFraction 100 Over upper N EndFraction sigma-summation Underscript j equals 1 Overscript upper N Endscripts left-parenthesis ModifyingAbove y With caret Subscript j Baseline minus y Subscript j Baseline right-parenthesis slash y Subscript j
Mean Abs Error StartFraction 1 Over upper N EndFraction sigma-summation Underscript j equals 1 Overscript upper N Endscripts StartAbsoluteValue ModifyingAbove y With caret Subscript j Baseline minus y Subscript j Baseline EndAbsoluteValue
Mean Abs % Error StartFraction 100 Over upper N EndFraction sigma-summation Underscript j equals 1 Overscript upper N Endscripts StartAbsoluteValue left-parenthesis ModifyingAbove y With caret Subscript j Baseline minus y Subscript j Baseline right-parenthesis slash y Subscript j Baseline EndAbsoluteValue
RMS Error StartRoot StartFraction 1 Over upper N EndFraction sigma-summation Underscript j equals 1 Overscript upper N Endscripts left-parenthesis ModifyingAbove y With caret Subscript j Baseline minus y Subscript j Baseline right-parenthesis squared EndRoot
RMS % Error 100 StartRoot StartFraction 1 Over upper N EndFraction sigma-summation Underscript j equals 1 Overscript upper N Endscripts left-parenthesis left-parenthesis ModifyingAbove y With caret Subscript j Baseline minus y Subscript j Baseline right-parenthesis slash y Subscript j Baseline right-parenthesis squared EndRoot
R-square 1 minus normal upper S normal upper S normal upper E slash normal upper C normal upper S normal upper S normal upper A
SSE sigma-summation Underscript j equals 1 Overscript upper N Endscripts left-parenthesis ModifyingAbove y With caret Subscript j Baseline minus y Subscript j Baseline right-parenthesis squared
SSA sigma-summation Underscript j equals 1 Overscript upper N Endscripts left-parenthesis y Subscript j Baseline right-parenthesis squared
CSSA normal upper S normal upper S normal upper A minus left-parenthesis sigma-summation Underscript j equals 1 Overscript upper N Endscripts y Subscript j Baseline right-parenthesis squared
ModifyingAbove y With caret predicted value
y actual value

When the RANDOM= option is specified, the statistics do not include the unperturbed (_REP_=0) solution.

THEIL Option Output

The THEIL option specifies that Theil forecast error statistics be computed for the actual and predicted values and for the relative changes from lagged values. Mathematically, the quantities are

where ModifyingAbove y c With caret is the relative change for the predicted value and y c is the relative change for the actual value.

Figure 83: THEIL Output

Theil Forecast Error Statistics
VariableNMSECorr (R)MSE Decomposition ProportionsInequality CoefLabel
Bias (UM)Reg (UR)Dist (UD)Var (US)Covar (UC)U1U
LHUR1420.61680.850.040.010.950.150.810.10860.0539UNEMPLOYMENT RATE: ALL WORKERS, 16 YEARS

Theil Relative Change Forecast Error Statistics
VariableRelative ChangeMSE Decomposition ProportionsInequality CoefLabel
NMSECorr (R)Bias (UM)Reg (UR)Dist (UD)Var (US)Covar (UC)U1U
LHUR1420.0126-0.080.090.850.060.430.474.12260.8348UNEMPLOYMENT RATE: ALL WORKERS, 16 YEARS


The columns have the following meaning:

Corr (R)

is the correlation coefficient, rho, between the actual and predicted values.

where sigma Subscript p and sigma Subscript a are the standard deviations of the predicted and actual values.

Bias (UM)

is an indication of systematic error and measures the extent to which the average values of the actual and predicted deviate from each other.

Reg (UR)

is defined as left-parenthesis sigma Subscript p Baseline minus rho asterisk sigma Subscript a Baseline right-parenthesis squared slash normal upper M normal upper S normal upper E. Consider the regression

If ModifyingAbove beta With caret equals 1, UR will equal zero.

Dist (UD)

is defined as left-parenthesis 1 minus rho squared right-parenthesis sigma Subscript a Baseline sigma Subscript a slash normal upper M normal upper S normal upper E and represents the variance of the residuals obtained by regressing y c on ModifyingAbove y c With caret.

Var (US)

is the variance proportion. US indicates the ability of the model to replicate the degree of variability in the endogenous variable.

Covar (UC)

represents the remaining error after deviations from average values and average variabilities have been accounted for.

U1

is a statistic that measures the accuracy of a forecast defined as follows:

U

is the Theil’s inequality coefficient defined as follows:

MSE

is the mean square error. In the case of the relative change Theil statistics, the MSE is computed as follows:

For more information about these statistics, see Maddala (1977, pp. 344–347) and Pindyck and Rubinfeld (1981, pp. 364–365).

Last updated: August 11, 2020