Hi Jeroen,
The part of the manual that you described did not mention that the call to ERROR is done. And indeed, you can use MTIME in any subsequent calls to ERROR (that are made at event times). So I do not think this is a bug.

Since call to PK is done, you can try to get A() value in the PK block, something like

$PK
...
C=A(*)/V1
IF(C.GE.CMAX) THEN
  TMAX=TSTATE
  CMAX=C
ENDIF
...

If the end-of-infusion concentration is CMAX, this code may get it out (and TMAX should point to the end-of-infusion; both of them should be taken from the first event record following the end-of-infusion) but I have not tried it.

-----------
Here is the part of the manual that discussed use of A(*) in the PK block:

  A(n) TSTATE

   A(n)  are the latest computed compartment amounts, and TSTATE is the
   time at which they were computed.  That is, A(n) are the amounts  at
   the  previous event time, or if at a later time, but before the time
   for which PK is being called, a lagged or additional dose was given,
   or  a  regular infusion was terminated, or a modeled event occurred,
   then A(n) are the amounts at the latest such  time.   If  there  are
   population etas, and A(n) are used in the $PK abbreviated code, then
   any $OMEGA records referring to etas explicitly used  in  this  code
   should  precede  the  $PK  record, or if an $MSFI record is used, it
   should precede the $PK record and include the option NPOP=m.

-------------------

Could someone explain why

"If  there  are
   population etas, and A(n) are used in the $PK abbreviated code, then
   any $OMEGA records referring to etas explicitly used  in  this  code
   should  precede  the  $PK  record"

Thanks
Leonid

--------------------------------------
Leonid Gibiansky, Ph.D.
President, QuantPharm LLC
web:    www.quantpharm.com
e-mail: LGibiansky at quantpharm.com
tel:    (301) 767 5566




Elassaiss - Schaap, J. (Jeroen) wrote:
Hi Douglas, Paul,
The help on mtime suggests that it should work.
" When the time is reached, indicator variables
are set and a call to PK is made.  At this call (and/or subsequent  to
this  call)  PK or DES or AES or ERROR can use the indicator variables
to change some aspect of the system, e.g., a term  in  a  differential
equation,  or  the rate of an infusion.  This feature may be used with
any ADVAN routine. "
The following code (tested with nm6.2.0) however does not work in the $ERROR block, where the model predictions are available. As one can see, CP is only set at the data time event, not at the MTIME. CP2 is not set at all. So it seems $ERROR is not called upon the MTIME event. An indicator in $PK works properly (tested, not shown). Can anyone confirm this behavior? If so, this looks like a bug to me. Best regards,
Jeroen
____model____
$PROB structural model 1comp.rep single subject
$INPUT ID TIME DV AMT EVID TRT
$DATA iv_ss.csv IGN=I
$SUBR ADVAN1 TRANS2
$PK
TVCL=THETA(1)
CL=TVCL
TVV=THETA(2)
V=TVV
S1=V/1000 ;mtime piece
MTIME(1)=.075           ; .075 h not in dataset
MTIME(2)=.5             ; .5 h not in dataset
IF(TIME.EQ.0)CP=0
IF(TIME.EQ.0)CP2=0
$ERROR
IPRED=F
Y=F+F*ERR(1)
IF(TIME.EQ.0)MYFLAG=0   ; 0 h IN dataset
IF(MPAST(1).EQ.1.AND.MYFLAG.EQ.0)THEN
  CP=F
  MYFLAG=1
ENDIF
CP2=CP2+MNEXT(2)*F $THETA
(0,10)
(0,1)
$OMEGA
.05
$SIM (123456789)
$EST PRINT=1 MAXEVAL=9990 SIG=3 NOABORT METHOD=0
;$COV PRINT=E
$TABLE ID TIME CP CP2 IPRED
  NOPRINT ONEHEADER FILE=1cmp.txt
