From: justin.wilkins

Date: Fri, 5 Sep 2008 13:38:28 +0200

Dear Dirk (and all),

This is a tricky one. After we got our heads together to look at it, we

realized that it's a bit more complex than it appears. The reason why we

use greater-than or equal to (T.GE.TDOS) instead of (T.GT.TDOS) is to get

around an issue with NONMEM. The easiest way to explain why is through an

example - given multiple dosing every 12 hours, and observations at 1, 2,

4, and 8 h post-dose, time after dose (TAD) will need to be set to 0 at

every 12-hourly dosing event - so at this point, TAD==0 and TDOS==1=

2.

However, in order to integrate between 8 h and 12 h in this scheme, NONMEM =

will use a TDOS value of 12 h here, resulting in negative values of TAD

over the 8-12h period - which will clearly produce undesirable results.

Using the IF-THEN structure with (T.GE.TDOS) is a cheat to overcome this.

However, as Sebastien pointed out, another assumption is introduced by

doing it this way - the dose is assumed to be fully absorbed by the last

observation event, in this case 8 h (as opposed to the time of the next

dose, 12 h). This may have fairly problematic consequences, especially

where you have a series of dosing events without observations between

them. We think the best way to tackle this will be to add dummy

observation records (using EVID==2) at inter-dose troughs (e.g. 11.9 h)=

between each successive dose event - another method might be to leverage

NONMEM VI's very helpful model event time (MTIME) variable to take care of =

this.

Hope this was helpful!

Best

Justin (and Rada)

Justin Wilkins

Novartis Pharma AG

PH346, MODELING & SIMULATION

CHBS, WSJ-027.1.084

Novartis Pharma AG

Lichtstrasse 35

CH-4056 Basel

Switzerland

Phone: +41 61 324 6549

Fax: +41 61 324 3039

Mobile: +41 76 561 0949

Email : justin.wilkins

Sébastien Bihorel <sbihorel

Sent by: owner-nmusers

27/08/2008 15:59

To

Garmann Dirk <Dirk.Garmann

cc

nmusers

Subject

Re: [NMusers] FW: transit model

(Sorry for the spelling mistakes)

Dirk,

This absorption model can correctly accommodate multiple dosing only if

the absorption of dose n is complete when dose n+1 is given ! Since the

input is hard-coded and reset at each dose, you have to make sure that

your estimates for MTT and NN provide this complete absorption. Otherwise, =

a part of each dose never enters the system.

I don't really understand how you implemented the transit model but you

may refer to the following code (for Wings for NONMEM) that worked just

fine for me. The frame time for the input function has to start at zero,

so I used a time transform based on a dosing interval of 24h. A column DAY =

is included in the dataset to calculate the new time MYT.

Hope it helps.

Sebastien Bihorel

$PROBLEM Simulation Transit model

$INPUT ID DOSE DAY TI24 TIME AMT RATX CMT EVID DVID DV MDV

$DATA ../Data/Simulation.csv IGNORE=#

$SIM (32047023) NSUB=1

$SUB ADVAN6 TOL3

$THETA (0,6.) ; POP_CL

$THETA (0,100.) ; POP_V2

$THETA (0,18.) ; POP_MTT

$THETA (0.00001,3.) ; POP_n

$THETA (0,6.) ; POP_TABS

$OMEGA BLOCK(2)

0.1 ; BSVCL

0.01 0.1 ; BSVV2

$OMEGA BLOCK(3)

0.1 ; BSVMTT

0.01 0.1 ; BSVN

0.01 0.01 0.1 ; BSVTABS

$SIGMA 0.1 ;cvcp

$SIGMA 0.05 ;sdcp

$MODEL COMP = (ABS) ; absorption compartment

COMP = (CEN) ; central compartment

;$ABBREVIATED DERIV2=NOCOMMON

$PK

"FIRST

" COMMON /PRCOMG/ IDUM1,IDUM2,IMAX,IDUM4,IDUM5

" INTEGER IDUM1,IDUM2,IMAX,IDUM4,IDUM5

" IMAX=1000000

IF(AMT.GT.0.AND.CMT.EQ.1)PODO=AMT; oral dose

F1 = 0.

F2 = 0.

ECL = EXP(BSVCL)

EV2 = EXP(BSVV2)

