From:  "Bonhomme Vincent" vincent.bonhomme@chrcitadelle.be
Subject: [NMusers] Need help 
Date: Thu, May 19, 2005 9:30 am

Dear nonmem users, 

I am new to the use of nonmem and currently trying to model both PK and
PD of a medication we gave to volunteers as a continuous intravenous infusion.
We sampled blood twelve times at 8 min intervals for each subject. The
continous infusion started immediately after the first sample and its
duration varied randomly along the sequence of the remaining 11 measurements.
A measure of the pharmacodynamic effect of this medication was performed
concomittently to blood sampling. I first tried to obtain pharmacokinetic
parameters using the following data and control records (existing models in
the litterature are two compartments models):

ID TIME AMT RATE CP MDV RCBF WT 
1 0 . . 1.27 0 3.09 65 
1 8 480 6 . 1 . . 
1 8 . . 0.89 0 7.53 65 
1 16 . . 62.52 0 2.27 65 
1 24 . . 166.80 0 0.76 65 
1 32 . . 319.33 0 -0.99 65 
1 40 . . . 1 -1.53 65 
1 48 . . 824.93 0 -0.91 65 
1 56 . . 1295.18 0 0.83 65 
1 64 . . 1339.19 0 -7.60 65 
1 72 . . 1456.10 0 -3.84 65 
1 80 . . 1537.57 0 -1.92 65 
1 88 . . 1336.66 0 2.33 65 
2 0 . . 3.51 0 10.85 54 
2 8 560 10 . 1 . . 
2 8 . . 14.05 0 6.47 54 
2 16 . . 112.83 0 2.04 54 
etc... 

$PROB TWO COMPARTMENTS / ALL SUBJECTS 
$INPUT ID TIME AMT RATE CP=DV MDV RCBF=DROP WT 
$DATA DATACLO 
$SUBROUTINE ADVAN3 TRANS3 
$PK 
       TVCL=THETA(1)*WT 
         CL=TVCL*EXP(ETA(1)) 
        TVV=THETA(2)*WT 
          V=TVV*EXP(ETA(2)) 
        TVQ=THETA(3)*WT 
          Q=TVQ*EXP(ETA(3)) 
      TVVSS=THETA(4)*WT 
        VSS=TVVSS*EXP(ETA(4)) 
         S1=V 
$THETA (.01,4.6,8.) (.1,3.,6.) (.1,2.,4.) (.1,4.,8.) (0,.5,1) (0,50) 
$OMEGA .1 .1 .1 .1 
$ERROR 
      CALLFL=0 
      W = THETA(5)*EPS(1) + THETA(6)*F*EPS(2) 
      Y=F+W 

      IPRED=F 
      IRES=DV-IPRED 
      IWRES=IRES/W 
$SIGMA 1 FIX 1 FIX 
$ESTIMATION MAXEVALS=9999 PRINT=99 METHOD=0 NOABORT POSTHOC 
$COVARIANCE 
$TABLE ID CL V Q VSS IPRED IWRES NOPRINT FILE=TABLE1 
$TABLE ID TIME ETA1 ETA2 ETA3 ETA4 
$SCATTER PRED VS DV UNIT 
$SCATTER PRED VS TIME 
$SCATTER WRES VS PRED 
$SCATTER IWRES VS IPRED 

I let nonmem run for more than 5 days but nothing came out. 
Concerning the pharmacodynamic aspects, I used the following records, let
nonmem run for the same delay and, again, did not succeed to obtain results:

ID TIME AMT RATE CP MDV RCBF WT 
1 0 . . 1.27 0 3.09 65 
1 8 480 6 . 1 . . 
1 8 . . 0.89 0 7.53 65 
1 16 . . 62.52 0 2.27 65 
1 24 . . 166.80 0 0.76 65 
1 32 . . 319.33 0 -0.99 65 
1 40 . . . 0 -1.53 65 
1 48 . . 824.93 0 -0.91 65 
1 56 . . 1295.18 0 0.83 65 
1 64 . . 1339.19 0 -7.60 65 
1 72 . . 1456.10 0 -3.84 65 
1 80 . . 1537.57 0 -1.92 65 
1 88 . . 1336.66 0 2.33 65 
2 0 . . 3.51 0 10.85 54 
2 8 560 10 . 1 . . 
2 8 . . 14.05 0 6.47 54 
etc ... 

