i have updated the Pumas to latest version.
still i got an error while running code infer()
md = CSV.read("D:\\NONMEMnights\\mould\\julia\\12.3.2\\2comp_iv_data.csv", missingstring=".")
trans = read_pumas(md, id=:id, time=:TIME, dvs=[:dv],)
dian = @model begin
@param begin
tvcl ∈ RealDomain(lower=0, init = 1.0)
tvv ∈ RealDomain(lower=0, init = 20)
tvQ ∈ RealDomain(lower = 0, init= 1)
tvv2 ∈ RealDomain(lower = 0, init = 100)
#Ω ∈ PDiagDomain(init=[0.09])
σ_prop ∈ RealDomain(lower=0,init=0.04)
end
#end
@random begin
η ~ MvNormal(Matrix{Float64}(0.01I, 1, 1))
# η ~ MvNormal(Ω)
#η ~ MvNormal(Ω)
end
#end
@pre begin
CL = tvcl * exp(η[1])
V = tvv
V2 = tvv2
Q = tvQ
end
#end
#@covariates WT
#end
#@dynamics ImmediateAbsorptionModel
@dynamics begin
# Depot' = -Ka*Depot
Central' = Q*(Peripheral/V2) - (CL/V)*Central - Q*(Central/V)
Peripheral' = Q*((Central/V)-(Peripheral/V2))
end
#end
@vars begin
Cent := Central/V
Peri := Peripheral/V2
end
@derived begin
cp = Cent
# dv ~ @. Normal(cp,sqrt(cp^2*σ_prop))
dv ~ @. Normal(cp, sqrt(cp^2*σ_prop)+eps())
end
end
param =init_param(dian)
sims = simobs(dian,trans,param)
plot(sims)
res1 = fit(dian,trans,param,Pumas.FOCEI())
infer(res1)
and the error is
infer(res1)
Calculating: variance-covariance matrixERROR: PosDefException: matrix is not positive definite; Cholesky factorization failed.
Stacktrace:
[1] chkposdef at C:\Users\julia\AppData\Local\Julia-1.2.0\share\julia\stdlib\v1.2\LinearAlgebra\src\lapack.jl:50 [inlined]
[2] sygvd!(::Int64, ::Char, ::Char, ::Array{Float64,2}, ::Array{Float64,2}) at C:\Users\julia\AppData\Local\Julia-1.2.0\share\julia\stdlib\v1.2\LinearAlgebra\src\lapack.jl:5075
[3] #eigen!#85 at C:\Users\julia\AppData\Local\Julia-1.2.0\share\julia\stdlib\v1.2\LinearAlgebra\src\symmetric.jl:677 [inlined]
[4] eigen! at C:\Users\julia\AppData\Local\Julia-1.2.0\share\julia\stdlib\v1.2\LinearAlgebra\src\symmetric.jl:677 [inlined]
[5] #eigen#68(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}, ::typeof(eigen), ::Symmetric{Float64,Array{Float64,2}}, ::Symmetric{Float64,Array{Float64,2}}) at C:\Users\julia\AppData\Local\Julia-1.2.0\share\julia\stdlib\v1.2\LinearAlgebra\src\eigen.jl:403
[6] eigen(::Symmetric{Float64,Array{Float64,2}}, ::Symmetric{Float64,Array{Float64,2}}) at C:\Users\julia\AppData\Local\Julia-1.2.0\share\julia\stdlib\v1.2\LinearAlgebra\src\eigen.jl:402
[7] #vcov#234(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}, ::typeof(vcov), ::Pumas.FittedPumasModel{PumasModel{ParamSet{NamedTuple{(:tvcl, :tvv, :tvQ, :tvv2,
:σ_prop),Tuple{RealDomain{Int64,TransformVariables.Infinity{true},Float64},RealDomain{Int64,TransformVariables.Infinity{true},Int64},RealDomain{Int64,TransformVariables.Infinity{true},Int64},RealDomain{Int64,TransformVariables.Infinity{true},Int64},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}},getfield(Main, Symbol("##9#16")),getfield(Main, Symbol("##10#17")),getfield(Main, Symbol("##11#18")),ODEProblem{Nothing,Tuple{Nothing,Nothing},false,Nothing,ODEFunction{false,getfield(Main, Symbol("##12#19")),UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}},DiffEqBase.StandardODEProblem},getfield(Main, Symbol("##14#21")),getfield(Main, Symbol("##15#22"))},Array{Subject{NamedTuple{(:dv,),Tuple{Array{Union{Missing, Float64},1}}},Nothing,Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Int64},1},Array{Float64,1}},1},Optim.MultivariateOptimizationResults{Optim.BFGS{LineSearches.InitialStatic{Float64},LineSearches.BackTracking{Float64,Int64},getfield(Pumas, Symbol("##200#201")){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},getfield(Pumas, Symbol("##200#201")){NLSolversBase.OnceDifferentiable{Float64,Array{Float64,1},Array{Float64,1}},Array{Float64,1}},Nothing,Optim.Flat}},1},Bool},Pumas.FOCEI,Array{Array{Float64,1},1},Tuple{},Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}},TransformVariables.TransformTuple{NamedTuple{(:tvcl, :tvv, :tvQ, :tvv2, :σ_prop),NTuple{5,TransformVariables.ShiftedExp{true,Int64}}}}}) at C:\Users\Lenovo\.juliapro\JuliaPro_v1.2.0-1\packages\Pumas\6uorK\src\estimation\likelihoods.jl:1321
[8] vcov at C:\Users\Lenovo\.juliapro\JuliaPro_v1.2.0-1\packages\Pumas\6uorK\src\estimation\likelihoods.jl:1318 [inlined]
[9] #infer#249(::Float64, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}, ::typeof(infer), ::Pumas.FittedPumasModel{PumasModel{ParamSet{NamedTuple{(:tvcl, :tvv,
:tvQ, :tvv2, :σ_prop),Tuple{RealDomain{Int64,TransformVariables.Infinity{true},Float64},RealDomain{Int64,TransformVariables.Infinity{true},Int64},RealDomain{Int64,TransformVariables.Infinity{true},Int64},RealDomain{Int64,TransformVariables.Infinity{true},Int64},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}},getfield(Main, Symbol("##9#16")),getfield(Main, Symbol("##10#17")),getfield(Main, Symbol("##11#18")),ODEProblem{Nothing,Tuple{Nothing,Nothing},false,Nothing,ODEFunction{false,getfield(Main, Symbol("##12#19")),UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}},DiffEqBase.StandardODEProblem},getfield(Main, Symbol("##14#21")),getfield(Main, Symbol("##15#22"))},Array{Subject{NamedTuple{(:dv,),Tuple{Array{Union{Missing, Float64},1}}},Nothing,Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Int64},1},Array{Float64,1}},1},Optim.MultivariateOptimizationResults{Optim.BFGS{LineSearches.InitialStatic{Float64},LineSearches.BackTracking{Float64,Int64},getfield(Pumas, Symbol("##200#201")){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},getfield(Pumas, Symbol("##200#201")){NLSolversBase.OnceDifferentiable{Float64,Array{Float64,1},Array{Float64,1}},Array{Float64,1}},Nothing,Optim.Flat}},1},Bool},Pumas.FOCEI,Array{Array{Float64,1},1},Tuple{},Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}},TransformVariables.TransformTuple{NamedTuple{(:tvcl, :tvv, :tvQ, :tvv2, :σ_prop),NTuple{5,TransformVariables.ShiftedExp{true,Int64}}}}}) at C:\Users\Lenovo\.juliapro\JuliaPro_v1.2.0-1\packages\Pumas\6uorK\src\estimation\likelihoods.jl:1422
[10] infer(::Pumas.FittedPumasModel{PumasModel{ParamSet{NamedTuple{(:tvcl, :tvv, :tvQ, :tvv2, :σ_prop),Tuple{RealDomain{Int64,TransformVariables.Infinity{true},Float64},RealDomain{Int64,TransformVariables.Infinity{true},Int64},RealDomain{Int64,TransformVariables.Infinity{true},Int64},RealDomain{Int64,TransformVariables.Infinity{true},Int64},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}},getfield(Main, Symbol("##9#16")),getfield(Main, Symbol("##10#17")),getfield(Main, Symbol("##11#18")),ODEProblem{Nothing,Tuple{Nothing,Nothing},false,Nothing,ODEFunction{false,getfield(Main, Symbol("##12#19")),UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}},DiffEqBase.StandardODEProblem},getfield(Main, Symbol("##14#21")),getfield(Main, Symbol("##15#22"))},Array{Subject{NamedTuple{(:dv,),Tuple{Array{Union{Missing, Float64},1}}},Nothing,Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Int64},1},Array{Float64,1}},1},Optim.MultivariateOptimizationResults{Optim.BFGS{LineSearches.InitialStatic{Float64},LineSearches.BackTracking{Float64,Int64},getfield(Pumas, Symbol("##200#201")){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},getfield(Pumas, Symbol("##200#201")){NLSolversBase.OnceDifferentiable{Float64,Array{Float64,1},Array{Float64,1}},Array{Float64,1}},Nothing,Optim.Flat}},1},Bool},Pumas.FOCEI,Array{Array{Float64,1},1},Tuple{},Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}},TransformVariables.TransformTuple{NamedTuple{(:tvcl, :tvv, :tvQ, :tvv2, :σ_prop),NTuple{5,TransformVariables.ShiftedExp{true,Int64}}}}}) at C:\Users\Lenovo\.juliapro\JuliaPro_v1.2.0-1\packages\Pumas\6uorK\src\estimation\likelihoods.jl:1421
[11] top-level scope at none:0