Generally the mistakes were as follows:
Warning: dt <= dtmin. Aborting. There is either an error in your model specification or the true solution is unstable.
└ @ DiffEqBase C:\Users\julia.julia\packages\DiffEqBase\3iigH\src\integrator_interface.jl:343
┌ Warning: dt <= dtmin. Aborting. There is either an error in your model specification or the true solution is unstable.
└ @ DiffEqBase C:\Users\julia.julia\packages\DiffEqBase\3iigH\src\integrator_interface.jl:343
I have copyed the file to the laptop so it should exactly the same. In another Intel platform I successfully get the model and performed SIR. The codes are there:
using CSV, Pumas, Plots, Random, JLD2
dataset = DataFrame!(CSV.File(
“./P1PK_20200907.csv”,
missingstrings = ["", “.”, “NA”, “BQL”],
))
popdata = read_pumas(
dataset,
observations = [:dv],
covariates = [:bw, :age, :sexx, :racex, :alb],
event_data = true,
)
mymodel = @model begin
@param begin
tv_cl ∈ RealDomain(lower = 0.001, upper = 200, init = 40)
tv_vc ∈ RealDomain(lower = 0.001, upper = 10000, init = 5000)
tv_vp ∈ RealDomain(lower = 0.001, upper = 5000, init = 3000)
tv_cld ∈ RealDomain(lower = 0.001, upper = 100, init = 30)
tv_vmax ∈ RealDomain(lower = 0.001, upper = 1000000, init = 200000)
tv_km ∈ RealDomain(lower = 0.001, upper = 1000, init = 400)
tv_bw_cl ∈ RealDomain(lower = 0.001, upper = 3, init = 1.5)
tv_bw_vc ∈ RealDomain(lower = 0.001, upper = 3, init = 1)
omega ∈ PDiagDomain(init = [0.1, 0.1, 0.1, 0.1])
epsprop ∈ RealDomain(lower = 0.0001, init = 0.1)
end
@random begin
eta ~ MvNormal(omega)
end
@covariates bw
@pre begin
bw_cl = tv_bw_cl
bw_vc = tv_bw_vc
cl = tv_cl * (bw / 65)^tv_bw_cl * exp(eta[1])
vc = tv_vc * (bw / 65)^tv_bw_vc * exp(eta[2])
vp = tv_vp * exp(eta[3])
cld = tv_cld * exp(eta[4])
vmax = tv_vmax
km = tv_km
end
@init begin
central = 0
peripheral = 0
end
@vars begin
conc = central / vc
k12 = cld / vc
k21 = cld / vp
ke = cl / vc
end
@dynamics begin
central’ =
-ke * central - k12 * central + k21 * peripheral -
vmax * conc / (km + conc)
peripheral’ = k12 * central - k21 * peripheral
end
@derived begin
dv ~ @. Normal(conc, sqrt(conc * epsprop)^2)
end
end
param = init_param(mymodel)
result = fit(mymodel, popdata, param, Pumas.MAP(Pumas.FOCEI()))
Additionally, when I tried to load the saved results from previouly running, it told me:
┌ Warning: some parameters could not be resolved for type ODEFunction{false,Main.#13#36,LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}; reconstructing
└ @ JLD2 C:\Users\gyang.julia\packages\JLD2\eU405\src\data.jl:1238
┌ Warning: some parameters could not be resolved for type Pumas.FittedPumasModel{PumasModel{ParamSet{NamedTuple{(:tv_cl, :tv_vc, :tv_vp, :tv_cld, :tv_vmax, :tv_km, :tv_bw_cl, :tv_bw_vc, :omega, :epsprop),Tuple{RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Int64},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Float64,TransformVariables.Infinity{true},Float64}}}},Main.#9#32,Main.#10#33,Main.#12#35,ODEProblem{Nothing,Tuple{Nothing,Nothing},false,Nothing,JLD2.ReconstructedTypes.var"##ODEFunction{false,Main.#13#36,LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}#289",Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}},DiffEqBase.StandardODEProblem},Main.#14#37,Main.#23#46},Array{Subject{NamedTuple{(:dv,),Tuple{Array{Union{Missing, Float64},1}}},T2,Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Nothing,Int64},1},Array{Float64,1}} where T2,1},Optim.MultivariateOptimizationResults{Optim.BFGS{LineSearches.InitialStatic{Float64},LineSearches.BackTracking{Float64,Int64},Pumas.var"#339#340"{NLSolversBase.OnceDifferentiable{Float64,Array{Float64,1},Array{Float64,1}},Array{Float64,1}},Nothing,Optim.Flat},Float64,Array{Float64,1},Float64,Float64,Array{Optim.OptimizationState{Float64,Optim.BFGS{LineSearches.InitialStatic{Float64},LineSearches.BackTracking{Float64,Int64},Pumas.var"#339#340"{NLSolversBase.OnceDifferentiable{Float64,Array{Float64,1},Array{Float64,1}},Array{Float64,1}},Nothing,Optim.Flat}},1},Bool},Pumas.MAP{Pumas.FOCEI},Array{Array{Float64,1},1},NamedTuple{(:optimize_fn, :constantcoef, :omegas, :ensemblealg),Tuple{Pumas.DefaultOptimizeFN{Nothing,NamedTuple{(:show_trace, :store_trace, :extended_trace, :g_tol, :allow_f_increases),Tuple{Bool,Bool,Bool,Float64,Bool}}},NamedTuple{,Tuple{}},Tuple{},EnsembleSerial}},ParamSet{NamedTuple{(:tv_cl, :tv_vc, :tv_vp, :tv_cld, :tv_vmax, :tv_km, :tv_bw_cl, :tv_bw_vc,
:omega, :epsprop),Tuple{RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Int64},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Float64,TransformVariables.Infinity{true},Float64}}}}}; reading as Pumas.FittedPumasModel{PumasModel,Array{Subject{NamedTuple{(:dv,),Tuple{Array{Union{Missing, Float64},1}}},T2,Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Nothing,Int64},1},Array{Float64,1}} where T2,1},Optim.MultivariateOptimizationResults{Optim.BFGS{LineSearches.InitialStatic{Float64},LineSearches.BackTracking{Float64,Int64},Pumas.var"#339#340"{NLSolversBase.OnceDifferentiable{Float64,Array{Float64,1},Array{Float64,1}},Array{Float64,1}},Nothing,Optim.Flat},Float64,Array{Float64,1},Float64,Float64,Array{Optim.OptimizationState{Float64,Optim.BFGS{LineSearches.InitialStatic{Float64},LineSearches.BackTracking{Float64,Int64},Pumas.var"#339#340"{NLSolversBase.OnceDifferentiable{Float64,Array{Float64,1},Array{Float64,1}},Array{Float64,1}},Nothing,Optim.Flat}},1},Bool},Pumas.MAP{Pumas.FOCEI},Array{Array{Float64,1},1},NamedTuple{(:optimize_fn, :constantcoef, :omegas, :ensemblealg),Tuple{Pumas.DefaultOptimizeFN{Nothing,NamedTuple{(:show_trace, :store_trace, :extended_trace, :g_tol, :allow_f_increases),Tuple{Bool,Bool,Bool,Float64,Bool}}},NamedTuple{,Tuple{}},Tuple{},EnsembleSerial}},ParamSet{NamedTuple{(:tv_cl, :tv_vc, :tv_vp, :tv_cld, :tv_vmax, :tv_km, :tv_bw_cl, :tv_bw_vc, :omega, :epsprop),Tuple{RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Int64},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Float64,TransformVariables.Infinity{true},Float64}}}}}
└ @ JLD2 C:\Users\gyang.julia\packages\JLD2\eU405\src\data.jl:1234
┌ Warning: some parameters could not be resolved for type PumasModel{ParamSet{NamedTuple{(:tv_cl, :tv_vc, :tv_vp, :tv_cld, :tv_vmax, :tv_km, :tv_bw_cl, :tv_bw_vc, :omega, :epsprop),Tuple{RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Int64},RealDomain{Float64,Int64,Float64},RealDomain{Float64,Int64,Int64},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Float64,TransformVariables.Infinity{true},Float64}}}},Main.#9#32,Main.#10#33,Main.#12#35,ODEProblem{Nothing,Tuple{Nothing,Nothing},false,Nothing,JLD2.ReconstructedTypes.var"##ODEFunction{false,Main.#13#36,LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}#289",Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}},DiffEqBase.StandardODEProblem},Main.#14#37,Main.#23#46}; reconstructing
└ @ JLD2 C:\Users\gyang.julia\packages\JLD2\eU405\src\data.jl:1238
The load process is okey in the computer that I ran the model.