Jump to content


Photo

Initial fcntheta1 NaN error in NLME


  • Please log in to reply
2 replies to this topic

#1 BP1968

BP1968

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 06 February 2020 - 05:59 PM

Dear all,

 

I am trying to write a PK model for inverse gaussian absorption following subcutaneous administration of a drug (see Csajka C, Drover D, Verotta D. The use of a sum of inverse Gaussian functions to describe the absorption profile of drugs exhibiting complex absorption. Pharm Res. 2005;22(8):1227-35). The model text is below. When running the model, I consistently get an error "Model execution failed. Initial fcntheta1 value NaN". I tried different initial estimates and different algorithms without success. Any suggestion?

 

Thank you,

 

Bruno

 

test(){

input = (MAT/(6.283*CV^2*t^3))^0.5*exp(-((t-MAT)^2)/(2*CV^2*MAT*t))
deriv(Aa = - input * Aa)
deriv(A1 = input * Aa - Cl * C - Cl2 * (C - C2))
deriv(A2 = Cl2 * (C - C2))
dosepoint(Aa)
C = A1 / V
C2 = A2 / V2
error(CEps = 0.1)
observe(CObs = C * (1 + CEps))
stparm(MAT = tvMAT * exp(nMAT))
stparm(CV = tvCV * exp(nCV))
stparm(V = tvV * exp(nV))
stparm(V2 = tvV2 * exp(nV2))
stparm(Cl = tvCl * exp(nCl))
stparm(Cl2 = tvCl2 * exp(nCl2))
fixef(tvMAT = c(, 1, ))
fixef(tvCV = c(, 1, ))
fixef(tvV = c(, 1, ))
fixef(tvV2 = c(, 1, ))
fixef(tvCl = c(, 1, ))
fixef(tvCl2 = c(, 1, ))
ranef(diag(nV, nCl, nMAT, nCV, nV2, nCl2) = c(1, 1, 1, 1, 1, 1))
}
override test(){
  fixef(tvMAT = c(,5,))
fixef(tvCV = c(,0.1,))
  fixef(tvV = c(,2876.17166666667,))
  fixef(tvV2 = c(,11299.7133333333,))
  fixef(tvCl = c(,19.7714833333333,))
  fixef(tvCl2 = c(,80.6368833333333,))
}
 


#2 smouksassi1

smouksassi1

    Advanced Member

  • Members
  • PipPipPip
  • 231 posts
  • LocationMontreal

Posted 07 February 2020 - 10:26 AM

you need to guide against input being zero at time zero.

 

option 1: only apply the input when time above zero otherwise it is zero.

input =  t ==0 ? 0 : ((MAT/(6.283*CV^2*t^3))^0.5) *exp(-((MAT-t)^2)/(2*CV^2*MAT*t))
 
option 2: put a small amount of time next to t:
P1 = (MAT/(2*3.14*CV*CV*(t+0.000001)**3))
P2 = P1**0.5
P3 = (MAT-(t+0.000001))*(MAT-(t+0.000001))/(2*CV*CV*MAT*(t+0.000001))
input = 1*P2*exp(-P3) # dose amount assumed 1
 
see attached on how you can also output cumulative fraction absorbed

 

Attached Files


  • BP1968 likes this

#3 BP1968

BP1968

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 08 February 2020 - 01:19 AM

 

you need to guide against input being zero at time zero.

 

option 1: only apply the input when time above zero otherwise it is zero.

input =  t ==0 ? 0 : ((MAT/(6.283*CV^2*t^3))^0.5) *exp(-((MAT-t)^2)/(2*CV^2*MAT*t))
 
option 2: put a small amount of time next to t:
P1 = (MAT/(2*3.14*CV*CV*(t+0.000001)**3))
P2 = P1**0.5
P3 = (MAT-(t+0.000001))*(MAT-(t+0.000001))/(2*CV*CV*MAT*(t+0.000001))
input = 1*P2*exp(-P3) # dose amount assumed 1
 
see attached on how you can also output cumulative fraction absorbed

 

Thank you for the suggestions. Setting the input to 0 at time 0 and adjusting the initial estimate for CV solved my problem.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users