EMTT = EXP(BSVMTT)

ENB = EXP(BSVN)

ETAB = EXP(BSVTABS)

CL = POP_CL * ECL

V = POP_V2 * EV2

MTT = (POP_MTT * EMTT)/60

NB = POP_n * ENB

TABS = POP_TABS * ETAB

KA = LOG(2)/(TABS/60)

KTR = (NB+1)/MTT ; transit rate constant

LNFA = 0.5*LOG(2*3.14159*NB)+NB*LOG(NB)-NB+LOG(1.+1./(12.*NB)) ;

logarithmic transformation of 2nd Stirling approximation

S2 = V

BIO =1.

$DES

MYT = T -(DAY-1)*24

IF (MYT.LT.0.001) THEN

INPU = 0.

ELSE

INPU = EXP(LOG(BIO*PODO)+LOG(KTR)+NB*LOG(KTR*MYT)-KTR*MYT-LNFA)

ENDIF

DADT(1) = INPU-KA*A(1)

DADT(2) = (KA*A(1)-CL*A(2))/V

$ERROR

CP=A(2)

Y=CP*(1+CVCP)+SDCP

$TABLE ID DAY TIME AMT CMT EVID DVID Y

CL V MTT NB TABS ECL EV2 EMTT ENB ETAB

ONEHEADER NOPRINT

FILE=k0ka1l.fit

Garmann Dirk a écrit :

Dear NONMEM users,

I try to fit a dataset with a high variability in TLAG. With the standard

approaches it was not possible to get successful runs (variability in Tlag =

is always modeled as zero, but their is clearly a high variability)

Therefore I used the transit model, published by Justin Wilkins/Radoika

Savic. For single dose studies it works well (improved fit/successful

runs). Next , I included a multiple drug study and adapted the model. The =

model works, but I have some questions regarding the code (see below in

red). It would be very nice if someone can help to enhance my

understanding.

Thank you in advance

Dirk

$SUBROUTINE ADVAN6 TOL=3

$MODEL NCOMP=3 COMP=(DEPOT) COMP=(CENTRAL,DEFOBS) COMP=(PERIPH)

$PK

"FIRST

" COMMON /PRCOMG/ IDUM1,IDUM2,IMAX,IDUM4,IDUM5

" INTEGER IDUM1,IDUM2,IMAX,IDUM4,IDUM5

" IMAX=9900000

IF(AMT.GT.0.AND.CMT.EQ.1) PD=AMT

IF(AMT.GT.0) TDOS=TIME

TVCL=THETA(1)

CL=TVCL*EXP(ETA(1))

TVV2=THETA(2)

V2=TVV2*EXP(ETA(2))

TVV3=THETA(3)

V3=TVV3*EXP(ETA(3))

TVQ=THETA(4)

Q=TVQ*EXP(ETA(4))

; Absorption model

;F1=0 delete NONMEMS Dose record

F1=0

TVKA=THETA(5)

KA=TVKA*EXP(ETA(5))

;Mean transit time

TVMTT=THETA(6)

MTT=TVMTT*EXP(ETA(6))

;Number of transit compartments

TVNN=THETA(7)

NN=TVNN*EXP(ETA(7))

;Transit rate constant

KTR=(NN+1)/MTT

;Sterling

L=LOG(2.5066)+(NN+.5)*LOG(NN)-NN

S2=V2/1000

; DOSE : mg

; CONC: ng/ml

$DES

X=0.00001; Avoid LOG 0

;multiple dose

IF(T.GE.TDOS)THEN ; if current time greater than TDOS

Is this correct? I think GE might be a typo and should be GT?

DADT(1) = EXP(LOG(PD + X) + LOG(KTR +

X)+NN*LOG(KTR*(T-TDOS)+X)-KTR*(T-TDOS)-L)-KA*A(1)

ELSE

; Dose given

DADT(1) = EXP(LOG(PD + X) + LOG(KTR + X)+ NN*LOG(KTR*T + X) - KTR*T - L)-=

KA*A(1)

ENDIF

T.GE.TDOS (see above) might be a typo; otherwise this equation will never

be active?

I try this model with GT, the fit improves, but why is this statement

needed?

Can someone explain this (red) part of the equation, please?

I think if the time is e.g. 24 hours (time of second dose) the value of

