Jump to content


Photo

Model Building Syntax with Phoenix


  • Please log in to reply
7 replies to this topic

#1 Aline FUCHS

Aline FUCHS

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 13 May 2010 - 06:48 PM

Dear all,

 

I want to model my individual observed data (it is not a population analysis) which requires me to write my own model in order to test some hypothesis. I have some questions regarding the structure and syntax of a user model:

 

 

1/ Does Phoenix require at some points to write analytical solutions? Or only differential equations are enough?

 

2/ How to implement a time condition? For example, how to implement a model with differential equations before and after Tau and or before and after Tmax? (I remember to use IF statement in ASCII model, but I guess it is now “DOBEFORE / DOAFTER. Although, I do not figure out the way I should write it in a block)

Should I open a “sequence { }” using this kind of statement?

 

3/ If I want to assign each subject their own initial parameter estimates, using “Set Up < Parameters < use internal worksheet”, do I have to erase all fixef ( tvKa…. in the textual model?

 

4/ If I want weight the data, do I have also to write it in the textual model? Or does phoenix model object have an option to achieve that?

 

 

In advance, thank you for your help,

 

Sincerely,

 

Aline



#2 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,318 posts

Posted 21 May 2010 - 08:48 PM

Dear Aline,

I wanted to give you some feedback on your questions;

1/ In a Phoenix model differential equations are sufficient. Please take a look at the Phoenix 1.1 Modeling Language Reference Guide.pdf which can be found in C:\Program Files\Pharsight\Phoenix\docs

2/ Yes I would recommend a SEQUENCE statement, an example is given on page 40 of the Modelling language guide.

4/ for examples of how weighting is implemented in the code I would suggest trying different weighting options in built in and observing how they change in the Model Text. the data. You can consider that;

Additive is uniform in classical WinNonlin (Cpred + eps)
Multiplicative is 1/Yhat*Yhat in WNL (Cpred + Cpred*eps)
Power is (Yhat)-2a (Cpred + Cpreda*eps)

AS well as Cmix ratio and Custom defined weighting

Best regards,
Simon.
___________________________________
Forthcoming meetings and training -www.pharsight.com/training;
Transitioning to Phoenix NLME v6.1: 8 June 2010 Berlin, Germany (prior to PAGE).
Transitioning to Phoenix v6.1: 6 Sept 2010, Amsterdam, Holland.
Introduction to Phoenix v6.1: 7-9 Sept 2010, Amsterdam, Holland.

#3 Aline FUCHS

Aline FUCHS

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 25 May 2010 - 07:07 PM

Dear Simon,

Thank you so much for your response.

However some points remain unclear. I have already read the Phoenix 1.1 Modeling Language Reference Guide.pdf, including the partial example page 40, but, my models do not work yet.

I took the liberty of showing you one of them that I would test for my data. . Looking at some similar cases in the literature, the goal is to test a dual absorption where:
- K0 is a zero order constant, occurring before a time called tau
- K1 is a first order constant occurring after tau.
I will choose tau by trying different values by myself.
First, I will fix bioavailability F = 1.
Fr represents the fraction of drug extracted by first order mechanism.
Parameters that I want to estimate are V, Ka, Ke, Fr and probably F later.

test(){
deriv(Aa = - K0 - K1 * Aa)
# subcut. cpt
deriv(A1 = K0 + K1 * Aa - Ke * A1)
# central cpt
dosepoint(Aa)
C = A1 / V
K0=(F * (1-Fr)* Aa) / tau
# 0 order definition
K1= Ka * F * Fr * Aa * exp(-Ka * (t-tau))
# 1st order definition
stparam (tau=5)
sequence {
dobefore (tau)
K1=0
doafter (tau)
K0=0
}
# time condition
error(CEps = 1)
observe(CObs = C + C ^ (0) * CEps) # weight 1 / yhat*yhat
stparm(F = (tvF))
stparm(Fr = (tvFr))
stparm(Ka = (tvKa))
stparm(Ke = (tvKe))
stparm(V = (tvV))
fixef(tvF (freeze) = 1) # fixed value
fixef(tvFr = c(0, 0.5,1 ))
fixef(tvKa = c(0, 0.02, ))
fixef(tvKe = c(0, 0.1, ))
fixef(tvV = c(0, 100, ))
}


* Can I implement, as I did before, the K0 and K1 equation?
* Does K1 can be defined as I wrote? (Introducing a value (t-tau) in the exponential term?)
* I assume that my time parameter and time sequence is written wrong, though I tried several other ways but none of them is taken into account. I can not figure out how implement it.
* Can I use fixef(tvF (freeze) = 1) to fix F for now?
* Should I use the same way (freeze) to define tau?

(It is a lot of questions… I have currently no idea any more to find in which direction I should look for to write properly a model)

Many thanks,
Best regards,

Aline

#4 Samer Mouksassi

Samer Mouksassi

    Advanced Member

  • Val_Members
  • PipPipPip
  • 90 posts

Posted 25 May 2010 - 07:34 PM

Hi Aline,

 

I understand that you want to try a sequential zero/first order absorption model.

 

You can have a code with the following characteristics by slightly modifying your dataset or dosing sheet to include one extra column for the dose that will be absorbed with the different mechanism.

 

Suppose we have a dose of 100 mg in your data make another column copying the initial AMT column but use a different name.

ID TIME AMT AMT2

1 0 100 100

modify your dose points accordingly using two different ones:

dosepoint(A1,bioavail=FREL,duration=tau)

dosepoint(Aa,bioavail=1-FREL,lag=tau)

 

AMT goes to A1 while AMT2 goes to Aa.

the total absorbed dose will be FREL*AMT+1-FREL*AMT2= AMT or AMT2 (100)

the absorption starts with a zero order process at time zero ( no lag) and a duration =tau

the first order process starts at time =tau which can be fixed or estimated.

 

After time=tau the zero order is finished and you are only left with the zero order process.

 

let me know if this is not clear.

 

Bests,

 

Samer



#5 Aline FUCHS

Aline FUCHS

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 02 June 2010 - 05:21 PM

Dear Samer,

Many Thanks for your help. I tried the sequential 0 / 1st order absorption with 2 dose points which is much better. A couple of questions following, still regarding the model syntax and the output file.

• In a model written as follows:
dosepoint(A1, bioavail = Fr, duration = Tau)
dosepoint(Aa, bioavail = 1-Fr, tlag = Tau)
Please confirm that Fr represents the fraction absorbed by 0 order.

• Is it possible to define my constant K0 and K1 (like it would have be done, I assume, in a Temporary Block in the previous WNL 5.1) if I write:
K0 = (F * (1-Fr)* Aa) / tau
K1 = Ka * F * Fr * Aa * exp (-Ka * (t-tau))
In the same way as C = A1 / V is defined, does phoenix read it? In this case, can Ka estimated as my parameter, instead of K0 or K1 [although, in any case, I am not sure that phoenix can read exp (-Ka * ( t – tau ))]?

• In the output, Overall worksheet, log likelihood, -2LL, AIC, BIC are used as criteria for the model fit. Are log likelihood and -2LL useful criteria in a case of individual data? Is AIC calculated in the same manner with PK model from the library as it is with a model from the phoenix model object? (I tried both for the same model but criteria are more elevated with my user model…I wondered how to choose the more suitable model but I am unsure of the meaning of these values)

• Applying a Michaelis-Menten model from the WNL library, it is written as follows:
deriv(A1 = - Vmax * C / (Km + C))
dosepoint(A1)
However, in the Phoenix 1.1 Modeling Language Reference Guide, p36, it I said “a Michaelis-Menten model of reaction can be written as :
observe (RxnRate © = Vmax*C / (C+Km) + eps)” .
Could you clarify this statement?

• I keep wondering if, when using the object user model, it is possible to use the parameter worksheet in the set up menu to assign to each subject his/her own initial estimate. If yes, what should be done with fixef = c ( , …, ) in the model?


Sincerely,

Aline

#6 Samer Mouksassi

Samer Mouksassi

    Advanced Member

  • Val_Members
  • PipPipPip
  • 90 posts

Posted 02 June 2010 - 05:31 PM

• In a model written as follows:

dosepoint(A1, bioavail = Fr, duration = Tau)

dosepoint(Aa, bioavail = 1-Fr, tlag = Tau)

Please confirm that Fr represents the fraction absorbed by 0 order.

 

Yes this is correct

 

• Is it possible to define my constant K0 and K1 (like it would have be done, I assume, in a Temporary Block in the previous WNL 5.1) if I write:

K0 = (F * (1-Fr)* Aa) / tau

K1 = Ka * F * Fr * Aa * exp (-Ka * (t-tau))

 

Why you want to explicitly define these values phoenix pml take care of that automatically

Phoenix pml will interpret that there is a zero order inpu and a first order rate

 

• In the output, Overall worksheet, log likelihood, -2LL, AIC, BIC are used as criteria for the model fit. Are log likelihood and -2LL useful criteria in a case of individual data? Is AIC calculated in the same manner with PK model from the library as it is with a model from the phoenix model object? (I tried both for the same model but criteria are more elevated with my user model…I wondered how to choose the more suitable model but I am unsure of the meaning of these values)

 

use the same statistic from the same object e.g:

if you fitted individual models using phoenix models try to see for the specific individual what was the AIC under the different models you can then see which model fitted better this specific subjects.

 

If you want to judge which model was best across all subjects a mean or median AIC can be used. However I prefer to use population models and not individual ones if you want to inference about the population.

 

Bests,

 

Samer

 

 

 

 

• Applying a Michaelis-Menten model from the WNL library, it is written as follows:

deriv(A1 = - Vmax * C / (Km + C))

dosepoint(A1)

However, in the Phoenix 1.1 Modeling Language Reference Guide, p36, it I said “a Michaelis-Menten model of reaction can be written as :

observe (RxnRate © = Vmax*C / (C+Km) + eps)” .

Could you clarify this statement?

 

• I keep wondering if, when using the object user model, it is possible to use the parameter worksheet in the set up menu to assign to each subject his/her own initial estimate. If yes, what should be done with fixef = c ( , …, ) in the model?



#7 Aline FUCHS

Aline FUCHS

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 18 June 2010 - 02:51 PM

Dear Samer and Simon,

 

I would like to further discuss some points from my previous questions:

 

1 / weighting:

I understand that to get 1 / Y * Y or 1 / Yhat * Yhat like in a classic WinNonLin model, a multiplicative error model must be used. By this way, I obtained an error model as followed

error(CEps = 1)

observe(CObs = C * (1 + CEps))

which I assumed to be equivalent to 1 / Y * Y

Previously, you said that for predicted values, (Cpred + Cpred*eps) for 1 / Yhat * Yhat must be the error model used. But I did not manage to implement it correctly. Could you please write all of the 2 lines with this weighting?

 

2/ sequential dual absorption

I have written the sequential dual absorption as followed:

deriv(Aa = - K0 -K1 * Aa)

deriv(A1 = K0 + K1 * Aa - K10 * A1 - K12 * A1 + K21 * A2)

deriv(A2 = K12 * A1 - K21 * A2)

dosepoint(A1, bioavail = Fr, duration = Tau)

dosepoint(Aa, bioavail = 1-Fr, tlag = Tau)

Where A1is always the central compartment.

 

Looking to this model, I have been told that it should perhaps have been written:

deriv(Aa1=-K0)

deriv(Aa2=-K1*Aa2)

deriv(A1=K0+K1*Aa2-K10*A1-K12*A1+K21*A2)

deriv(A2=K12*A1-K21*A2)

dosepoint(Aa1,bioavail=Fr,duration=tau)

dosepoint(Aa2,bioavail=(1-Fr),tlag=tau)

C=A1/V

 

Which one is correct? Writing “duration”, from where to where is going the 0-order flow? What is the difference between these following dosepoint ?

dosepoint(A1, bioavail = Fr, duration = Tau)

dosepoint(Aa, bioavail = 1-Fr, tlag = Tau)

 

dosepoint(Aa1,bioavail=Fr,duration=tau)

dosepoint(Aa2,bioavail=(1-Fr),tlag=tau)

 

dosepoint(Aa,bioavail=Fr,duration=tau)

dosepoint2(Aa,bioavail=(1-Fr),tlag=tau)

 

where I always consider Aa as subcutaneous compartment and A1 as central compartment.

 

3/ Use of graphical model building tool

I try to use the graphical tool as well.

For example, I add a Tlag to Aa compartment, I fill in the blank with a time parameter called Tau that I want to estimate. However, this new parameter does not appear neither in the parameter tab nor in the initial estimate tab. Did I do something wrong? Or should I then edit it as textual model and add this fixef ?

 

As always, many thanks for your answers,

 

Sincerely

 

Aline



#8 Samer Mouksassi

Samer Mouksassi

    Advanced Member

  • Val_Members
  • PipPipPip
  • 90 posts

Posted 18 June 2010 - 07:53 PM

Dear Samer and Simon,

 

I would like to further discuss some points from my previous questions:

 

1 / weighting:

I understand that to get 1 / Y * Y or 1 / Yhat * Yhat like in a classic WinNonLin model, a multiplicative error model must be used. By this way, I obtained an error model as followed

error(CEps = 1)

observe(CObs = C * (1 + CEps))

which I assumed to be equivalent to 1 / Y * Y

Previously, you said that for predicted values, (Cpred + Cpred*eps) for 1 / Yhat * Yhat must be the error model used. But I did not manage to implement it correctly. Could you please write all of the 2 lines with this weighting?

##############

try experimenting with the different error options to see how to write in pm;

it is not advised to use the observations as weights ( Y ) but use Y hat or PRED

 

observe(CObs = C * (1 + CEps)) this is equivalent to 1 / Yhat* Yha

error(CEps = 1) --> additive

as I mentioned do not use the 1/Y*Y ( since raw observed data will propagate unwanted error)

 

2/ sequential dual absorption

I have written the sequential dual absorption as followed:

deriv(Aa = - K0 -K1 * Aa)

deriv(A1 = K0 + K1 * Aa - K10 * A1 - K12 * A1 + K21 * A2)

deriv(A2 = K12 * A1 - K21 * A2)

dosepoint(A1, bioavail = Fr, duration = Tau)

dosepoint(Aa, bioavail = 1-Fr, tlag = Tau)

Where A1is always the central compartment.

 

Looking to this model, I have been told that it should perhaps have been written:

deriv(Aa1=-K0)

deriv(Aa2=-K1*Aa2)

deriv(A1=K0+K1*Aa2-K10*A1-K12*A1+K21*A2)

deriv(A2=K12*A1-K21*A2)

dosepoint(Aa1,bioavail=Fr,duration=tau)

dosepoint(Aa2,bioavail=(1-Fr),tlag=tau)

C=A1/V

 

Which one is correct? Writing “duration”, from where to where is going the 0-order flow? What is the difference between these following dosepoint ?

 

 

##########################

you do not need to include zero order rates into your differential equations...

imagine that the first order dose goes to Aa then it will be absorbed via ka from Aa to A1

while the zero order part will go directly to A1

the tag and duration help you to modify the order of events

#########################

deriv(Aa=-Ka*Aa)

deriv(A1=Ka*Aa-K10*A1-K12*A1+K21*A2)

# the zero order part is implied using the dosepoint

deriv(A2=K12*A1-K21*A2)

dosepoint(A1,bioavail=Fr,duration=tau) # zero order to A1 with duration tau

dosepoint(Aa,bioavail=(1-Fr),tlag=tau)

# remaining part of dose going into Aa after a tau lag it will be absorbed with a Ka *Aa rate

C=A1/V

 

 

 

dosepoint(A1, bioavail = Fr, duration = Tau)

dosepoint(Aa, bioavail = 1-Fr, tlag = Tau)

##########################

# FR * Dose that was mapped to A1 goes into A1

# 1 -FR *Dose that was mapped to Aa goes to Aa this is a bolus into Aa then it will be absorbed with ka as per the differential equation linking Aa and A1

 

 

 

 

dosepoint(Aa1,bioavail=Fr,duration=tau)

dosepoint(Aa2,bioavail=(1-Fr),tlag=tau)

 

dosepoint(Aa,bioavail=Fr,duration=tau)

dosepoint2(Aa,bioavail=(1-Fr),tlag=tau)

 

where I always consider Aa as subcutaneous compartment and A1 as central compartment.

 

######

 

 

 

 

3/ Use of graphical model building tool

I try to use the graphical tool as well.

For example, I add a Tlag to Aa compartment, I fill in the blank with a time parameter called Tau that I want to estimate. However, this new parameter does not appear neither in the parameter tab nor in the initial estimate tab. Did I do something wrong? Or should I then edit it as textual model and add this fixef ?

 

######

in graphical model right click on you model window and select insert parameter

than name it the corresponding name.

 

# let me know if you need anything else.

you can call me at 514 475 9339 for a chat

I am located at the east coast time zone






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users