$PROBLEM CMAX 
$INPUT ID TIME AMT RATE CP=DROP MDV RCBF=DV WT=DROP 
$DATA DATACLOKE0 
$SUBROUTINES ADVAN=6 TRANS=1 TOL=6 
$MODEL 
 COMP = CENTRAL 
 COMP = EFFECT 
 COMP = CMAX 
 COMP = TMAX 

$PK 
     TVK = THETA(1) 
       K = TVK*EXP(ETA(1)) 
   TVKE0 = THETA(2) 
     KE0 = TVKE0*EXP(ETA(2)) 

 TVTMAX = (LOG(TVK)-LOG(TVKE0))/(TVK-TVKE0) 
   TMAX = TVTMAX*EXP(ETA(3)) 

$DES 
 DADT(1) = -K*A(1) 
 D2 = KE0*(A(1)-A(2)) 
 DADT(2) = D2 
 IF (D2.GT.0) THEN 
   DADT(3) = D2 
   DADT(4) = 1 
 ELSE 
   DADT(3) = 0 
   DADT(4) = 0 
 ENDIF 

$THETA 
 0.01 
 0.03 

$ERROR 
 Y1 = A(1) 
 Y2 = A(2) 
 Y3 = A(3) 
 Y4 = A(4) 

 Y = Y2*(1+EPS(1)) 

$OMEGA .001 .001 .001 

$SIGMA .001 

$ESTIMATION METHOD=0 MAXEVAL=9999 NOABORT 

$TABLE FILE=stream NOPRINT NOHEADER TIME AMT RATE MDV Y1 Y2 Y3 Y4 TMAX 

Can anyone tell me if I chose the right models or help me resolving this? 

Thanks in advance, 

Vincent. 
[Vincent Bonhomme] 
E-Mail: vincent.bonhomme@chrcitadelle.be 
_______________________________________________________

From: "Bachman, William (MYD)" bachmanw@iconus.com
Subject: RE: [NMusers] Need help 
Date: Thu, May 19, 2005 10:14 am 

At first glance, your control stream and data file look OK.  What I
would do as a diagnostic, in my opinion, is to use: 
"$ESTIMATION MAXEVALS=9999 PRINT=1 MSF=runX.msf METHOD=0 NOABORT POSTHOC "
 
this allows creation of an INTER file that generates output for every iteration
that can be read to determine that NONMEM is running and doing something in case
the problem is just very slow and not just sitting there "spinning".  Secondly,
it's always a good idea to create the msf file and costs you nothing timewise.
Your PK model is sufficiently simple that it should not be slow unless your
data set is HUMONGOUS.
 
Also, simplify your $ERROR model, just to see if a basic model works:
 
 $ERROR 
     Y=F + F*EPS(1) 
     IPRED=F 
$SIGMA 1.0  
_______________________________________________________

From: "Nick Holford" n.holford@auckland.ac.nz
Subject: Re: [NMusers] Need help 
Date: Thu, May 19, 2005 6:39 pm

It is possible to determine that NONMEM is producing output by examining the file
time and date on OUTPUT (and other files). This can be done with or without creating
an INTER file. If the timestamp changes then NONMEM is producing output.

An added benefit of having the INTER file is that it lets you examine the current
parameter estimates in a user intelligible format (unlike the transformed and
unintelligible values provided in the usual iteration monitoring output).

One puzzling feature for those not familiar with the use of INTER is that this file
is deleted as soon as NONMEM finishes. By default you can only examine the results
while NONMEM is actually running. This less than fully helpful behaviour can be
changed by commenting out the following line in the NONMEM CFILES fortran source
code file and then recompiling NONMEM.
e.g. Change from
      CLOSE (UN(28),STATUS='DELETE')
to
C      CLOSE (UN(28),STATUS='DELETE')

I also find it helpful to change the name of the file to INTER.txt so that I can
open it easily using the Windows Explorer. This is done by changing the second line
below in the NONMEM BLKDAT fortran source file and recompiling NONMEM.

Change from:
      DATA FNSTP,FNINT,FNERR,FNINTR,FNULL
     1/'nul','con','PRDERR','INTER','nul'/

to:
      DATA FNSTP,FNINT,FNERR,FNINTR,FNULL
     1/'nul','con','PRDERR','INTER.txt','nul'/

Nick

--
Nick Holford, Dept Pharmacology & Clinical Pharmacology
University of Auckland, 85 Park Rd, Private Bag 92019, Auckland, New Zealand
email:n.holford@auckland.ac.nz tel:+64(9)373-7599x86730 fax:373-7556
http://www.health.auckland.ac.nz/pharmacology/staff/nholford/
_______________________________________________________