the input function will be low, as it should be to simulate the lag time

(I used MTT=1, NN=4, to recalculate it). With further increased time (n=

ext

doses), the value of the input function will be approximately zero (ok).

But without this equation and

IF(AMT.GT.0.AND.CMT.EQ.1) PD=AMT

IF(AMT.GT.0) TDOS=TIME

(T-TDOS) should be zero at each dose event and the value of the input

function at a new dose event is also approximately zero (same as above?)

Any help to enhance my understanding is welcome

DADT(2)=KA*A(1)-Q/V2*A(2)+Q/V3*A(3)-CL/V2*A(2)

DADT(3)=Q/V2*A(2)-Q/V3*A(3)

$ERROR

One last question:

For some subjects I got some bizarre estimation values. I think this might =

be because I have sometimes dose events, but no observations (multiple

dose study) prior to the next dose.. Therefore, if I correctly understand

the code, the input value for these dose events will be approximately

zero.

Any suggestions to solve this problem are welcome.

Best regards

Dirk Garmann

SCHWARZ BIOSCIENCES GmbH

A Member of the UCB Group

Alfred-Nobel-Str. 10 - 40789 Monheim - Germany

Tel +49 2173 48 0 - Fax +49 2173 48 1608

Geschaeftsfuehrer: Prof. Dr. Iris Loew-Friedrich, Detlef Thielgen

Amtsgericht Duesseldorf HRB 46849

Legal Notice: This electronic mail and its attachments are intended solely =

for the person(s) to whom they are addressed and contain information which =

is confidential or otherwise protected from disclosure, except for the

purpose for which they are intended. Dissemination, distribution, or

reproduction by anyone other than the intended recipients is prohibited

and may be illegal. If you are not an intended recipient, please

immediately inform the sender and return the electronic mail and its

attachments and destroy any copies which may be in your possession. UCB

screens electronic mails for viruses but does not warrant that this

electronic mail is free of any viruses. UCB accepts no liability for any