____dataset___
ID,time h,conc nM,amt,evid,dose æmol
1,0,.,30,1,10
1,0.05,0,.,0,10
1,0.166666667,0,.,0,10
1,0.333333333,0,.,0,10
1,0.683,0,.,0,10
1,1,0,.,0,10
1,2,0,.,0,10
1,4,0,.,0,10
1,8,0,.,0,10
____table file_____
TABLE NO. 1 ID TIME CP CP2 IPRE DV 1.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 3.2044E+04 0.0000E+00 1.0000E+00 5.0000E-02 0.0000E+00 0.0000E+00 1.9459E+04 1.6272E+04 1.0000E+00 1.6667E-01 6.0768E+03 0.0000E+00 6.0768E+03 7.7936E+03 1.0000E+00 3.3333E-01 6.0768E+03 0.0000E+00 1.1524E+03 1.0149E+03 1.0000E+00 6.8300E-01 6.0768E+03 0.0000E+00 3.5213E+01 2.8321E+01 1.0000E+00 1.0000E+00 6.0768E+03 0.0000E+00 1.4905E+00 1.5249E+00 1.0000E+00 2.0000E+00 6.0768E+03 0.0000E+00 6.9328E-05 7.8605E-05 1.0000E+00 4.0000E+00 6.0768E+03 0.0000E+00 1.4999E-13 1.5736E-13 1.0000E+00 8.0000E+00 6.0768E+03 0.0000E+00 7.0211E-31 6.9514E-31
------------------------------------------------------------------------
*From:* [email protected] [mailto:[email protected]] *On Behalf Of *Eleveld, DJ
*Sent:* Tuesday, 06 April, 2010 20:22
*To:* [email protected]; [email protected]
*Subject:* RE: [NMusers] Generating Cmax at end of infusion

Hi,

As others have suggested making an additional record at the known desired time is probably the most straightforward manner to get what you want. So this should probably be a preferred solution.

If you for some reason you cant to add a record (maybe you dont know the time beforehand), I think you can achieve what you want using MTIME(). This has the added advantage of working without going the $DES route and the associated slower run-times. I'll see if I can get something like that to work tomorrow, just as an excercise. Can the experts give an opinion as to whether MTIME() should work or not?
Regards,

Douglas Eleveld


-----Original Message-----
From: [email protected] on behalf of Paul Hutson
Sent: Tue 4/6/2010 6:11 PM
To: [email protected]
Subject: [NMusers] Generating Cmax at end of infusion

G'day.
I would like to generate a concentration at the end of an infusion of duration DUR. I am using ADVAN3 TRANS4 with log transformed data. Here is what I have tried, but I am getting an error that the parameter 'T' that I understood to be the machine time is undefined. Can anyone suggest a proper way to give set Cmax=exp(Y) at the end of the infusion of length DUR?
Many thanks in advance.
Paul
$PK
...
TT=TIME

$ERROR
;I've also tried
;TT=TIME
;TT=T
IPRE=F
EDV=EXP(DV)
W=1
IF(F.GT.0) W=F
IRES=F-EDV
IWRE=IRES/W
LOGF=LOG(0.0001)
IF (F.GT.0) LOGF=LOG(F)
Y=LOGF+EPS(1)
;GENERATE CMAX AT END OF INFUSION (DUR)
 IF(DUR.EQ.TT) CMAX=EXP(Y)

--


Paul R. Hutson, Pharm.D.

Associate Professor

UW School of Pharmacy

777 Highland Avenue

Madison WI 53705-2222

Tel  608.263.2496

Fax 608.265.5421

Pager 608.265.7000, p7856


------------------------------------------------------------------------
De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht.

The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message.

------------------------------------------------------------------------
This message and any attachments are solely for the intended recipient. If you are not the intended recipient, disclosure, copying, use or distribution of the information included in this message is prohibited --- Please immediately and permanently delete.
------------------------------------------------------------------------

Reply via email to