Hello,
I am trying to simulate with vcov. However, I’m getting an error. Could I get some help with this?
julia> test_sims = simobs(model_fit, vcov(model_fit), samples=2)
Progress: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| Time: 0:00:00
ERROR: MethodError: no method matching PDMats.PDMat(::Pumas.CovarianceEstimate{Float64, Matrix{Float64}})
Closest candidates are:
PDMats.PDMat(::AbstractMatrix{T} where T, ::LinearAlgebra.Cholesky{T, S}) where {T, S} at /builds/PumasAI/PumasSystemImages-jl/.julia/packages/PDMats/vgpB7/src/pdmat.jl:12
PDMats.PDMat(::LinearAlgebra.Cholesky) at /builds/PumasAI/PumasSystemImages-jl/.julia/packages/PDMats/vgpB7/src/pdmat.jl:21
PDMats.PDMat(::Symmetric) at /builds/PumasAI/PumasSystemImages-jl/.julia/packages/PDMats/vgpB7/src/pdmat.jl:20
...
Stacktrace:
[1] MvNormal(μ::Vector{Float64}, Σ::Pumas.CovarianceEstimate{Float64, Matrix{Float64}})
@ Distributions /builds/PumasAI/PumasSystemImages-jl/.julia/packages/Distributions/Xrm9e/src/multivariate/mvnormal.jl:211
[2] simobs(fpm::Pumas.FittedPumasModel{PumasModel{ParamSet{NamedTuple{(:tvtr_ratio, :tvCL, :tvVc, :tvDuration, :ωtr_ratio, :ωCL, :ωVc, :σ_add, :σ_prop), NTuple{9, RealDomain{Float64, TransformVariables.Infinity{true}, Float64}}}}, var"#39#55", var"#40#56", var"#42#58", var"#44#60", Pumas.LinearODE, var"#45#61", var"#50#66", ModelingToolkit.ODESystem}, Vector{Subject{NamedTuple{(:dv,), Tuple{Vector{Union{Missing, Float64}}}}, Pumas.ConstantCovar{NamedTuple{(:rep, :params_num, :NSubj, :occ, :period, :sequence, :seq_n, :formulation, :isT, :input_tr_ratio), Tuple{Int64, Int64, Int64, Int64, Int64, String, Int64, String, Int64, Float64}}}, Vector{Pumas.Event{Float64, Float64, Float64, Float64, Float64, Float64, Int64}}, Vector{Float64}}}, Optim.MultivariateOptimizationResults{Optim.BFGS{LineSearches.InitialStatic{Float64}, LineSearches.BackTracking{Float64, Int64}, Nothing, Float64, Optim.Flat}, Float64, Vector{Float64}, Float64, Float64, Vector{Optim.OptimizationState{Float64, Optim.BFGS{LineSearches.InitialStatic{Float64}, LineSearches.BackTracking{Float64, Int64}, Nothing, Float64, Optim.Flat}}}, Bool, NamedTuple{(:f_limit_reached, :g_limit_reached, :h_limit_reached, :time_limit, :callback, :f_increased), NTuple{6, Bool}}}, Pumas.FOCE, Vector{Vector{Float64}}, NamedTuple{(:optimize_fn, :constantcoef, :omegas, :ensemblealg, :diffeq_options), 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{}, EnsembleThreads, NamedTuple{(), Tuple{}}}}, ParamSet{NamedTuple{(:tvtr_ratio, :tvCL, :tvVc, :tvDuration, :ωtr_ratio, :ωCL, :ωVc, :σ_add, :σ_prop), NTuple{9, RealDomain{Float64, TransformVariables.Infinity{true}, Float64}}}}}, population::Vector{Subject{NamedTuple{(:dv,), Tuple{Vector{Union{Missing, Float64}}}}, Pumas.ConstantCovar{NamedTuple{(:rep, :params_num, :NSubj, :occ, :period, :sequence, :seq_n, :formulation, :isT, :input_tr_ratio), Tuple{Int64, Int64, Int64, Int64, Int64, String, Int64, String, Int64, Float64}}}, Vector{Pumas.Event{Float64, Float64, Float64, Float64, Float64, Float64, Int64}}, Vector{Float64}}}, vcov::Pumas.CovarianceEstimate{Float64, Matrix{Float64}}, randeffs::Nothing; samples::Int64, rng::MersenneTwister)
@ Pumas /builds/PumasAI/PumasSystemImages-jl/.julia/packages/Pumas/HDuXQ/src/estimation/inference.jl:630
[3] simobs(fpm::Pumas.FittedPumasModel{PumasModel{ParamSet{NamedTuple{(:tvtr_ratio, :tvCL, :tvVc, :tvDuration, :ωtr_ratio, :ωCL, :ωVc, :σ_add, :σ_prop), NTuple{9, RealDomain{Float64, TransformVariables.Infinity{true}, Float64}}}}, var"#39#55", var"#40#56", var"#42#58", var"#44#60", Pumas.LinearODE, var"#45#61", var"#50#66", ModelingToolkit.ODESystem}, Vector{Subject{NamedTuple{(:dv,), Tuple{Vector{Union{Missing, Float64}}}}, Pumas.ConstantCovar{NamedTuple{(:rep, :params_num, :NSubj, :occ, :period, :sequence, :seq_n, :formulation, :isT, :input_tr_ratio), Tuple{Int64, Int64, Int64, Int64, Int64, String, Int64, String, Int64, Float64}}}, Vector{Pumas.Event{Float64, Float64, Float64, Float64, Float64, Float64, Int64}}, Vector{Float64}}}, Optim.MultivariateOptimizationResults{Optim.BFGS{LineSearches.InitialStatic{Float64}, LineSearches.BackTracking{Float64, Int64}, Nothing, Float64, Optim.Flat}, Float64, Vector{Float64}, Float64, Float64, Vector{Optim.OptimizationState{Float64, Optim.BFGS{LineSearches.InitialStatic{Float64}, LineSearches.BackTracking{Float64, Int64}, Nothing, Float64, Optim.Flat}}}, Bool, NamedTuple{(:f_limit_reached, :g_limit_reached, :h_limit_reached, :time_limit, :callback, :f_increased), NTuple{6, Bool}}}, Pumas.FOCE, Vector{Vector{Float64}}, NamedTuple{(:optimize_fn, :constantcoef, :omegas, :ensemblealg, :diffeq_options), 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{}, EnsembleThreads, NamedTuple{(), Tuple{}}}}, ParamSet{NamedTuple{(:tvtr_ratio, :tvCL, :tvVc, :tvDuration, :ωtr_ratio, :ωCL, :ωVc, :σ_add, :σ_prop), NTuple{9, RealDomain{Float64, TransformVariables.Infinity{true}, Float64}}}}}, vcov::Pumas.CovarianceEstimate{Float64, Matrix{Float64}}, randeffs::Nothing; samples::Int64, rng::MersenneTwister)
@ Pumas /builds/PumasAI/PumasSystemImages-jl/.julia/packages/Pumas/HDuXQ/src/estimation/inference.jl:616
[4] top-level scope
@ REPL[75]:1