Hi Pumas
team,
I have an issue that the estimated param
is equal to the initial value
. But when I tested to fit with FOCEi
in nlmixr package in R, it work.
Thank you for help! Tien Nguyen.
Here is my code:
CV_to_omega = function (CV)
return(log((CV/100)^2 + 1))
end
model= @model begin
@param begin
tvcl ∈ RealDomain(lower = 0, init = 4.6)
tvv ∈ RealDomain(lower = 0, init = 58.4)
tvvp ∈ RealDomain(lower = 0, init = 38.4)
tvq ∈ RealDomain(lower = 0, init = 6.5)
beta_Cl ∈ RealDomain(lower = 0, init = 0.8)
#
Ω ∈ PDiagDomain(init = [CV_to_omega(39.8), CV_to_omega(81.6), CV_to_omega(57.1)])
σ_add ∈ RealDomain(lower = 0.0001, init = 3.4)
σ_prop ∈ RealDomain(lower = 0.0001, init = 22.7/100)
end
@random begin
η ~ MvNormal(Ω)
end
@pre begin
CL = tvcl*(CLCR/120)^beta_Cl*exp(η[1])
Vc = tvv*(WT/70)*exp(η[2])
Vp = tvvp*(WT/70)*exp(η[3])
Q = tvq
end
@covariates WT CLCR
@dynamics Central1Periph1
@derived begin
# The conditional mean
μ := @. Central / Vc
# Additive error model
DV ~ @. Normal(μ, sqrt(σ_add^2 + (μ*σ_prop)^2))
end
end
# Read data
mydata= CSV.read("mydata.csv", DataFrame)
insertcols!(vanco_train, :route => "inf")
data = read_pumas(
mydata;
id = :ID_NEW, time = :time_hour, amt = :AMT, rate = :RATE, observations = [:DV], evid = :EVID,
cmt = :CMT, route = :route, covariates = [:WT, :CLCR]
)
FOCEI_model = fit(model, data, init_params(model), Pumas.FOCE())
julia>
Iter Function value Gradient norm
0 Inf 3.520410e+02
* time: 0.024431943893432617
FittedPumasModel
Successful minimization: true
Likelihood approximation: Pumas.FOCE
Log-likelihood value: -Inf
Number of subjects: 285
Number of parameters: Fixed Optimized
0 10
Observation records: Active Missing
DV: 285 0
Total: 285 0
---------------------
Estimate
---------------------
tvcl 4.6
tvv 58.4
tvvp 38.4
tvq 6.5
beta_Cl 0.8
Ω₁,₁ 0.14704
Ω₂,₂ 0.51034
Ω₃,₃ 0.2822
σ_add 3.4
σ_prop 0.227
---------------------
inspect()
function: FOCE_inspect = inspect(FOCEI_model )
<output>:
[ Info: Calculating predictions.
ERROR: MethodError: no method matching _unwrap(::Nothing)
Closest candidates are:
_unwrap(::Pumas.LikelihoodApproximation) at /builds/PumasAI/PumasSystemImages-jl/.julia/packages/Pumas/XHa5R/src/estimation/likelihoods.jl:22
_unwrap(::Pumas.MAP) at /builds/PumasAI/PumasSystemImages-jl/.julia/packages/Pumas/XHa5R/src/estimation/likelihoods.jl:23
_unwrap(::Pumas.SAEM) at /builds/PumasAI/PumasSystemImages-jl/.julia/packages/Pumas/XHa5R/src/estimation/likelihoods.jl:59
...
Stacktrace:
Some first rows of mydata
. Briefly, it has 1 conc points
per patient.
And the estimated results when I fitted in nlmixr package in R.