Monte Carlo Simulation
/*--------------------------------------------------------------
SAS Sample Library
Name: modex11.sas
Description: Example program from SAS/ETS User's Guide,
The MODEL Procedure
Title: Monte Carlo Simulation
Product: SAS/ETS Software
Keys: nonlinear simultaneous equation models
PROC: MODEL
Notes:
--------------------------------------------------------------*/
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;
run;
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;
run;
title1 'Monte Carlo Simulation of ODE';
proc model data=drive1 noprint;
parm a 0.5;
dert.y = a - a * y;
fit y / outest=est;
by iter;
run;
proc univariate data=est noprint;
var a;
output out=monte mean=mean p5=p5 p95=p95;
run;
proc print data=monte;
run;