damage caused by any virus transmitted by this electronic mail. (Ref:

#*BG0508)

Received on Fri Sep 05 2008 - 07:38:28 EDT

Date: Fri, 5 Sep 2008 13:38:28 +0200

Dear Dirk (and all),

This is a tricky one. After we got our heads together to look at it, we

realized that it's a bit more complex than it appears. The reason why we

use greater-than or equal to (T.GE.TDOS) instead of (T.GT.TDOS) is to get

around an issue with NONMEM. The easiest way to explain why is through an

example - given multiple dosing every 12 hours, and observations at 1, 2,

4, and 8 h post-dose, time after dose (TAD) will need to be set to 0 at

every 12-hourly dosing event - so at this point, TAD==0 and TDOS==1=

2.

However, in order to integrate between 8 h and 12 h in this scheme, NONMEM =

will use a TDOS value of 12 h here, resulting in negative values of TAD

over the 8-12h period - which will clearly produce undesirable results.

Using the IF-THEN structure with (T.GE.TDOS) is a cheat to overcome this.

However, as Sebastien pointed out, another assumption is introduced by

doing it this way - the dose is assumed to be fully absorbed by the last

observation event, in this case 8 h (as opposed to the time of the next

dose, 12 h). This may have fairly problematic consequences, especially

where you have a series of dosing events without observations between

them. We think the best way to tackle this will be to add dummy

observation records (using EVID==2) at inter-dose troughs (e.g. 11.9 h)=

between each successive dose event - another method might be to leverage

NONMEM VI's very helpful model event time (MTIME) variable to take care of =

this.

Hope this was helpful!

Best

Justin (and Rada)

Justin Wilkins

Novartis Pharma AG

PH346, MODELING & SIMULATION

CHBS, WSJ-027.1.084

Novartis Pharma AG

Lichtstrasse 35

CH-4056 Basel

Switzerland

Phone: +41 61 324 6549

Fax: +41 61 324 3039

Mobile: +41 76 561 0949

Email : justin.wilkins

Sébastien Bihorel <sbihorel

Sent by: owner-nmusers

27/08/2008 15:59

To

Garmann Dirk <Dirk.Garmann

cc

nmusers

Subject

Re: [NMusers] FW: transit model

(Sorry for the spelling mistakes)

Dirk,

This absorption model can correctly accommodate multiple dosing only if

the absorption of dose n is complete when dose n+1 is given ! Since the

input is hard-coded and reset at each dose, you have to make sure that

your estimates for MTT and NN provide this complete absorption. Otherwise, =

a part of each dose never enters the system.

I don't really understand how you implemented the transit model but you

may refer to the following code (for Wings for NONMEM) that worked just

fine for me. The frame time for the input function has to start at zero,

so I used a time transform based on a dosing interval of 24h. A column DAY =

is included in the dataset to calculate the new time MYT.

Hope it helps.

Sebastien Bihorel

$PROBLEM Simulation Transit model

$INPUT ID DOSE DAY TI24 TIME AMT RATX CMT EVID DVID DV MDV

$DATA ../Data/Simulation.csv IGNORE=#

$SIM (32047023) NSUB=1

$SUB ADVAN6 TOL3

$THETA (0,6.) ; POP_CL

$THETA (0,100.) ; POP_V2

$THETA (0,18.) ; POP_MTT

$THETA (0.00001,3.) ; POP_n

$THETA (0,6.) ; POP_TABS

$OMEGA BLOCK(2)

0.1 ; BSVCL

0.01 0.1 ; BSVV2

$OMEGA BLOCK(3)

0.1 ; BSVMTT

0.01 0.1 ; BSVN

0.01 0.01 0.1 ; BSVTABS

$SIGMA 0.1 ;cvcp

$SIGMA 0.05 ;sdcp

$MODEL COMP = (ABS) ; absorption compartment

COMP = (CEN) ; central compartment

;$ABBREVIATED DERIV2=NOCOMMON

$PK

"FIRST

" COMMON /PRCOMG/ IDUM1,IDUM2,IMAX,IDUM4,IDUM5

" INTEGER IDUM1,IDUM2,IMAX,IDUM4,IDUM5

" IMAX=1000000

IF(AMT.GT.0.AND.CMT.EQ.1)PODO=AMT; oral dose

F1 = 0.

F2 = 0.

ECL = EXP(BSVCL)

EV2 = EXP(BSVV2)

EMTT = EXP(BSVMTT)

ENB = EXP(BSVN)

ETAB = EXP(BSVTABS)

CL = POP_CL * ECL

V = POP_V2 * EV2

MTT = (POP_MTT * EMTT)/60

NB = POP_n * ENB

TABS = POP_TABS * ETAB

KA = LOG(2)/(TABS/60)

KTR = (NB+1)/MTT ; transit rate constant

LNFA = 0.5*LOG(2*3.14159*NB)+NB*LOG(NB)-NB+LOG(1.+1./(12.*NB)) ;

logarithmic transformation of 2nd Stirling approximation

S2 = V

BIO =1.

$DES

MYT = T -(DAY-1)*24

IF (MYT.LT.0.001) THEN

INPU = 0.

ELSE

INPU = EXP(LOG(BIO*PODO)+LOG(KTR)+NB*LOG(KTR*MYT)-KTR*MYT-LNFA)

ENDIF

DADT(1) = INPU-KA*A(1)

DADT(2) = (KA*A(1)-CL*A(2))/V

$ERROR

CP=A(2)

Y=CP*(1+CVCP)+SDCP

$TABLE ID DAY TIME AMT CMT EVID DVID Y

CL V MTT NB TABS ECL EV2 EMTT ENB ETAB

ONEHEADER NOPRINT

FILE=k0ka1l.fit

Garmann Dirk a écrit :

Dear NONMEM users,

I try to fit a dataset with a high variability in TLAG. With the standard

approaches it was not possible to get successful runs (variability in Tlag =

is always modeled as zero, but their is clearly a high variability)

Therefore I used the transit model, published by Justin Wilkins/Radoika

Savic. For single dose studies it works well (improved fit/successful

runs). Next , I included a multiple drug study and adapted the model. The =

model works, but I have some questions regarding the code (see below in

red). It would be very nice if someone can help to enhance my

understanding.

Thank you in advance

Dirk

$SUBROUTINE ADVAN6 TOL=3

$MODEL NCOMP=3 COMP=(DEPOT) COMP=(CENTRAL,DEFOBS) COMP=(PERIPH)

$PK

"FIRST

" COMMON /PRCOMG/ IDUM1,IDUM2,IMAX,IDUM4,IDUM5

" INTEGER IDUM1,IDUM2,IMAX,IDUM4,IDUM5

" IMAX=9900000

IF(AMT.GT.0.AND.CMT.EQ.1) PD=AMT

IF(AMT.GT.0) TDOS=TIME

TVCL=THETA(1)

CL=TVCL*EXP(ETA(1))

TVV2=THETA(2)

V2=TVV2*EXP(ETA(2))

TVV3=THETA(3)

V3=TVV3*EXP(ETA(3))

TVQ=THETA(4)

Q=TVQ*EXP(ETA(4))

; Absorption model

;F1=0 delete NONMEMS Dose record

F1=0

TVKA=THETA(5)

KA=TVKA*EXP(ETA(5))

;Mean transit time

TVMTT=THETA(6)

MTT=TVMTT*EXP(ETA(6))

;Number of transit compartments

TVNN=THETA(7)

NN=TVNN*EXP(ETA(7))

;Transit rate constant

KTR=(NN+1)/MTT

;Sterling

L=LOG(2.5066)+(NN+.5)*LOG(NN)-NN

S2=V2/1000

; DOSE : mg

; CONC: ng/ml

$DES

X=0.00001; Avoid LOG 0

;multiple dose

IF(T.GE.TDOS)THEN ; if current time greater than TDOS

Is this correct? I think GE might be a typo and should be GT?

DADT(1) = EXP(LOG(PD + X) + LOG(KTR +

X)+NN*LOG(KTR*(T-TDOS)+X)-KTR*(T-TDOS)-L)-KA*A(1)

ELSE

; Dose given

DADT(1) = EXP(LOG(PD + X) + LOG(KTR + X)+ NN*LOG(KTR*T + X) - KTR*T - L)-=

KA*A(1)

ENDIF

T.GE.TDOS (see above) might be a typo; otherwise this equation will never

be active?

I try this model with GT, the fit improves, but why is this statement

needed?

Can someone explain this (red) part of the equation, please?

I think if the time is e.g. 24 hours (time of second dose) the value of

the input function will be low, as it should be to simulate the lag time

(I used MTT=1, NN=4, to recalculate it). With further increased time (n=

ext

doses), the value of the input function will be approximately zero (ok).

But without this equation and

IF(AMT.GT.0.AND.CMT.EQ.1) PD=AMT

IF(AMT.GT.0) TDOS=TIME

(T-TDOS) should be zero at each dose event and the value of the input

function at a new dose event is also approximately zero (same as above?)

Any help to enhance my understanding is welcome

DADT(2)=KA*A(1)-Q/V2*A(2)+Q/V3*A(3)-CL/V2*A(2)

DADT(3)=Q/V2*A(2)-Q/V3*A(3)

$ERROR

One last question:

For some subjects I got some bizarre estimation values. I think this might =

be because I have sometimes dose events, but no observations (multiple

dose study) prior to the next dose.. Therefore, if I correctly understand

the code, the input value for these dose events will be approximately

zero.

Any suggestions to solve this problem are welcome.

Best regards

Dirk Garmann

SCHWARZ BIOSCIENCES GmbH

A Member of the UCB Group

Alfred-Nobel-Str. 10 - 40789 Monheim - Germany

Tel +49 2173 48 0 - Fax +49 2173 48 1608

Geschaeftsfuehrer: Prof. Dr. Iris Loew-Friedrich, Detlef Thielgen

Amtsgericht Duesseldorf HRB 46849

Legal Notice: This electronic mail and its attachments are intended solely =

for the person(s) to whom they are addressed and contain information which =

is confidential or otherwise protected from disclosure, except for the

purpose for which they are intended. Dissemination, distribution, or

reproduction by anyone other than the intended recipients is prohibited

and may be illegal. If you are not an intended recipient, please

immediately inform the sender and return the electronic mail and its

attachments and destroy any copies which may be in your possession. UCB

screens electronic mails for viruses but does not warrant that this

electronic mail is free of any viruses. UCB accepts no liability for any

damage caused by any virus transmitted by this electronic mail. (Ref:

#*BG0508)

Received on Fri Sep 05 2008 - 07:38:28 EDT