Hello. I am trying to fit a parent-metabolite model with dual absorption (ka1 and ka2). In the database I have two administrations at time t=0 with the total dose at CMT=1 (ev) and CMT=2 (ev). I get the error that the gradient is 0 and therefore the parameter is not identified:
- First I get the error for tvlag. Then I set FIXED the tvlag parameter.
- I get the error for tvbio. Then I set FIXED the tvio parameter.
- I get the error for ETA(5). etc.
And so on but the model does not achieve the fit.
I will be very grateful for any possible help.
This is the code:
mymodel = @model begin
@metadata begin
desc = “Two parallel first-order absorptions - Two Compartment Model with Metabolite Compartment”
timeu = u"hr"
end
@param begin
"Volume of Central Compartment (L)"
tvvc ∈ RealDomain(lower=0)
"Clearance of parent drug (L/hr)"
tvclp ∈ RealDomain(lower=0)
"Inter Compartmental Clearance (L/hr)"
tvq ∈ RealDomain(lower=0)
"Volume of Peripheral Compartment (L)"
tvvp ∈ RealDomain(lower=0)
"Volume of Compartment of Metabolite (L)"
tvvm ∈ RealDomain(lower=0)
"Clearance of metabolite (L/hr)"
tvclm_M ∈ RealDomain(lower=0)
tvclm_F ∈ RealDomain(lower=0)
"Lag time (hr)"
tvlag ∈ RealDomain(lower=0)
"Absorption rate constant 1 (hr⁻¹)"
tvka1 ∈ RealDomain(lower=0)
"Absorption rate constant 2 (hr⁻¹)"
tvka2 ∈ RealDomain(lower=0)
"fraction metabolized"
tvfmet ∈ RealDomain(lower=0)
"Fraction"
tvbio ∈ RealDomain(lower=0)
# variance
Ω ∈ PDiagDomain(5)
"Proportional RUV - Plasma"
σ²_prop_cp ∈ RealDomain(lower=0.001)
"Proportional RUV - Metabolite"
σ²_prop_met ∈ RealDomain(lower=0.001)
end
@random begin
η ~ MvNormal(Ω)
end
@covariates begin
sex
end
@pre begin
tvclm = ifelse(sex == "M", tvclm_M, tvclm_F)
Vc = tvvc * exp(η[1])
Clp = tvclp * exp(η[2])
Q = tvq
Vp = tvvp
Vm = tvvm
Clm = tvclm * exp(η[3])
Ka1 = tvka1 * exp(η[4])
Ka2 = tvka2
lags = (SR = tvlag,)
bioav = (IR = tvbio*exp(η[5]), SR = 1-tvbio*exp(η[5]))
fmet = tvfmet
end
@dynamics begin
IR' = -Ka1*IR
SR' = -Ka2*SR
Central' = Ka1*IR + Ka2*SR - (1-fmet)*(Clp/Vc)*Central -(fmet)*(Clm/Vc)*Central - (Q/Vc)*Central + (Q/Vp)*Peripheral
Peripheral' = (Q/Vc)*Central - (Q/Vp)*Peripheral
Metabolite' = (fmet)*(Clp/Vc)*Central - (Clm/Vm)*Metabolite
end
@derived begin
cp = @. Central/Vc
dv_cp ~ @. Normal(cp, sqrt(cp^2*σ²_prop_cp))
met = @. Metabolite/Vm
dv_met ~ @. Normal(met, sqrt(met^2*σ²_prop_met))
end
end
iparams = (
tvka1 = 1,
tvka2 = 10,
tvclp = 40,
tvvc = 50,
tvq = 20,
tvvp = 120,
tvbio= 0.1,
tvlag = 0.14,
tvfmet = 0.7,
tvclm_M = 100,
tvclm_F = 100,
tvvm = 5,
Ω = Diagonal([0.1, 0.1, 0.1,0.1,0.0001]),
σ²_prop_cp = 0.1,
σ²_prop_met = 0.1
)