Hello Experts in Pumas,
I met the error below when during estimation, when I used the standard deviation directly to define the error model, like:
abs(Conc)*σ_prop
Error message:
BoundsError: attempt to access 0-element Array{Float64,1} at index [1]
getindex at array.jl:728 [inlined]
#solve_tr_subproblem!#36(::Float64, ::Int64, ::typeof(Optim.solve_tr_subproblem!), ::Array{Float64,1}, ::Array{Float64,2}, ::Float64, ::Array{Float64,1}) at newton_trust_region.jl:105
solve_tr_subproblem! at newton_trust_region.jl:94 [inlined]
update_state!(::NLSolversBase.TwiceDifferentiable{Float64,Array{Float64,1},Array{Float64,2},Array{Float64,1}}, ::Optim.NewtonTrustRegionState{Array{Float64,1},Float64,Array{Float64,1}}, ::Optim.NewtonTrustRegion{Float64}) at newton_trust_region.jl:314
optimize(::NLSolversBase.TwiceDifferentiable{Float64,Array{Float64,1},Array{Float64,2},Array{Float64,1}}, ::Array{Float64,1}, ::Optim.NewtonTrustRegion{Float64}, ::Optim.Options{Float64,Nothing}, ::Optim.NewtonTrustRegionState{Array{Float64,1},Float64,Array{Float64,1}}) at optimize.jl:57
optimize at optimize.jl:33 [inlined]
#_orth_empirical_bayes!#145(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}, ::typeof(Pumas._orth_empirical_bayes!), ::Array{Float64,1}, ::PumasModel{ParamSet{NamedTuple{(:tvcl, :tvQ, :tvv, :tvvt, :Ω, :σ_prop),Tuple{RealDomain{Int64,TransformVariables.Infinity{true},Float64},RealDomain{Int64,TransformVariables.Infinity{true},Float64},RealDomain{Int64,TransformVariables.Infinity{true},Float64},RealDomain{Int64,TransformVariables.Infinity{true},Float64},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}},getfield(Main, Symbol("##19#24")),getfield(Main, Symbol("##20#25")),getfield(Main, Symbol("##21#26")),Central1Periph1,getfield(Main, Symbol("##22#27")),getfield(Main, Symbol("##23#28"))}, ::Subject{NamedTuple{(:DV,),Tuple{Array{Union{Missing, Float64},1}}},NamedTuple{(:WT, :CRCLM_final, :ALB),Tuple{Float64,Float64,Float64}},Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Int64},1},Array{Float64,1}}, ::NamedTuple{(:tvcl, :tvQ, :tvv, :tvvt, :Ω, :σ_prop),Tuple{Float64,Float64,Float64,Float64,PDMats.PDiagMat{Float64,Array{Float64,1}},Float64}}, ::Pumas.FOCEI) at likelihoods.jl:248
_orth_empirical_bayes! at likelihoods.jl:221 [inlined]
#219 at likelihoods.jl:1079 [inlined]
mapreduce_first(::getfield(Pumas, Symbol("##219#225")){NamedTuple{(:tvcl, :tvQ, :tvv, :tvvt, :Ω, :σ_prop),Tuple{Float64,Float64,Float64,Float64,PDMats.PDiagMat{Float64,Array{Float64,1}},Float64}},Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}},PumasModel{ParamSet{NamedTuple{(:tvcl, :tvQ, :tvv, :tvvt, :Ω, :σ_prop),Tuple{RealDomain{Int64,TransformVariables.Infinity{true},Float64},RealDomain{Int64,TransformVariables.Infinity{true},Float64},RealDomain{Int64,TransformVariables.Infinity{true},Float64},RealDomain{Int64,TransformVariables.Infinity{true},Float64},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}},getfield(Main, Symbol("##19#24")),getfield(Main, Symbol("##20#25")),getfield(Main, Symbol("##21#26")),Central1Periph1,getfield(Main, Symbol("##22#27")),getfield(Main, Symbol("##23#28"))},Pumas.FOCEI,Tuple{}}, ::Function, ::Tuple{Subject{NamedTuple{(:DV,),Tuple{Array{Union{Missing, Float64},1}}},NamedTuple{(:WT, :CRCLM_final, :ALB),Tuple{Float64,Float64,Float64}},Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Int64},1},Array{Float64,1}},Array{Float64,1},Array{Float64,1}}) at reduce.jl:301
mapfoldl_impl(::Function, ::Function, ::NamedTuple{,Tuple{}}, ::Base.Iterators.Zip{Tuple{Array{Subject{NamedTuple{(:DV,),Tuple{Array{Union{Missing, Float64},1}}},NamedTuple{(:WT, :CRCLM_final, :ALB),Tuple{Float64,Float64,Float64}},Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Int64},1},Array{Float64,1}},1},Array{Array{Float64,1},1},Array{Array{Float64,1},1}}}) at reduce.jl:60
#mapfoldl#188 at reduce.jl:72 [inlined]
mapfoldl at reduce.jl:72 [inlined]
#mapreduce#192 at reduce.jl:208 [inlined]
mapreduce at reduce.jl:208 [inlined]
sum(::Function, ::Base.Iterators.Zip{Tuple{Array{Subject{NamedTuple{(:DV,),Tuple{Array{Union{Missing, Float64},1}}},NamedTuple{(:WT, :CRCLM_final, :ALB),Tuple{Float64,Float64,Float64}},Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Int64},1},Array{Float64,1}},1},Array{Array{Float64,1},1},Array{Array{Float64,1},1}}}) at reduce.jl:403
(::getfield(Pumas, Symbol("##218#224")){Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}},PumasModel{ParamSet{NamedTuple{(:tvcl, :tvQ, :tvv, :tvvt, :Ω, :σ_prop),Tuple{RealDomain{Int64,TransformVariables.Infinity{true},Float64},RealDomain{Int64,TransformVariables.Infinity{true},Float64},RealDomain{Int64,TransformVariables.Infinity{true},Float64},RealDomain{Int64,TransformVariables.Infinity{true},Float64},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}},getfield(Main, Symbol("##19#24")),getfield(Main, Symbol("##20#25")),getfield(Main, Symbol("##21#26")),Central1Pe...
However, fortunately, the model can run through without errors if I use the variance to define the error model, like
sqrt(Conc^2)*sqrt(σ²_prop)
So, dear experts, I have two questions:
- Can anyone help me understand what the error means and how can I fix it?
- Is there any preferences in choosing either σ² or σ to define RUV for estimation?
Due to confidentiality, I couldn’t share the data or code here.
But any help is appreciated. Thank you!