UndefRefError with Estimation

Hello,

I’m running a dual absorption (fast zero-order and transmit compartment) model fit, and I’m getting the following error:

ERROR: UndefRefError: access to undefined reference
Stacktrace:
  [1] getindex
    @ ./array.jl:861 [inlined]
  [2] iterate
    @ ./array.jl:835 [inlined]
  [3] foreach(f::Base.Fix2{typeof(fill!), Float64}, itr::Vector{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}})
    @ Base ./abstractarray.jl:2712
  [4] _labelled_fill_inf!
    @ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/models/model_api.jl:1812 [inlined]
  [5] _adjust_failed_solution_doses!(sol::Pumas.PKPDAnalyticalSolution{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}, 2, Vector{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}, Vector{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}}, Vector{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}}, Pumas.Returns{NamedTuple{(:CL, :Q, :Vp, :Vc, :ktr, Symbol("##A##"), Symbol("##b##")), Tuple{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, Matrix{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}, FillArrays.Zeros{Float64, 1, Tuple{Base.OneTo{Int64}}}}}}, Pumas.AnalyticalPKPDProblem{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}, Float64, false, Pumas.LinearODE, Vector{Pumas.Event{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, Float64, Float64, Int64}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}, Pumas.Returns{NamedTuple{(:CL, :Q, :Vp, :Vc, :ktr, Symbol("##A##"), Symbol("##b##")), Tuple{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, Matrix{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}, FillArrays.Zeros{Float64, 1, Tuple{Base.OneTo{Int64}}}}}}}})
    @ Pumas /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/models/model_api.jl:1845
  [6] _adjust_failed_solution!(subject::Subject{NamedTuple{(:DV,), Tuple{Vector{Union{Missing, Float64}}}}, Pumas.ConstantCovar{NamedTuple{(:STUDY,), Tuple{Int64}}}, Vector{Pumas.Event{Float64, Float64, Float64, Float64, Float64, Float64, Int64}}, Vector{Float64}}, sol::Pumas.PKPDAnalyticalSolution{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}, 2, Vector{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}, Vector{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}}, Vector{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}}, Pumas.Returns{NamedTuple{(:CL, :Q, :Vp, :Vc, :ktr, Symbol("##A##"), Symbol("##b##")), Tuple{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, Matrix{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}, FillArrays.Zeros{Float64, 1, Tuple{Base.OneTo{Int64}}}}}}, Pumas.AnalyticalPKPDProblem{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}, Float64, false, Pumas.LinearODE, Vector{Pumas.Event{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, Float64, Float64, Int64}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}, Pumas.Returns{NamedTuple{(:CL, :Q, :Vp, :Vc, :ktr, Symbol("##A##"), Symbol("##b##")), Tuple{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}, Matrix{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}, FillArrays.Zeros{Float64, 1, Tuple{Base.OneTo{Int64}}}}}}}})
    @ Pumas /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/models/model_api.jl:1838
  [7] #_derived#317
    @ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/models/model_api.jl:1276 [inlined]
  [8] (::Pumas.var"#570#571"{PumasModel{(tvCL = 1, tvQ = 1, tvVp = 1, tvVc = 1, tvbio = 1, tvdur = 1, tvktr = 1, ωCL = 1, ωQ = 1, ωVp = 1, ωVc = 1, ωbio = 1, ωdur = 1, ωktr = 1, σ_prop = 1), 7, (:Depot, :Transit1, :Transit2, :Transit3, :Transit4, :Central, :Peripheral), ParamSet{NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, RealDomain{Float64, TransformVariables.Infinity{true}, Float64}}}}, var"#235#241", var"#236#242", var"#237#243", var"#238#244", Pumas.LinearODE, var"#239#245", var"#240#246", ModelingToolkit.ODESystem}, Subject{NamedTuple{(:DV,), Tuple{Vector{Union{Missing, Float64}}}}, Pumas.ConstantCovar{NamedTuple{(:STUDY,), Tuple{Int64}}}, Vector{Pumas.Event{Float64, Float64, Float64, Float64, Float64, Float64, Int64}}, Vector{Float64}}, NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, Float64}}, NamedTuple{(), Tuple{}}})(vηorth::Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}})
    @ Pumas /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/estimation/likelihoods.jl:2552
  [9] chunk_mode_jacobian(f::Pumas.var"#570#571"{PumasModel{(tvCL = 1, tvQ = 1, tvVp = 1, tvVc = 1, tvbio = 1, tvdur = 1, tvktr = 1, ωCL = 1, ωQ = 1, ωVp = 1, ωVc = 1, ωbio = 1, ωdur = 1, ωktr = 1, σ_prop = 1), 7, (:Depot, :Transit1, :Transit2, :Transit3, :Transit4, :Central, :Peripheral), ParamSet{NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, RealDomain{Float64, TransformVariables.Infinity{true}, Float64}}}}, var"#235#241", var"#236#242", var"#237#243", var"#238#244", Pumas.LinearODE, var"#239#245", var"#240#246", ModelingToolkit.ODESystem}, Subject{NamedTuple{(:DV,), Tuple{Vector{Union{Missing, Float64}}}}, Pumas.ConstantCovar{NamedTuple{(:STUDY,), Tuple{Int64}}}, Vector{Pumas.Event{Float64, Float64, Float64, Float64, Float64, Float64, Int64}}, Vector{Float64}}, NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, Float64}}, NamedTuple{(), Tuple{}}}, x::Vector{Float64}, cfg::ForwardDiff.JacobianConfig{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Pumas.Tag, Float64}, Float64, 7}}}, #unused#::Val{7})
    @ Pumas /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/estimation/likelihoods.jl:2485
 [10] _derived_vηorth_gradient
    @ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/estimation/likelihoods.jl:2556 [inlined]
 [11] _∂²l∂η²
    @ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/estimation/likelihoods.jl:2601 [inlined]
 [12] (::Pumas.var"#498#499"{PumasModel{(tvCL = 1, tvQ = 1, tvVp = 1, tvVc = 1, tvbio = 1, tvdur = 1, tvktr = 1, ωCL = 1, ωQ = 1, ωVp = 1, ωVc = 1, ωbio = 1, ωdur = 1, ωktr = 1, σ_prop = 1), 7, (:Depot, :Transit1, :Transit2, :Transit3, :Transit4, :Central, :Peripheral), ParamSet{NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, RealDomain{Float64, TransformVariables.Infinity{true}, Float64}}}}, var"#235#241", var"#236#242", var"#237#243", var"#238#244", Pumas.LinearODE, var"#239#245", var"#240#246", ModelingToolkit.ODESystem}, NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, Float64}}, FOCE, NamedTuple{(), Tuple{}}, TransformVariables.TransformTuple{NamedTuple{(:ηCL, :ηQ, :ηVp, :ηVc, :ηbio, :ηdur, :ηktr), NTuple{7, Pumas.NormalTransform{Normal{Float64}}}}}, ParamSet{NamedTuple{(:ηCL, :ηQ, :ηVp, :ηVc, :ηbio, :ηdur, :ηktr), NTuple{7, Normal{Float64}}}}, Subject{NamedTuple{(:DV,), Tuple{Vector{Union{Missing, Float64}}}}, Pumas.ConstantCovar{NamedTuple{(:STUDY,), Tuple{Int64}}}, Vector{Pumas.Event{Float64, Float64, Float64, Float64, Float64, Float64, Int64}}, Vector{Float64}}})(F::Float64, G::Vector{Float64}, H::Matrix{Float64}, x::Vector{Float64})
    @ Pumas /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/estimation/likelihoods.jl:979
 [13] (::NLSolversBase.var"#98#104"{NLSolversBase.InplaceObjective{Nothing, Nothing, Pumas.var"#498#499"{PumasModel{(tvCL = 1, tvQ = 1, tvVp = 1, tvVc = 1, tvbio = 1, tvdur = 1, tvktr = 1, ωCL = 1, ωQ = 1, ωVp = 1, ωVc = 1, ωbio = 1, ωdur = 1, ωktr = 1, σ_prop = 1), 7, (:Depot, :Transit1, :Transit2, :Transit3, :Transit4, :Central, :Peripheral), ParamSet{NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, RealDomain{Float64, TransformVariables.Infinity{true}, Float64}}}}, var"#235#241", var"#236#242", var"#237#243", var"#238#244", Pumas.LinearODE, var"#239#245", var"#240#246", ModelingToolkit.ODESystem}, NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, Float64}}, FOCE, NamedTuple{(), Tuple{}}, TransformVariables.TransformTuple{NamedTuple{(:ηCL, :ηQ, :ηVp, :ηVc, :ηbio, :ηdur, :ηktr), NTuple{7, Pumas.NormalTransform{Normal{Float64}}}}}, ParamSet{NamedTuple{(:ηCL, :ηQ, :ηVp, :ηVc, :ηbio, :ηdur, :ηktr), NTuple{7, Normal{Float64}}}}, Subject{NamedTuple{(:DV,), Tuple{Vector{Union{Missing, Float64}}}}, Pumas.ConstantCovar{NamedTuple{(:STUDY,), Tuple{Int64}}}, Vector{Pumas.Event{Float64, Float64, Float64, Float64, Float64, Float64, Int64}}, Vector{Float64}}}, Nothing, Nothing}, Float64})(G::Vector{Float64}, H::Matrix{Float64}, x::Vector{Float64})
    @ NLSolversBase /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/NLSolversBase/cfJrN/src/objective_types/incomplete.jl:115
 [14] value_gradient_hessian!!(obj::NLSolversBase.TwiceDifferentiable{Float64, Vector{Float64}, Matrix{Float64}, Vector{Float64}}, x::Vector{Float64})
    @ NLSolversBase /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/NLSolversBase/cfJrN/src/objective_types/incomplete.jl:138
 [15] initial_state(method::Optim.NewtonTrustRegion{Float64}, options::Optim.Options{Float64, Nothing}, d::NLSolversBase.TwiceDifferentiable{Float64, Vector{Float64}, Matrix{Float64}, Vector{Float64}}, initial_x::Vector{Float64})
    @ Optim /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Optim/Zq1jM/src/multivariate/solvers/second_order/newton_trust_region.jl:310
 [16] optimize
    @ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Optim/Zq1jM/src/multivariate/optimize/optimize.jl:36 [inlined]
 [17] _orth_empirical_bayes!(vrandeffsorth::Vector{Float64}, m::PumasModel{(tvCL = 1, tvQ = 1, tvVp = 1, tvVc = 1, tvbio = 1, tvdur = 1, tvktr = 1, ωCL = 1, ωQ = 1, ωVp = 1, ωVc = 1, ωbio = 1, ωdur = 1, ωktr = 1, σ_prop = 1), 7, (:Depot, :Transit1, :Transit2, :Transit3, :Transit4, :Central, :Peripheral), ParamSet{NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, RealDomain{Float64, TransformVariables.Infinity{true}, Float64}}}}, var"#235#241", var"#236#242", var"#237#243", var"#238#244", Pumas.LinearODE, var"#239#245", var"#240#246", ModelingToolkit.ODESystem}, _subject::Subject{NamedTuple{(:DV,), Tuple{Vector{Union{Missing, Float64}}}}, Pumas.ConstantCovar{NamedTuple{(:STUDY,), Tuple{Int64}}}, Vector{Pumas.Event{Float64, Float64, Float64, Float64, Float64, Float64, Int64}}, Vector{Float64}}, param::NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, Float64}}, approx::FOCE, diffeq_options::NamedTuple{(), Tuple{}})
    @ Pumas /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/estimation/likelihoods.jl:1007
 [18] _update_ebes_and_evaluate_marginal_nll!
    @ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/estimation/likelihoods.jl:3099 [inlined]
 [19] _update_ebes_and_evaluate_marginal_nll_threads!(m::PumasModel{(tvCL = 1, tvQ = 1, tvVp = 1, tvVc = 1, tvbio = 1, tvdur = 1, tvktr = 1, ωCL = 1, ωQ = 1, ωVp = 1, ωVc = 1, ωbio = 1, ωdur = 1, ωktr = 1, σ_prop = 1), 7, (:Depot, :Transit1, :Transit2, :Transit3, :Transit4, :Central, :Peripheral), ParamSet{NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, RealDomain{Float64, TransformVariables.Infinity{true}, Float64}}}}, var"#235#241", var"#236#242", var"#237#243", var"#238#244", Pumas.LinearODE, var"#239#245", var"#240#246", ModelingToolkit.ODESystem}, population::Vector{Subject{NamedTuple{(:DV,), Tuple{Vector{Union{Missing, Float64}}}}, Pumas.ConstantCovar{NamedTuple{(:STUDY,), Tuple{Int64}}}, Vector{Pumas.Event{Float64, Float64, Float64, Float64, Float64, Float64, Int64}}, Vector{Float64}}}, param::NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, Float64}}, vvrandeffs::Vector{Vector{Float64}}, vvrandeffs_tmp::Vector{Vector{Float64}}, approx::FOCE, diffeq_options::NamedTuple{(), Tuple{}})
    @ Pumas /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/estimation/likelihoods.jl:3148
 [20] #613
    @ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/estimation/likelihoods.jl:3967 [inlined]
 [21] (::Pumas.OptimSafeFunction{true, Pumas.var"#613#615"{PumasModel{(tvCL = 1, tvQ = 1, tvVp = 1, tvVc = 1, tvbio = 1, tvdur = 1, tvktr = 1, ωCL = 1, ωQ = 1, ωVp = 1, ωVc = 1, ωbio = 1, ωdur = 1, ωktr = 1, σ_prop = 1), 7, (:Depot, :Transit1, :Transit2, :Transit3, :Transit4, :Central, :Peripheral), ParamSet{NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, RealDomain{Float64, TransformVariables.Infinity{true}, Float64}}}}, var"#235#241", var"#236#242", var"#237#243", var"#238#244", Pumas.LinearODE, var"#239#245", var"#240#246", ModelingToolkit.ODESystem}, Vector{Subject{NamedTuple{(:DV,), Tuple{Vector{Union{Missing, Float64}}}}, Pumas.ConstantCovar{NamedTuple{(:STUDY,), Tuple{Int64}}}, Vector{Pumas.Event{Float64, Float64, Float64, Float64, Float64, Float64, Int64}}, Vector{Float64}}}, FOCE, EnsembleThreads, NamedTuple{(), Tuple{}}, TransformVariables.TransformTuple{NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, TransformVariables.ShiftedExp{true, Float64}}}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Float64}}})(F::Float64, g::Nothing, x::Vector{Float64})
    @ Pumas /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/estimation/likelihoods.jl:3856
 [22] (::NLSolversBase.var"#55#56"{NLSolversBase.InplaceObjective{Nothing, Pumas.OptimSafeFunction{true, Pumas.var"#613#615"{PumasModel{(tvCL = 1, tvQ = 1, tvVp = 1, tvVc = 1, tvbio = 1, tvdur = 1, tvktr = 1, ωCL = 1, ωQ = 1, ωVp = 1, ωVc = 1, ωbio = 1, ωdur = 1, ωktr = 1, σ_prop = 1), 7, (:Depot, :Transit1, :Transit2, :Transit3, :Transit4, :Central, :Peripheral), ParamSet{NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, RealDomain{Float64, TransformVariables.Infinity{true}, Float64}}}}, var"#235#241", var"#236#242", var"#237#243", var"#238#244", Pumas.LinearODE, var"#239#245", var"#240#246", ModelingToolkit.ODESystem}, Vector{Subject{NamedTuple{(:DV,), Tuple{Vector{Union{Missing, Float64}}}}, Pumas.ConstantCovar{NamedTuple{(:STUDY,), Tuple{Int64}}}, Vector{Pumas.Event{Float64, Float64, Float64, Float64, Float64, Float64, Int64}}, Vector{Float64}}}, FOCE, EnsembleThreads, NamedTuple{(), Tuple{}}, TransformVariables.TransformTuple{NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, TransformVariables.ShiftedExp{true, Float64}}}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Float64}}}, Nothing, Nothing, Nothing}, Float64})(x::Vector{Float64})
    @ NLSolversBase /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/NLSolversBase/cfJrN/src/objective_types/incomplete.jl:44
 [23] value!!(obj::NLSolversBase.OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}, x::Vector{Float64})
    @ NLSolversBase /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/NLSolversBase/cfJrN/src/interface.jl:9
 [24] value!(obj::NLSolversBase.OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}, x::Vector{Float64})
    @ NLSolversBase /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/NLSolversBase/cfJrN/src/interface.jl:28
 [25] value!(obj::Optim.ManifoldObjective{NLSolversBase.OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}}, x::Vector{Float64})
    @ Optim /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Optim/Zq1jM/src/Manifolds.jl:31
 [26] (::LineSearches.var"#ϕ#1"{Optim.ManifoldObjective{NLSolversBase.OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}}, Vector{Float64}, Vector{Float64}, Vector{Float64}})(α::Float64)
    @ LineSearches /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/LineSearches/G1LRk/src/LineSearches.jl:25
 [27] (::LineSearches.BackTracking{Float64, Int64})(ϕ::LineSearches.var"#ϕ#1"{Optim.ManifoldObjective{NLSolversBase.OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}}, Vector{Float64}, Vector{Float64}, Vector{Float64}}, αinitial::Float64, ϕ_0::Float64, dϕ_0::Float64)
    @ LineSearches /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/LineSearches/G1LRk/src/backtracking.jl:60
 [28] BackTracking
    @ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/LineSearches/G1LRk/src/backtracking.jl:33 [inlined]
 [29] BackTracking
    @ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/LineSearches/G1LRk/src/backtracking.jl:23 [inlined]
 [30] perform_linesearch!(state::Optim.BFGSState{Vector{Float64}, Matrix{Float64}, Float64, Vector{Float64}}, method::Optim.BFGS{LineSearches.InitialStatic{Float64}, LineSearches.BackTracking{Float64, Int64}, Nothing, Float64, Optim.Flat}, d::Optim.ManifoldObjective{NLSolversBase.OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}})
    @ Optim /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Optim/Zq1jM/src/utilities/perform_linesearch.jl:59
 [31] update_state!(d::NLSolversBase.OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}, state::Optim.BFGSState{Vector{Float64}, Matrix{Float64}, Float64, Vector{Float64}}, method::Optim.BFGS{LineSearches.InitialStatic{Float64}, LineSearches.BackTracking{Float64, Int64}, Nothing, Float64, Optim.Flat})
    @ Optim /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Optim/Zq1jM/src/multivariate/solvers/first_order/bfgs.jl:139
 [32] optimize(d::NLSolversBase.OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}, initial_x::Vector{Float64}, method::Optim.BFGS{LineSearches.InitialStatic{Float64}, LineSearches.BackTracking{Float64, Int64}, Nothing, Float64, Optim.Flat}, options::Optim.Options{Float64, Pumas.var"#585#587"{Pumas.DefaultOptimizeFN{Nothing, NamedTuple{(:show_trace, :store_trace, :extended_trace, :g_tol, :allow_f_increases), Tuple{Bool, Bool, Bool, Float64, Bool}}}, Pumas.var"#614#616"{FOCE, Bool, NLSolversBase.OnceDifferentiable{Float64, Vector{Float64}, Vector{Float64}}, TransformVariables.TransformTuple{NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, TransformVariables.ShiftedExp{true, Float64}}}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}}}, state::Optim.BFGSState{Vector{Float64}, Matrix{Float64}, Float64, Vector{Float64}})
    @ Optim /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Optim/Zq1jM/src/multivariate/optimize/optimize.jl:54
 [33] optimize
    @ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Optim/Zq1jM/src/multivariate/optimize/optimize.jl:36 [inlined]
 [34] DefaultOptimizeFN
    @ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/estimation/likelihoods.jl:2993 [inlined]
 [35] _fit(m::PumasModel{(tvCL = 1, tvQ = 1, tvVp = 1, tvVc = 1, tvbio = 1, tvdur = 1, tvktr = 1, ωCL = 1, ωQ = 1, ωVp = 1, ωVc = 1, ωbio = 1, ωdur = 1, ωktr = 1, σ_prop = 1), 7, (:Depot, :Transit1, :Transit2, :Transit3, :Transit4, :Central, :Peripheral), ParamSet{NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, RealDomain{Float64, TransformVariables.Infinity{true}, Float64}}}}, var"#235#241", var"#236#242", var"#237#243", var"#238#244", Pumas.LinearODE, var"#239#245", var"#240#246", ModelingToolkit.ODESystem}, population::Vector{Subject{NamedTuple{(:DV,), Tuple{Vector{Union{Missing, Float64}}}}, Pumas.ConstantCovar{NamedTuple{(:STUDY,), Tuple{Int64}}}, Vector{Pumas.Event{Float64, Float64, Float64, Float64, Float64, Float64, Int64}}, Vector{Float64}}}, param::NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, Float64}}, approx::FOCE, ensemblealg::EnsembleThreads, optimize_fn::Pumas.DefaultOptimizeFN{Nothing, NamedTuple{(:show_trace, :store_trace, :extended_trace, :g_tol, :allow_f_increases), Tuple{Bool, Bool, Bool, Float64, Bool}}}, fixedparamset::ParamSet{NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, RealDomain{Float64, TransformVariables.Infinity{true}, Float64}}}}, fixedparam::NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, Float64}}, checkidentification::Bool, diffeq_options::NamedTuple{(), Tuple{}}, init_vrandeffsorth::Vector{Vector{Float64}}, verbose::Bool)
    @ Pumas /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/estimation/likelihoods.jl:4062
 [36] __fit
    @ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/estimation/likelihoods.jl:3804 [inlined]
 [37] fit(m::PumasModel{(tvCL = 1, tvQ = 1, tvVp = 1, tvVc = 1, tvbio = 1, tvdur = 1, tvktr = 1, ωCL = 1, ωQ = 1, ωVp = 1, ωVc = 1, ωbio = 1, ωdur = 1, ωktr = 1, σ_prop = 1), 7, (:Depot, :Transit1, :Transit2, :Transit3, :Transit4, :Central, :Peripheral), ParamSet{NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, RealDomain{Float64, TransformVariables.Infinity{true}, Float64}}}}, var"#235#241", var"#236#242", var"#237#243", var"#238#244", Pumas.LinearODE, var"#239#245", var"#240#246", ModelingToolkit.ODESystem}, _population::Vector{Subject{NamedTuple{(:DV,), Tuple{Vector{Union{Missing, Float64}}}}, Pumas.ConstantCovar{NamedTuple{(:STUDY,), Tuple{Int64}}}, Vector{Pumas.Event{Float64, Float64, Float64, Float64, Float64, Float64, Int64}}, Vector{Float64}}}, param::NamedTuple{(:tvCL, :tvQ, :tvVp, :tvVc, :tvbio, :tvdur, :tvktr, :ωCL, :ωQ, :ωVp, :ωVc, :ωbio, :ωdur, :ωktr, :σ_prop), NTuple{15, Float64}}, approx::FOCE; optim_alg::Nothing, optim_options::Nothing, optimize_fn::Nothing, constantcoef::NamedTuple{(), Tuple{}}, omegas::Tuple{}, ensemblealg::EnsembleThreads, checkidentification::Bool, diffeq_options::NamedTuple{(), Tuple{}}, init_randeffs::Nothing, init_vrandeffsorth::Nothing, verbose::Bool)
    @ Pumas /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Pumas/Td3Jp/src/estimation/likelihoods.jl:3768
 [38] top-level scope
    @ ~/data/code/padagis_mibe/modeling/pilot1_3_estimation_RT_separated (dual absorption) copy.jl:170

