From: "MANOJ KHURANA"  
Subject: [NMusers] Simulation problem 
Date: Mon, November 22, 2004 1:42 pm 

Dear Group,
Continuing my crawls I have another querry if someone can suggest me how
to perform PKPD simulation using NONMEM (If possible w.r.to PDX-POP) and
what changes need to be incorporated in the data set (an example of data
set arrangement and Control Stream file would be of real help).  Below is
the ctl stream I wrote but its not running so obviously there is something
wrong that I am doing, kindly correct me.  Can we perform estimation as
well as simulation simultaneously.  Also please advice me on how to perform
individual simulation versus population simulation using NONMEM?  I tried
FIXING THETAs, REMOVING ETAs as well as OMEGA BLOCK for individual simulation
but run aborts with a msg that "sigma record found without omega record".
 
Thanks in advance
Manoj Khurana 
 
$PROB RUN# 001
$INPUT C ID EVID TIME DV TYPE AMT
$DATA 001.CSV IGNORE=C
$SUBROUTINES ADVAN4 TRANS4
$PK
   TVCL=THETA(1)
   CL=TVCL*EXP(ETA(1))
   TVV2=THETA(2)
   V2=TVV2*EXP(ETA(2))
   TVQ=THETA(3)
   Q=TVQ*EXP(ETA(3))
   TVV3=THETA(4)
   V3=TVV3*EXP(ETA(4))
   TVKA=THETA(5)
   KA=TVKA*EXP(ETA(5))
   S2=V2/1000
$ERROR
   IPRED=F
   EMAX=THETA(6)+ETA(6)
   EC50=THETA(7)+ETA(7)
   E=(EMAX*F)/(EC50+F)
   Y=F*(1+ERR(1))
   IF (TYPE.EQ.2) THEN
   Y=E+ERR(2)
   ENDIF
$THETA
   (10, FIX) ;CL
   (100, FIX)  ;V2
   (12, FIX)   ;Q
   (120, FIX)  ;V3
   (2, FIX)    ;KA
   (100, FIX)   ;EMAX
   (10, FIX) ;EC50
$OMEGA
0.03 FIX
0.08 FIX
0.3 FIX
0.13 FIX
0.99 FIX
0.7 FIX
0.01 FIX
$SIGMA
 0.02 FIX
 1.6 FIX

$SIMULATION (2674474) ONLYSIMULATION
$TABLE ID TIME IPRED TYPE NOPRINT ONEHEADER FILE=001.TAB
_______________________________________________________

From: "Bhattaram, Atul" BhattaramA@cder.fda.gov
Subject: RE: [NMusers] Simulation problem 
Date:  Mon, November 22, 2004 1:59 pm

Hello Manoj
 
Your code is fine and it does run. I am including the data
I used for simulation. It will give you an idea of how to set it up.
 
Hope this helps
 
C ID EVID TIME DV TYPE AMT
  1 1 0 0 1 1
  1 0 0 0 2 0
  1 0 1 0 1 0
  1 0 1 0 2 0
  1 0 2 0 1 0
  1 0 2 0 2 0
  1 0 3 0 1 0
  1 0 3 0 2 0
  1 0 4 0 1 0
  1 0 4 0 2 0
  1 0 5 0 1 0
  1 0 5 0 2 0
  1 0 6 0 1 0
  1 0 6 0 2 0
  1 0 7 0 1 0
  1 0 7 0 2 0
  1 0 8 0 1 0
  1 0 8 0 2 0
  1 0 9 0 1 0
  1 0 9 0 2 0
  1 0 10 0 1 0
  1 0 10 0 2 0
Venkatesh Atul Bhattaram Pharmacometrics DPE-1, OCPB CDER, FDA. _______________________________________________________ From: "Nick Holford" n.holford@auckland.ac.nz Subject: RE: [NMusers] Simulation problem Date: Mon, November 22, 2004 2:05 pm Manoj, First of all if you want help please do not say "its not running so obviously there is something wrong that I am doing" without giving details of what goes wrong!! I cannot see anything obviously wrong with your code for simulation but without any clues to the error I havent looked very closely. If you are doing $SIM ONLYSIM there is no need to add FIX to all the parameter records. Simulation implicitly means that the parameter remain fixed at their original values. Simulation and estimation can be done at the same time by including both a $SIM and a $EST record in the control stream and removing ONLYSIMULATION from the $SIM record. If you remove all $OMEGA records then NM-TRAN does not understand about $SIGMA because NONMEM only recognizes the second level of random effects implied by $SIGMA if there are $OMEGA records for the first level. If you remove all $OMEGA records and references to ETA, change $SIGMA to $OMEGA and change ERR to ETA then NM-TRAN will accept this as a non-population problem. However, the simplest way to simulate an individual is to fix all OMEGA estimates to zero. This fools NM-TRAN into thinking you are doing a population problem. 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/ _______________________________________________________ From:"MANOJ KHURANA" manoj2570@yahoo.com Subject: RE: [NMusers] Simulation problem Date: Mon, November 22, 2004 2:13 pm Hello Dr. Atul, Thanks for your prompt reply. Its good to know that this code is fine and I had set the data exactly as you suggested but the run couldnt execute. I am trying it again to see if it is a machine problem. Thanks Manoj _______________________________________________________ From: "MANOJ KHURANA" manoj2570@yahoo.com Subject: RE: [NMusers] Simulation problem Date: Mon, November 22, 2004 3:02 pm Dr. Halford, Thanks for your words. My future e-mails would be appropriate. The things are ok and I am able to run the code now (My mistake I got confused with the summary out-put which was almost blank and realized that this is because I am running simulation only and there is no estimation). Thanks for your advice on individual simulation I will try that. Also I would be thankful if you or the group could explain what goes behind the screen when we run estimation and simulation together. I mean how does NONMEM performs two functions together because as far as I understand when we run "simulation only" we fix everything but when estimation is being performed we give initial estimates of thetas, etas, sigma and estimate them (please correct me if I am wrong somewhere). What does NONMEM uses to perform simulation and how exactly it performs that in simultaneous process? Thanks Manoj Khurana _______________________________________________________ From: "Nick Holford" Subject: RE: [NMusers] Simulation problem Date: Mon, November 22, 2004 3:17 pm Manoj, Simulation and estimation are NOT simultaneous. NONMEM first simulates values and creates a new data set that replaces the DV values in the original input data set. Then this modified data set is used for estimation using the simulated DV values. As I said earlier it is not necessary to fix parameter values for the simulation step. 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/ _______________________________________________________ From:"GIRARD PASCAL" PASCAL.GIRARD@adm.univ-lyon1.fr Subject: RE: [NMusers] Simulation problem Date: Mon, November 22, 2004 3:47 pm Manoj, In addition to what Nick writes, NONMEM will use the simulation parameters you give in $THETA, $OMEGA and $SIGMA and reuse it as initial estimates for the fit. So you will probably need to give some boundaries for the fitting step even if they are ignored for the simulation step. If you want to have different initial estimates than the ones used for simulation you will need to have extra initial THETAs. Then, in your $PRED or $PK you will need extra code to test whether NONMEM is running the simulation or the fitting step (I think you do it by testing ICALL, but am not 100% sure) then initialize using the correct THETA. Same can be done for OMEGAs and SIGMAs with extra ETAs and EPSILONs. Pascal _______________________________________________________