Monte Carlo simulations with NM

2 messages 2 people Latest: Feb 15, 2000

Monte Carlo simulations with NM

From: Joost de Jongh Date: February 15, 2000 technical
From: j.dejongh@lapp.nl Date: Tue, 15 Feb 2000 09:10:34 +0100 Subject: Monte Carlo simulations with NM Dear NM users, I want to perform a series of Monte Carlo simulations with NM using a priori distributions on parameter distributions. Has anybody experience on automating such a process; i.e. performing a large number of subsequent simulations and handling the resulting output? Thanks in advance ! Dr. Joost DeJongh Leiden Advanced Pharmacokinetics & Pharmacodynamics (LAP&P) Consultants Archimedesweg 31 2333 CM Leiden The Netherlands Phone: + 71 568 6920 fax: + 71 568 6972

RE: Monte Carlo simulations with NM

From: Ludger Banken Date: February 15, 2000 technical
From: "Banken, Ludger {PDBS~Basel}" <LUDGER.BANKEN@roche.com> Subject: RE: Monte Carlo simulations with NM Date: Tue, 15 Feb 2000 10:29:45 +0100 Dear Joos, I have used the NONMEM statement $SUPER to perform a number of simulations and to fit the simulated data. The $SUPER statements acts as a DO loop. It is documented in the electronic NONMEM help NMhelp. Below is an example where I run 100 simulations. In each simulation, random sampling times are generated, PK data are simulated for a given model and fitted under two models I used a program written in SAS to generate the code and the data and to process the results. Kind regards, Ludger Banken PDBS, 74/4.OG W Hoffmann-La Roche, Ltd. CH-4070 Basel, Switzerland Phone: ++41 61 68 87363; Fax: ++41 61 68 814525; E-mail: Ludger.Banken@roche.com $PROB Popkin Dummy Simulation for first starting value of the seed ;This problem is only here to allow the use of the seed (-1) later on $THETA (.1,1.4 ,10) ;Ka 1 $THETA (.1,3.5 ,50) ;CL 2 $THETA (1,20 ,1000) ; V 3 $THETA (1 ,1 ,1 ) ;F 4 $THETA (-2,0.2 ,2) ; CL (Covar) 5 $OMEGA 0.223144 ;kA $OMEGA 0.039221 0.039221 ;CL V $OMEGA .0001 FIXED;F $SIGMA 0.039221 ;ERR Mult $SIGMA 0.005 ;Err Add $SIGMA 1 FIXED; Random time $DATA SLB.nm $INPUT ID TIME AMT DV MDV EVID SS II ADDL RATD COVA $SIMULATION (35436 ) ONLY SUB=1 $SUBROUTINE ADVAN2 TRANS=2 $PK ;This PK block has to be used in all problems below ;Therefore all model must be covered by this model KA = THETA(1) * EXP(ETA(1)) CL = THETA(2) * EXP(ETA(2))*COVA**THETA(5 ) V = THETA(3) * EXP(ETA(3)) F1 = THETA(4) * EXP(ETA(4)) S2=V $ERROR CP=F Y = F * EXP( EPS(1) ) + EPS(2) IF (AMT.GT.0) THEN ATIME=TIME RTIME=TIME LTIME=TIME ENDIF MDV2=MDV IF (TIME.EQ. 101) RTIME=ATIME+1.7320508076 *EXP(0.3339544233 *EPS(3)) IF (TIME.EQ. 102) RTIME=ATIME+23.916521486 *EXP(0.050780836 *EPS(3)) IF (TIME.EQ. 201) RTIME=ATIME+3.4641016151 *EXP(0.0874491407 *EPS(3)) IF (TIME.EQ. 202) RTIME=ATIME+5.4772255751 *EXP(0.055421818 *EPS(3)) IF (TIME.EQ. 203) RTIME=ATIME+7.4833147735 *EXP(0.0405906612 *EPS(3)) IF (RTIME.LE.LTIME) THEN RTIME=LTIME+.01 MDV2=1 ENDIF LTIME=RTIME $SUPER SCOPE=4 ITERATIONS=100 ;This is the big DO Loop around the following Models $PROB Popkin Simulation 1 to generate random Time $THETA (.1,1.4 ,10) ;Ka 1 $THETA (.1,3.5 ,50) ;CL 2 $THETA (1,20 ,1000) ; V 3 $THETA (1 ,1 ,1 ) ;F 4 $THETA (-2,0.2 ,2) ; CL (Covar) 5 $OMEGA 0.223144 ;kA $OMEGA 0.039221 0.039221 ;CL V $OMEGA .0001 FIXED;F $SIGMA 0.039221 ;ERR Mult $SIGMA 0.005 ;Err Add $SIGMA 1 FIXED; Random time $INPUT ID TIME AMT DV MDV EVID SS II ADDL RATD COVA $SIMULATION (-1) ONLY SUB=1 $TABLE ID RTIME AMT DV MDV2 EVID SS II ADDL RATD COVA FILE=SIMUL1 NOPRINT NOHEADER NOFORWARD $PROB Popkin Simulation 2 to generate random Concentrations $THETA (.1,1.4 ,10) ;Ka 1 $THETA (.1,3.5 ,50) ;CL 2 $THETA (1,20 ,1000) ; V 3 $THETA (1 ,1 ,1 ) ;F 4 $THETA (-2,0.2 ,2) ; CL (Covar) 5 $OMEGA 0.223144 ;kA $OMEGA 0.039221 0.039221 ;CL V $OMEGA .0001 FIXED;F $SIGMA 0.039221 ;ERR Mult $SIGMA 0.005 ;Err Add $SIGMA 1 FIXED; Random time $DATA SIMUL1 (12E12.0) NRECS=700 NOOPEN $INPUT ID TIME AMT DV MDV EVID SS II ADDL RATD COVA $SIMULATION (-1) ONLY SUB=1 $PROB Popkin Model $THETA (.1,1.4 ,10) ;Ka 1 $THETA (.1,3.5 ,50) ;CL 2 $THETA (1,20 ,1000) ; V 3 $THETA (1 ,1 ,1 ) ;F 4 $THETA (-2,0.2 ,2) ; CL (Covar) 5 $OMEGA 0.223144 ;kA $OMEGA 0.039221 0.039221 ;CL V $OMEGA .0001 FIXED;F $SIGMA 0.039221 ;ERR Mult $SIGMA 0.005 ;Err Add $SIGMA 0.01 FIXED; Random time ;Without data statement the data from the last step are used $INPUT ID TIME AMT DV MDV EVID SS II ADDL RATD COVA $ESTIM MAXEVALS=2000 SIGDIGITS=3 PRINT=0 METHOD=0 $PROB Popkin H0 $THETA (.1,1.4 ,10) ;Ka 1 $THETA (.1,3.5 ,50) ;CL 2 $THETA (1,20 ,1000) ; V 3 $THETA (1 ,1 ,1 ) ;F 4 $THETA 0.0001 FIXED; CL (Covar) 5 $OMEGA 0.223144 ;kA $OMEGA 0.039221 0.039221 ;CL V $OMEGA .0001 FIXED;F $SIGMA 0.039221 ;ERR Mult $SIGMA 0.005 ;Err Add $SIGMA 0.01 FIXED; Random time ;Without data statement the data from the last step are used $INPUT ID TIME AMT DV MDV EVID SS II ADDL RATD COVA $ESTIM MAXEVALS=2000 SIGDIGITS=3 PRINT=0 METHOD=0