Jump to content


Photo

Fitting endogenous baseline for a PK analytes


  • Please log in to reply
12 replies to this topic

#1 ElliotOffman

ElliotOffman

    Member

  • Members
  • PipPip
  • 15 posts

Posted 05 February 2016 - 02:17 PM

Hi Certara team,

 

I'm just confirming (a) whether my syntax is correct for two different baseline models where there is endogenous drug in the body and

(B) whether there is an easier GUI or build-in way to do this..

 

I use the two simple examples of a fixed, stable baseline and one where there is synthesis but no feedback:

 

 

or do these need to be coded in only as user-define models:

 

(1) Simple 1-comp with extravascular absorption

deriv(Aa = - Ka * Aa)

               deriv(A1 = Ka * Aa - Cl * C)

               C = A1 / V

               error(CEps = 1)

               observe(CObs = Base + C * (1 + CEps)) #where the observed value is the Cpred with error + baseline?

where base is a structural parameter that is estimated:

stparm(Base=tvBase*exp(nBase) #defined as the baseline concentration with some interindividual variability

fixef(tvBase=c(,1,))

               stparm(Ka = tvKa * exp(nKa))

               stparm(V = tvV * exp(nV))

               stparm(Cl = tvCl * exp(nCl))

               fixef(tvKa = c(, 1, ))

               fixef(tvV = c(, 1, ))

               fixef(tvCl = c(, 1, ))

               ranef(diag(nKa, nV, nCl, nBase) = c(1, 1, 1,1)

 

 

 

(2) baseline which is being continuously produced at a stable rate without any feedback loop

 

deriv(Aa = - Ka * Aa)

deriv(A1 = (kbase_pro+ Ka )* Aa - Cl * C)

C = A1 / V

error(CEps = 1)

observe(CObs = C* (1 + CEps)) #here the assumption is the observed is a combined amount of baseline and exogenous drug

where base is a structural parameter that is estimated:

stparm(kbase_prod=tvbase_prod*exp(nbase_prod) #defining baseline production rate constant

fixef(tvBase=c(,1,))

stparm(Ka = tvKa * exp(nKa))

stparm(V = tvV * exp(nV))

stparm(Cl = tvCl * exp(nCl))

fixef(tvKa = c(, 1, ))

fixef(tvV = c(, 1, ))

fixef(tvCl = c(, 1, ))

ranef(diag(nKa, nV, nCl, nkbase_prod) = c(1, 1, 1,1)

 

Thank you,

Elliot

 

 

 

 

 

 

 

 

 

 

 



#2 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 05 February 2016 - 04:02 PM

Dear Elliott

You can do it with the graphical interface with a small difference in the observe statement.

The model_1 will put the proportional error on the base+C rther than just C which is OK.

The second scenario can be done with graphical 100%.

The project is attached for you to review.

let me know if all is clear.,

Best

Serge

 

Attached Files



#3 ElliotOffman

ElliotOffman

    Member

  • Members
  • PipPip
  • 15 posts

Posted 05 February 2016 - 04:12 PM

Dear Elliott

You can do it with the graphical interface with a small difference in the observe statement.

The model_1 will put the proportional error on the base+C rther than just C which is OK.

The second scenario can be done with graphical 100%.

The project is attached for you to review.

let me know if all is clear.,

Best

Serge

Thanks Serge,

For option 2, if we assume a zero order production I just assume its a simple adjustment where the kbase is mass/time and goes right into the central compartment?



#4 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 05 February 2016 - 04:27 PM

Thanks Serge,

For option 2, if we assume a zero order production I just assume its a simple adjustment where the kbase is mass/time and goes right into the central compartment?

 

Dear Elliot

Note that with my model_2, the input rate into central is the sum of Ka and production, not only Ka.

For the third scenario I upodated the model

Attached Files



#5 ElliotOffman

ElliotOffman

    Member

  • Members
  • PipPip
  • 15 posts

Posted 25 May 2016 - 06:53 PM

Hello again,

I have another similar question I'm requesting some ideas for.

I have some in-vitro kinetic data for a vehicle response where I'm attempting to fit the rate of formation and rate of degredation of the byproduct.

it seems to look like a 1-comp type model, but the data has a baseline observation. meaning the very first measurement has some background response. So I have two options as I see it, model the change from the baseline response, or attempt to quantify/estimate the immediate formation of the response...

the latter is more appealing to me and I thought maybe I can set the initial conditions to whatever the time=0 concentration value is. does this make sense and if so, how would it best be enabled in the model.

 

background: I'm watching the formation and then dissapearance of a byproduct which follows a rate of formation and rate of disappearance type pattern. I'm using the substrate which is added into the reaction vessel as the dose and assuming a 1:1 mol added to mol formed...for the purpose of this exercise.

Thanks

Elliot



#6 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,328 posts

Posted 26 May 2016 - 09:08 AM

testing paste of PML code.

 

test(){

      # test- no code

 

}


Edited by Simon Davis, 26 May 2016 - 10:12 AM.


#7 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 26 May 2016 - 09:29 AM

testing too: Simon, I could not see oyur code but when I tried with the new version of Phoenix, then I can copy and paste. I could not do it with 14 patch. Anyway now it is working (either version difference or laptop difference).
 
 
test(){
fcovariate(WT)
#fcovariate(Prior_Therapy, N_Chemo, Age, Sex(), Baseline(), Disease(), Height, BSA)
fcovariate(Azole())
double(EHYN)
dosageinterval = 12
sequence{
while(t<800){
EHYN=0
sleep(TENT)
EHYN=1
sleep(dosageinterval-TENT)
EHYN=0
}
}
#$DES 
#EHYN=(T-DOST)**40/((T-DOST)**40+(ADT)**40)
#DADT(1)=-KA*A(1)
#DADT(2)= KA*A(5)-(1-FENT)*K20*A(2)-FENT*K24*A(2)   
#DADT(3)= K24*A(2)*FENT-EHYN*K41*A(3)
#DADT(4)=KA*A(1)-KA*A(4)
#DADT(5)=KA*A(7)-KA*A(5)+K41*A(3)*EHYN
#DADT(6)=KA*A(4)-KA*A(6)
#DADT(7)=KA*A(6)-KA*A(7)
#deriv(T = 1)
deriv(A1 = - Ka * A1)
deriv(A2 = Ka * A5 - (1-finh)*fm*(1-FENT)*K24*A2 - (1-fm)*(1-FENT)*K20*A2 - FENT*K24*A2)
deriv(A3 = K24*A2*FENT-EHYN*K41*A3)
deriv(A4 = Ka*A1 - Ka*A4)
deriv(A5 = Ka*A7 - Ka*A5 + K41*A3*EHYN)
deriv(A6 = Ka*A4 - Ka*A6)
deriv(A7 = Ka*A6 - Ka*A7)
deriv(A8 = (1-finh)*fm*(1-FENT)*K24*A2 - K80*A8)
 
FENT=1/(1+exp(FENTS))
K20=Cl/V
K24=K20
K80=Clm/V8
#Cb = Bmax*Cu/(Cu+KD)
 
dosepoint(A1)
C = A2 / V
fu = 1/(1+exp(lfu))
Cu = fu * C
fm = 1/(1+exp(lfm))
Cm = A8 / V8
 
error(CEps = 0.421998)
observe(CObs = C * (1 + CEps))
#error(CuEps = 0.4)
observe(CuObs = Cu * (1 + CEps))
error(CmEps = 0.50359)
observe(CmObs = Cm * (1 + CmEps))
#observe(CmObs = Cm + CmEps * sqrt(1 + Cm^2 * (CmMultStdev/sigma())^2))
 
stparm(Ka = tvKa * exp(nKa))
stparm(V = tvV * (WT/80) * exp(nV))
stparm(V8 = tvV8 * (WT/80))
stparm(Cl = tvCl * (WT/80)**0.75 * exp(nCl))
stparm(FENTS = tvFENTS)
stparm(K41 = tvK41)
stparm(TENT = tvTENT)
stparm(lfu = tvlfu + nlfu)
stparm(lfm = tvlfm)
stparm(finh = tvfinb*(Azole==1))
stparm(Clm = tvClm * (WT/80)**0.75 * exp(nClm))
#stparm(CMultStdev = tvCMultStdev)
#stparm(CuMultStdev = tvCuMultStdev)
#stparm(CmMultStdev = tvCmMultStdev)
 
fixef(tvKa = c(0, 3.85418, ))
fixef(tvV = c(0, 193.276, ))
fixef(tvV8 = c(0, 39.8259, ))
fixef(tvCl = c(0, 9.92963, ))
fixef(tvFENTS = c(, 1.56032, ))
fixef(tvK41 (freeze) = c(, 0.0819305, ))
fixef(tvTENT (freeze) = c(, 5.94954, ))
fixef(tvlfu = c(, 3.99014, ))
fixef(tvlfm = c(, 0.118069, ))
fixef(tvClm = c(0, 48.2235, ))
fixef(tvfinb(enable=c(0)) = c(0, 0.485611, 1))
#fixef(tvCMultStdev = c(0, 0.422415, ))
#fixef(tvCuMultStdev = c(0, 0.422415, ))
#fixef(tvCmMultStdev = c(0, 0.4, ))
 
ranef(
block(nV, nCl) = c(0.52532669, 0.34471439, 0.56285167)
diag(nKa, nlfu, nClm) = c(0.40166745, 0.50202607, 0.0582795)
)
}


#8 ElliotOffman

ElliotOffman

    Member

  • Members
  • PipPip
  • 15 posts

Posted 26 May 2016 - 06:37 PM

I'm guessing that those resposnes were tests and not a reply to my posting.

I am curious what Forum's thoughts are on accounting for the baseline effect with a stparm/fixef for baseline and adding a sequence statement to change the initial conditions (like when we fit the baseline effect in a PD model).

thoughts?

Elliot



#9 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 27 May 2016 - 04:33 AM

I'm guessing that those resposnes were tests and not a reply to my posting.

I am curious what Forum's thoughts are on accounting for the baseline effect with a stparm/fixef for baseline and adding a sequence statement to change the initial conditions (like when we fit the baseline effect in a PD model).

thoughts?

Elliot

Dear Elliot

sequence{E=baseline}

# E is the predicted PD response

stparm(baseline=tvbaseline*exp(nbaseline))

fixef(tvbaseline=c(,100,))

ranef(diag(nbaseline)=c(1))

 

This code with arbitrary values I put would estimate the baseline using the sequence statementand random variable for baseline.

 

This gives flexibility to non steady state situations at t=0 for PD.

Is it what you are looking for. Of course you need a differential equation that defines the mass balance for E, your predicted response.

Best

Serge



#10 ElliotOffman

ElliotOffman

    Member

  • Members
  • PipPip
  • 15 posts

Posted 27 May 2016 - 03:43 PM

Hi Serge,

 

I am not sure I understand the last part of the differential equation for that defines mass balance for the response (E).

I started with the basic closed form 1-comp and then edited as text.

I thought if Cbase is the baseline concentration, I'd only need a sequence statement to state that C=Cbase at time=0.

is that not correct?

Elliot

 

code:

 deriv(A1 = - (A1 * Ke) + (Aa * Ka))
 urinecpt(A0 = (A1 * Ke))
 deriv(Aa = - (Aa * Ka))
 C = A1 / V
 dosepoint(Aa, idosevar = AaDose, infdosevar = AaInfDose, infratevar = AaInfRate)
 error(CEps = 1)
 observe(CObs = C + CEps)
 stparm(V = tvV) #volume of reaction vessel (fixed at 1 mL)
 stparm(Ke = tvKe) #rate of degredation of by-product
 stparm(Ka = tvKa) #rate of formation of by-product
 stparm(Cbase=tvCbase)
 fixef(tvCbase= c(0,0.8,)) #inital concentration of by-product at time=0
 sequence{C=Cbase}
 fixef(tvV(freeze) = c(0, 0.001, ))# Litres
 fixef(tvKe = c(0, 1.35, ))
 fixef(tvKa = c(0, 1, ))
}
 

 

the data looks like this:

Time Sample Treatment Response

0 1 Vehicle 0.58483476 [baseline/endogenous non steady-state value]
1 1 Vehicle 8.7162911
2 1 Vehicle 8.7984377
4 1 Vehicle 7.7748881
6 1 Vehicle 7.3985505
8 1 Vehicle 6.5261532
0 2 Vehicle 0.75815878
1 2 Vehicle 9.1237395
 



#11 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 27 May 2016 - 04:17 PM

Hi Serge,

 

I am not sure I understand the last part of the differential equation for that defines mass balance for the response (E).

I started with the basic closed form 1-comp and then edited as text.

I thought if Cbase is the baseline concentration, I'd only need a sequence statement to state that C=Cbase at time=0.

is that not correct?

Elliot

 

code:

 deriv(A1 = - (A1 * Ke) + (Aa * Ka))
 urinecpt(A0 = (A1 * Ke))
 deriv(Aa = - (Aa * Ka))
 C = A1 / V
 dosepoint(Aa, idosevar = AaDose, infdosevar = AaInfDose, infratevar = AaInfRate)
 error(CEps = 1)
 observe(CObs = C + CEps)
 stparm(V = tvV) #volume of reaction vessel (fixed at 1 mL)
 stparm(Ke = tvKe) #rate of degredation of by-product
 stparm(Ka = tvKa) #rate of formation of by-product
 stparm(Cbase=tvCbase)
 fixef(tvCbase= c(0,0.8,)) #inital concentration of by-product at time=0
 sequence{C=Cbase}
 fixef(tvV(freeze) = c(0, 0.001, ))# Litres
 fixef(tvKe = c(0, 1.35, ))
 fixef(tvKa = c(0, 1, ))
}
 

 

the data looks like this:

Time Sample Treatment Response

0 1 Vehicle 0.58483476 [baseline/endogenous non steady-state value]
1 1 Vehicle 8.7162911
2 1 Vehicle 8.7984377
4 1 Vehicle 7.7748881
6 1 Vehicle 7.3985505
8 1 Vehicle 6.5261532
0 2 Vehicle 0.75815878
1 2 Vehicle 9.1237395
 

I thought you are talking about a PK/PD model.

For PK only, you cannot use the sequence statement with the cfmicro, but only with the derive statement.

However it will not help you because your amount may start at the baseline but it will end at 0.

If you want a constant endogenous PK level, here is a suggestion for the code to use.

Look at the last model in the attached project.

Best Regards

Serge

Attached Files



#12 ElliotOffman

ElliotOffman

    Member

  • Members
  • PipPip
  • 15 posts

Posted 27 May 2016 - 04:38 PM

I thought you are talking about a PK/PD model.

For PK only, you cannot use the sequence statement with the cfmicro, but only with the derive statement.

However it will not help you because your amount may start at the baseline but it will end at 0.

If you want a constant endogenous PK level, here is a suggestion for the code to use.

Look at the last model in the attached project.

Best Regards

Serge

So I'm not necessarily saying I want a constant baseline...there is some drug in the vessel before the reaction starts. The reaction adds to the amount in the vessel and then both the baseline amount and the amount formed from the reaction begin to degrade/cleared slowly.  it seems the last model does this, but I want to make sure.



#13 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 27 May 2016 - 04:47 PM

So I'm not necessarily saying I want a constant baseline...there is some drug in the vessel before the reaction starts. The reaction adds to the amount in the vessel and then both the baseline amount and the amount formed from the reaction begin to degrade/cleared slowly.  it seems the last model does this, but I want to make sure.

no it does not. Now the new attached project has the 2 options. one with fixed endogenous and one with non zero initial amount of drug. The trick is that you need to shift to the differential equation mode and defining in sequence the initial amount of drug(not the concentration). These are the rules, C is calculated from A1 and A1 is the one that can be initialized.

Look at the 2 outputs and you will see. The first one will start and finish at the same value while the other one will start high but will go to 0. That one is apparently the one you are looking for. You cannot use the cfmicro statement to get that but only the derive statement.

Best Regards

Serge

Attached Files






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users