PROC MODEL might terminate abnormally when the RESTRICT statement and the OPTIMIZE option in the SOLVE statement are specified


PROC MODEL might generate error messages when all of the following conditions are met:

Possible messages are:

ERROR: An exception has been encountered.
Please contact technical support and provide them with the following traceback information:
 
The SAS task name is [MODEL]
Exception occurred at (0C4A8C94)
Task Traceback

ERROR: Read Access Violation MODEL

If the expression in the RESTRICT statement can also be specified using the BOUNDS statement, then you can circumvent the problem by replacing the RESTRICT statement with the BOUNDS statement. If it is not possible to use a BOUNDS statement, the problem can be avoided by using the LAGn( < i,> x ) function or the ZLAGn( < i,> x ) function instead of the MOVAVGn( x ) function in the model equation.

For example, the MOVAVGn( x ) function is used in the model below:

data d;
   y = 1;
   do date = 1 to 5;
      y = 0.9*y;
      output;
   end;
   run;
proc model data=d;
   endo y;
   y = phi*movavg4(y);
   solve phi / out=om;
   quit;

The same model can be expressed using the ZLAGn( < i,> x ) as follows:

proc model data=d print;
   endo y;
   tot = 0;
   cnt = min(_obs_-1,3);
   do i = 1 to cnt;
      tot = tot + zlag4(i,y);
   end;
   
   y = phi*1/(cnt+1)*(y + tot);
   solve phi / out=ov;
   quit;