Hello. I have been working on another model, with double absorption (KA1 and KA2) and two compartments. However, I get an error that has caused me problems before. The classic error of gradient = 0 and that a certain parameter is not identified.
OUTPUT: [ Info: Checking the initial parameter values.
[ Info: The initial negative log likelihood and its gradient are finite. Check passed.
Iter Function value Gradient norm
0 1.568802e+03 3.380961e+03
time: 0.0010001659393310547
ERROR: gradient is exactly zero in tvlag. This indicates that tvlag isn’t identified.
MY MODEL:
mymodel = @model begin
@param begin
tvcl ∈ RealDomain(lower=0)
tvv ∈ RealDomain(lower=0)
tvka1 ∈ RealDomain(lower=0.001)
tvka2 ∈ RealDomain(lower=0)
tvq ∈ RealDomain(lower=0)
tvvp ∈ RealDomain(lower=0)
tvlag ∈ RealDomain(lower=0)
tvbio ∈ RealDomain(lower=0)
Ω ∈ PDiagDomain(5)
σ ∈ RealDomain(lower = 0.0001)
end
@random begin
η ~ MvNormal(Ω)
end
@pre begin
CL = tvcl*exp(η[1])
Vc = tvv*exp(η[2])
Ka1 = tvka1*exp(η[3])
Ka2 = tvka2*exp(η[4])
lags = (SR = tvlag,)
bioav = (IR = tvbio*exp(η[5]), SR = 1-tvbio*exp(η[5]))
Q = tvq
Vp = tvvp
end
@dynamics begin
IR' = -Ka1*IR
SR' = -Ka2*SR
Central' = Ka1*IR + Ka2*SR - Central*CL/Vc - (Q/Vc)*Central + (Q/Vp)*Peripheral
Peripheral' = (Q/Vc)*Central - (Q/Vp)*Peripheral
end
@derived begin
conc := @. Central/Vc
dv ~ @. Normal(conc, σ*abs(conc))
end