From: peter.bonate@quintiles.com
Subject: Rounding errors / $SIM superproblem
Date: Fri, 23 Mar 2001 08:06:11 -0600

I have a few questions over the last couple of months and thought I would pose them to the group.

1.) At what point in the optimization process is NONMEM sensitive to rounding errors and secondly, if minimization is terminated due to rounding errors, can anything else be done except change the starting values.

2.) Can someone explain what a superproblem is and how it relates to the $SIM option.

Thanks.

pete bonate


*****


From: "Piotrovskij, Vladimir [JanBe]" <VPIOTROV@janbe.jnj.com>
Subject: RE: $SIM superproblem
Date: Mon, 26 Mar 2001 09:39:58 +0200

Many people responded the first question from Pete, but nobody tried to answer the second one: about $SUPER. Has anybody ever used it and if yes, perhaps, could give a simple example. The examples in the Help Guide hardly give any clue...

Best regards,
Vladimir
------------------------------------------------------------------------
Vladimir Piotrovsky, Ph.D.
Global Clinical Pharmacokinetics and Pharmacology
Janssen Research Foundation
B-2340 Beerse
Belgium
Email: vpiotrov@janbe.jnj.com


*****


From: "Banken, Ludger {PDBS~Basel}" <LUDGER.BANKEN@Roche.COM>
Subject: RE: $SIM superproblem
Date: Mon, 26 Mar 2001 16:50:10 +0200

Dear all,
in NONMEM it is possible to have several NM problems in one control file. The $SUPER statement can be used as a DO loop around such a block of problems to execute them several times. Since it is not possible to change the datasets from one execution to the next, I see the use only in simulations.

On 15th February, 2000 I send an example of such a code to nmusers which can be found in the NONMEM Users Net Archive under the topic "Monte Carlo simulations with NM".

Below is the text of the E-mail and the code.

Best regards,
Ludger

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

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.

$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


*****


From: Masaki Hiraoka <masaki.hiraoka@bms.com>
Subject: Re: $SIM superproblem
Date: Tue, 27 Mar 2001 09:11:27 +0900

Dear all,

It is true that one hardly changes the datasets in the same problem during $SUPER DO loop. But he or she can extract new datasets for each $SUPER iteration step by using INFN and counters for $SUPER. A few years ago, I made an INFN routine to extract detasets from a initial dataset.

Regards,
Masaki Hiraoka