Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The MODEL Procedure

Example 14.11: Monte Carlo Simulation

This example illustrates how the form of the error in a ODE model affects the results from a static and dynamic estimation. The differential equation studied is

[d y/d t] = a - a y

The analytical solution to this differential equation is

y = 1 - exp(-a t )

The first data set contains errors that are strictly additive and independent. The data for this estimation are generated by the following DATA step:

      data drive1;
         a = 0.5;
         do iter=1 to 100;
            do time = 0 to 50;
               y = 1 - exp(-a*time) + 0.1 *rannor(123);
               output;
            end;
         end;

The second data set contains errors that are cumulative in form.

      data drive2;
         a = 0.5;
         yp = 1.0 + 0.01 *rannor(123);
         do iter=1 to 100;
            do time = 0 to 50;
               y = 1 - exp(-a)*(1 - yp);
               yp = y + 0.01 *rannor(123);
               output;
            end;
         end;

The following statements perform the 100 static estimations for each data set:

      proc model data=drive1 noprint;
         parm a 0.5;
         dert.y = a - a * y;
         fit y / outest=est;
         by iter;
      run;

Similar code is used to produce 100 dynamic estimations with a fixed and an unknown initial value. The first value in the data set is used to simulate an error in the initial value. The following PROC UNIVARIATE code processes the estimations:

      proc univariate data=est noprint;
         var a x0;
         output out=monte mean=mean p5=p5 p95=p95;
      run;
   
      proc print data=monte; run;

The results of these estimations are summarized in Table 14.4.

Table 14.4: Monte Carlo Summary, A=0.5
Estimation Additive Error Cumulative Error
Type mean p95 p5 mean p95 p5
static0.778851.035240.547330.578631.161120.31334
dynamic fixed0.487850.632730.376443.8546E248.88E10-51.9249
dynamic unknown0.485180.624520.36754641704.511940.42-25.6054

For this example model, it is evident that the static estimation is the least sensitive to misspecification.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.