It’s giving me the error after Iteration 6. I have 4 transit compartments, so I sent my 2nd dosing row in the data set to CMT=6, rate=-2 for the dual absorption. Previously, when I ran the fit with CMT=2 by mistake, it errored prior to any iterations.

Does anyone know what may cause this error?

The following is my model:

cmt2_dual_abs_prop_model = @model begin
    @param begin
        tvCL    ∈   RealDomain(lower = 0.0001)
        tvQ     ∈   RealDomain(lower = 0.0001)
        tvVp    ∈   RealDomain(lower = 0.0001)
        tvVc    ∈   RealDomain(lower = 0.0001)
        tvbio   ∈   RealDomain(lower = 0.0001)
        tvdur   ∈   RealDomain(lower = 0.0001)
        tvktr   ∈   RealDomain(lower = 0.0001)
        ωCL     ∈   RealDomain(lower = 0.0001)
        ωQ      ∈   RealDomain(lower = 0.0001)
        ωVp     ∈   RealDomain(lower = 0.0001)
        ωVc     ∈   RealDomain(lower = 0.0001)
        ωbio    ∈   RealDomain(lower = 0.0001)
        ωdur    ∈   RealDomain(lower = 0.0001)
        ωktr    ∈   RealDomain(lower = 0.0001)
        σ_prop  ∈   RealDomain(lower = 0.0001)
    end

    @random begin
        ηCL     ~   Normal(0., ωCL)
        ηQ      ~   Normal(0., ωQ)
        ηVp     ~   Normal(0., ωVp)
        ηVc     ~   Normal(0., ωVc)
        ηbio    ~   Normal(0., ωbio)
        ηdur    ~   Normal(0., ωdur)
        ηktr    ~   Normal(0., ωktr)
    end

    @pre begin
        CL      =   tvCL*exp(ηCL)
        Q       =   tvQ*exp(ηQ)
        Vp      =   tvVp*exp(ηVp)
        Vc      =   tvVc*exp(ηVc)
        ktr     =   tvktr*exp(ηktr)
    end

    @dosecontrol begin
        duration    =   (Central = tvdur*exp(ηdur),)
        bioav       =   (Depot = tvbio*exp(ηbio),
                        Central = 1 - tvbio*exp(ηbio)
                        )
    end

    @dynamics begin
        Depot'      =   -ktr * Depot
        Transit1'   =   ktr * Depot - ktr * Transit1
        Transit2'   =   ktr * Transit1 - ktr * Transit2
        Transit3'   =   ktr * Transit2 - ktr * Transit3
        Transit4'   =   ktr * Transit3 - ktr * Transit4
        Central'    =   ktr * Transit4 - Q/Vc * Central + Q/Vp * Peripheral - CL/Vc * Central
        Peripheral' =   Q/Vc * Central - Q/Vp * Peripheral
    end
    
    @derived begin
        CP      =   @. Central/Vc

        DV      ~   @. Normal(CP, abs(CP)*σ_prop)
    end
end