Unable to interpret the fitting error

Hello,
1.
I am having an error message that I could not interpret while fitting a simple 2 cmt model using FOCEI, which suggested “no method matching iterate”:

julia> 
  0.008392 seconds (4.48 k allocations: 242.156 KiB)
Iter     Function value   Gradient norm
     0              Inf     0.000000e+00
 * time: 0.0009999275207519531
Calculating: variance-covariance matrix. Failed.
Calculating: predictionsERROR: LoadError: MethodError: no method matching iterate(::Nothing)
Closest candidates are:
  iterate(::Core.SimpleVector) at essentials.jl:603
  iterate(::Core.SimpleVector, ::Any) at essentials.jl:603
  iterate(::ExponentialBackOff) at error.jl:253

I am wondering if it suggests convergence failed?

And then I change the initial to a distribution instead, another error said “no filed DV”:

julia> pkres = fit(ped_mod, df, param, Pumas.FOCEI(),

                     optimize_fn=Pumas.DefaultOptimizeFN(show_trace=true, extended_trace=false))
ERROR: type NamedTuple has no field DV

But I have a variable DV in my dataset, not sure what this error message meant.

Thanks!
Anqi

Hey @anqipan,

Did you get “1” while running fit or infer?

For “2” I think the problem might be that your model doesn’t have the DV variable in the derived block, you should have the name of the dv in the derived block match the name of the dv in the dataset, can you confirm if this is indeed the issue?

Hi Vaibhavdixit02,

  1. For question 1, I used fit(). Please see the code below:
 using Distributions, Pumas, CSV, TableView, StatsPlots, DataFrames

ped_mod = @model begin

    @param   begin
      θ ∈ VectorDomain(8,lower=[0,0,0,0,-Inf,-Inf,-Inf,-Inf])
      Ω  ∈ PDiagDomain(3)
      σ_prop ∈ RealDomain(lower = 0)
    end

    @random begin
      η ~ MvNormal(Ω)
    end

    @covariates WTKG  CRCL

    @pre begin
    #--INSERT COVARIATE EFFECTS
    COV1=(CRCL/100)^θ[5]
    COV2=(WTKG/70)^θ[6]
    COV3=(WTKG/70)^θ[7]
    COV4=(WTKG/70)^θ[8]


    TVCLI = θ[1]*COV1*COV4
    TVCL  = TVCLI

    TVV1I = θ[2]*COV2
    TVV1  = TVV1I

    TVQI  = θ[3]
    TVQ   = TVQI

    TVV2I = θ[4]*COV3
    TVV2  = TVV2I

    CL  = TVCL*exp(η[1])
    V1  = TVV1*exp(η[2])
    Q   = TVQ
    V2  = TVV2*exp(η[3])

    Vc = V1
    Vp = V2

    S1 = V1

    #CALCULATION OF SECONDARY PARAMETERS
    KE  = CL/V1
    K12 = Q/V1
    K21 = Q/V2
    AA = KE+K12+K21
    ALPH = (AA+sqrt(AA*AA-4*KE*K21))/2
    BETA = (AA-sqrt(AA*AA-4*KE*K21))/2
 
    end

    @dynamics Central1Periph1 #a two compartment model

    #@dynamics begin
  #Central'    = -(CL+Q)/Vc*Central + Q/Vp*Peripheral
  #Peripheral' =        Q/Vc*Central - Q/Vp*Peripheral
#end

    @derived begin
        cp = @. 1000*(Central/Vc)
        DV ~ @. Normal(cp, sqrt((cp^2*σ_prop)))
      end
  end



  ## Read Dataset
  inputDataset = CSV.read("dat.csv")


  ## Convert the dataset into a pumas object
  ## Pumas expects a dvs and id column. So map the names of the columns
  df = read_pumas(inputDataset, id = :ID, dvs =[:DV],  cvs=[:WTKG, :CRCL], evid=:EVID, amt=:AMT,cmt=:CMT, rate=:RATE, time=:TIME)


#Initla value for parameters
param = (
    θ=([18,14.2,2.13,4.29,1,1,1,1]),
    Ω  = Diagonal([0.25,0.25,0.25]),
    σ_prop = 0.04)

  ## Fit the data with model specified above
  pkres = fit(ped_mod, df, param, Pumas.FOCEI(),
              optimize_fn=Pumas.DefaultOptimizeFN(show_trace=true, extended_trace=false))
  1. For 2, yes I forgot to mention DV in the derive block, thank you. But after adding DV in the derive block, it returned a similar error as in “1”:
LoadError: MethodError: no method matching iterate(::Nothing)
Closest candidates are:
  iterate(!Matched::Core.SimpleVector) at essentials.jl:603
  iterate(!Matched::Core.SimpleVector, !Matched::Any) at essentials.jl:603
  iterate(!Matched::ExponentialBackOff) at error.jl:253
  ...

The code in “2” is almost the same as in “1”, the only difference is theta is a distribution:

    @param   begin
      Ω  ∈ PDiagDomain(3)
      σ_prop ∈ RealDomain(lower = 0)
      θ ~ MvNormal([16.6,13.1,4.05,4.89,0.623,0,0,0],
                  Diagonal([0.0895,0.0655,0.0238,0.0161,0.0016,1000^2,1000^2,1000^2]))

    end
  1. There’s another issue is that I am not able to specify a diagonal of initials in the @param block, which I think is doable according to the examples.
    codes:
    @param   begin
      θ ∈ VectorDomain(8,lower=[0,0,0,0,-Inf,-Inf,-Inf,-Inf],init=[18,14.2,2.13,4.29,1,1,1,1])
      Ω  ∈ PDiagDomain(3,init=[0.25,0.25,0.25])
      σ_prop ∈ RealDomain(lower = 0,init=0.04)
    end

error:

LoadError: MethodError: no method matching PDiagDomain(::Int64; init=[0.25 0.0 0.0; 0.0 0.25 0.0; 0.0 0.0 0.25])
got unsupported keyword argument "init"

Thanks in advance!

Best,
Anqi

Hey @anqipan,

I am finding it hard to understand your post, would it be possible for you to share the data so that I can run the model locally and get back to you?

Otherwise could you share the complete stack trace for “1”? The errors in the first post and the second look different, so I am not sure where the problem lies.

For “3” you don’t need to pass in the dimensions to PDiagDomain it should just be Ω ∈ PDiagDomain(init=[0.25,0.25,0.25])

Sorry for the confusion, so let’s just focus on “1”. I am not allowed to share the data file since it’s confidential, and below is my complete coding:

@time using Distributions, Pumas, CSV, TableView, StatsPlots, DataFrames

ped_mod = @model begin

    @param   begin
      θ ∈ VectorDomain(8,lower=[0,0,0,0,-Inf,-Inf,-Inf,-Inf])
      Ω  ∈ PDiagDomain(3)
      σ_prop ∈ RealDomain(lower = 0)
    end

    @random begin
      η ~ MvNormal(Ω)
    end

    @covariates WTKG  CRCL

    @pre begin
    #--INSERT COVARIATE EFFECTS
    COV1=(CRCL/100)^θ[5]
    COV2=(WTKG/70)^θ[6]
    COV3=(WTKG/70)^θ[7]
    COV4=(WTKG/70)^θ[8]


    TVCLI = θ[1]*COV1*COV4
    TVCL  = TVCLI

    TVV1I = θ[2]*COV2
    TVV1  = TVV1I

    TVQI  = θ[3]
    TVQ   = TVQI

    TVV2I = θ[4]*COV3
    TVV2  = TVV2I

    CL  = TVCL*exp(η[1])
    V1  = TVV1*exp(η[2])
    Q   = TVQ
    V2  = TVV2*exp(η[3])

    Vc = V1
    Vp = V2

    S1 = V1

    #CALCULATION OF SECONDARY PARAMETERS
    KE  = CL/V1
    K12 = Q/V1
    K21 = Q/V2
    AA = KE+K12+K21
    ALPH = (AA+sqrt(AA*AA-4*KE*K21))/2
    BETA = (AA-sqrt(AA*AA-4*KE*K21))/2



    end

    @dynamics Central1Periph1 #a two compartment model

    @derived begin
        cp = @. 1000*(Central/Vc)
        DV ~ @. Normal(cp, sqrt((cp^2*σ_prop)))
      end
  end

  ## Read Dataset
  inputDataset = CSV.read("dat.csv")
  showtable(inputDataset)


  df = read_pumas(inputDataset, id = :ID, dvs =[:DV],  cvs=[:WTKG, :CRCL], evid=:EVID, amt=:AMT,cmt=:CMT, rate=:RATE, time=:TIME)



#Initla value for parameters
param = (
    θ=([18,14.2,2.13,4.29,1,1,1,1]),
    Ω  = Diagonal([0.25,0.25,0.25]),
    σ_prop = 0.04)


  #pkres =fit(mymodel, read_pumas(DataFrame(df); cvs=[:WTKG,:CRCL]), param, Pumas.FOCEI())
  pkres = fit(ped_mod, df, param, Pumas.FOCEI(),
              optimize_fn=Pumas.DefaultOptimizeFN(show_trace=true, extended_trace=false))

The running record and the error is like:

102.571227 seconds (153.88 M allocations: 8.215 GiB, 2.75% gc time)
Iter     Function value   Gradient norm
     0              Inf     0.000000e+00
 * time: 0.1399998664855957
Calculating: variance-covariance matrix. Failed.
Calculating: predictions
ERROR: LoadError: MethodError: no method matching iterate(::Nothing)
Closest candidates are:
  iterate(::Core.SimpleVector) at essentials.jl:603
  iterate(::Core.SimpleVector, ::Any) at essentials.jl:603
  iterate(::ExponentialBackOff) at error.jl:253

Given the function is Inf and the Gradient is NA, I am guessing it means my initial is impossible value for my model? I am trying to confirm if this is nothing to do with any inappropriate formatting of my codes.

Thanks again!
Anqi

Hello,

Just a follow up on my question, after I modified the param block, the fitting process works, but the infer(fit) returned an error that it could not calculate the SE, the complete codes and error message is shown below.

Codes:

@time using Distributions, Pumas, CSV, TableView, StatsPlots, DataFrames

ped_mod = @model begin

    @param   begin


      θ ~ MvNormal([16.6,13.1,4.05,4.89,0.623,0,0,0],
      Matrix{Float64}([0.0895	0.0167	0.00318	0.0033	0.000907	0	0	0;
                       0.0167	0.0655	-0.00765	0.00333	-0.000917	0	0	0;
                       0.00318	-0.00765	0.0238	0.0147	-0.000225	0	0	0;
                       0.0033	0.00333	0.0147	0.0161	-0.000243	0	0	0;
                       0.000907	-0.000917	-0.000225	-0.000243	0.0016	0	0	0;
                       0	0	0	0	0	1000000	0	0;
                       0	0	0	0	0	0	1000000	0;
                       0	0	0	0	0	0	0	1000000]))


      Ω  ∈ PDiagDomain(3)


      σ_prop ∈ RealDomain(lower = 0)

    end

    @random begin
      η ~ MvNormal(Ω)
    end

    @covariates WTKG  CRCL

    @pre begin

    COV1=(CRCL/100)^θ[5]
    COV2=(WTKG/70)^θ[6]
    COV3=(WTKG/70)^θ[7]
    COV4=(WTKG/70)^θ[8]


    TVCLI = θ[1]*COV1*COV4
    TVCL  = TVCLI

    TVV1I = θ[2]*COV2
    TVV1  = TVV1I

    TVQI  = θ[3]
    TVQ   = TVQI

    TVV2I = θ[4]*COV3
    TVV2  = TVV2I

    CL  = TVCL*exp(η[1])
    V1  = TVV1*exp(η[2])
    Q   = TVQ
    V2  = TVV2*exp(η[3])

    Vc = V1
    Vp = V2

    S1 = V1


    KE  = CL/V1
    K12 = Q/V1
    K21 = Q/V2
    AA = KE+K12+K21
    ALPH = (AA+sqrt(AA*AA-4*KE*K21))/2
    BETA = (AA-sqrt(AA*AA-4*KE*K21))/2

    end

    @dynamics Central1Periph1 #a two compartment model



    @derived begin
        cp = @. 1000*(Central/Vc)
        DV ~ @. Normal(cp, ((cp^2*σ_prop)))
      end
  end


  inputDataset = CSV.read("dat.csv")


  df = read_pumas(inputDataset, id = :ID, dvs =[:DV],  cvs=[:WTKG, :CRCL], evid=:EVID, amt=:AMT,cmt=:CMT, rate=:RATE, time=:TIME)


param = (
    θ=([18,14.2,2.13,4.29,1,1,1,1]),
    Ω  = Diagonal([0.25,0.25,0.25]),
    σ_prop = 0.04)



  pkres = fit(ped_mod, df, param, Pumas.FOCEI(),
              optimize_fn=Pumas.DefaultOptimizeFN(show_trace=true, extended_trace=false))


coeftable(pkres)


pkinfer = infer(pkres)
coeftable(pkinfer)

Error message:

 infer(pkres)
Calculating: variance-covariance matrix. Done.
Asymptotic inference results

Successful minimization:                true

Likelihood approximation:        Pumas.FOCEI
Deviance:                          614.17262
Total number of observation records:     133
Number of active observation records:    115
Number of subjects:                       35

Error showing value of type Pumas.FittedPumasModelInference{Pumas.FittedPumasModel{PumasModel{ParamSet{NamedTuple{(:θ, :Ω, :σ_prop),Tuple{MvNormal{Float64,PDMats.PDMat{Float64,Array{Float64,2}},Array{Float64,1}},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}},var"#659#714",var"#660#715",var"#661#717",Central1Periph1,var"#662#718",var"#688#744"},Array{Subject{NamedTuple{(:DV,),Tuple{Array{Union{Missing, Float64},1}}},Pumas.ConstantCovar{NamedTuple{(:WTKG, :CRCL),Tuple{Float64,Float64}}},Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Int64},1},Array{Float64,1},Float64},1},Optim.MultivariateOptimizationResults{Optim.BFGS{LineSearches.InitialStatic{Float64},LineSearches.BackTracking{Float64,Int64},Pumas.var"#253#254"{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"#253#254"{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{},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{(:θ, :Ω, :σ_prop),Tuple{MvNormal{Float64,PDMats.PDMat{Float64,Array{Float64,2}},Array{Float64,1}},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}}},Array{Float64,2},Float64}:
ERROR: MethodError: no method matching tostderrortransform(::MvNormal{Float64,PDMats.PDMat{Float64,Array{Float64,2}},Array{Float64,1}})
Closest candidates are:
  tostderrortransform(::ParamSet) at C:\Users\juliapro\JuliaPro_v1.4.2-2\packages\Pumas\NCmSe\src\estimation\transforms.jl:321
  tostderrortransform(::ConstDomain) at C:\Users\juliapro\JuliaPro_v1.4.2-2\packages\Pumas\NCmSe\src\estimation\transforms.jl:323
  tostderrortransform(::Pumas.Domain) at C:\Users\juliapro\JuliaPro_v1.4.2-2\packages\Pumas\NCmSe\src\estimation\transforms.jl:322
Stacktrace:
 [1] map(::typeof(Pumas.tostderrortransform), ::Tuple{MvNormal{Float64,PDMats.PDMat{Float64,Array{Float64,2}},Array{Float64,1}},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}) at .\tuple.jl:159
 [2] map(::Function, ::NamedTuple{(:θ, :Ω, :σ_prop),Tuple{MvNormal{Float64,PDMats.PDMat{Float64,Array{Float64,2}},Array{Float64,1}},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}) at .\namedtuple.jl:169
 [3] tostderrortransform(::ParamSet{NamedTuple{(:θ, :Ω, :σ_prop),Tuple{MvNormal{Float64,PDMats.PDMat{Float64,Array{Float64,2}},Array{Float64,1}},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}}) at C:\Users\juliapro\JuliaPro_v1.4.2-2\packages\Pumas\NCmSe\src\estimation\transforms.jl:321
 [4] stderror(::Pumas.FittedPumasModelInference{Pumas.FittedPumasModel{PumasModel{ParamSet{NamedTuple{(:θ, :Ω, :σ_prop),Tuple{MvNormal{Float64,PDMats.PDMat{Float64,Array{Float64,2}},Array{Float64,1}},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}},var"#659#714",var"#660#715",var"#661#717",Central1Periph1,var"#662#718",var"#688#744"},Array{Subject{NamedTuple{(:DV,),Tuple{Array{Union{Missing, Float64},1}}},Pumas.ConstantCovar{NamedTuple{(:WTKG, :CRCL),Tuple{Float64,Float64}}},Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Int64},1},Array{Float64,1},Float64},1},Optim.MultivariateOptimizationResults{Optim.BFGS{LineSearches.InitialStatic{Float64},LineSearches.BackTracking{Float64,Int64},Pumas.var"#253#254"{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"#253#254"{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{},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{(:θ, :Ω, :σ_prop),Tuple{MvNormal{Float64,PDMats.PDMat{Float64,Array{Float64,2}},Array{Float64,1}},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}}},Array{Float64,2},Float64}) at C:\Users\juliapro\JuliaPro_v1.4.2-2\packages\Pumas\NCmSe\src\estimation\inference.jl:17
 [5] coeftable(::Pumas.FittedPumasModelInference{Pumas.FittedPumasModel{PumasModel{ParamSet{NamedTuple{(:θ, :Ω, :σ_prop),Tuple{MvNormal{Float64,PDMats.PDMat{Float64,Array{Float64,2}},Array{Float64,1}},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}},var"#659#714",var"#660#715",var"#661#717",Central1Periph1,var"#662#718",var"#688#744"},Array{Subject{NamedTuple{(:DV,),Tuple{Array{Union{Missing, Float64},1}}},Pumas.ConstantCovar{NamedTuple{(:WTKG, :CRCL),Tuple{Float64,Float64}}},Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Int64},1},Array{Float64,1},Float64},1},Optim.MultivariateOptimizationResults{Optim.BFGS{LineSearches.InitialStatic{Float64},LineSearches.BackTracking{Float64,Int64},Pumas.var"#253#254"{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"#253#254"{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{},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{(:θ, :Ω, :σ_prop),Tuple{MvNormal{Float64,PDMats.PDMat{Float64,Array{Float64,2}},Array{Float64,1}},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}}},Array{Float64,2},Float64}) at C:\Users\juliapro\JuliaPro_v1.4.2-2\packages\Pumas\NCmSe\src\estimation\show.jl:200
 [6] show(::IOContext{REPL.Terminals.TTYTerminal}, ::MIME{Symbol("text/plain")}, ::Pumas.FittedPumasModelInference{Pumas.FittedPumasModel{PumasModel{ParamSet{NamedTuple{(:θ, :Ω, :σ_prop),Tuple{MvNormal{Float64,PDMats.PDMat{Float64,Array{Float64,2}},Array{Float64,1}},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}},var"#659#714",var"#660#715",var"#661#717",Central1Periph1,var"#662#718",var"#688#744"},Array{Subject{NamedTuple{(:DV,),Tuple{Array{Union{Missing, Float64},1}}},Pumas.ConstantCovar{NamedTuple{(:WTKG, :CRCL),Tuple{Float64,Float64}}},Array{Pumas.Event{Float64,Float64,Float64,Float64,Float64,Float64,Int64},1},Array{Float64,1},Float64},1},Optim.MultivariateOptimizationResults{Optim.BFGS{LineSearches.InitialStatic{Float64},LineSearches.BackTracking{Float64,Int64},Pumas.var"#253#254"{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"#253#254"{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{},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{(:θ, :Ω, :σ_prop),Tuple{MvNormal{Float64,PDMats.PDMat{Float64,Array{Float64,2}},Array{Float64,1}},PDiagDomain{PDMats.PDiagMat{Float64,Array{Float64,1}}},RealDomain{Int64,TransformVariables.Infinity{true},Float64}}}}},Array{Float64,2},Float64}) at C:\Users\.juliapro\JuliaPro_v1.4.2-2\packages\Pumas\NCmSe\src\estimation\show.jl:237
 [7] display(::REPL.REPLDisplay, ::MIME{Symbol("text/plain")}, ::Any) at C:\Users\julia\AppData\Local\Julia-1.4.2\share\julia\stdlib\v1.4\REPL\src\REPL.jl:137
 [8] display(::REPL.REPLDisplay, ::Any) at C:\Users\julia\AppData\Local\Julia-1.4.2\share\julia\stdlib\v1.4\REPL\src\REPL.jl:141
 [9] display(::Any) at .\multimedia.jl:323
 [10] #invokelatest#1 at .\essentials.jl:712 [inlined]
 [11] invokelatest at .\essentials.jl:711 [inlined]
 [12] print_response(::IO, ::Any, ::Bool, ::Bool, ::Any) at C:\Users\julia\AppData\Local\Julia-1.4.2\share\julia\stdlib\v1.4\REPL\src\REPL.jl:161
 [13] print_response(::REPL.AbstractREPL, ::Any, ::Bool, ::Bool) at C:\Users\julia\AppData\Local\Julia-1.4.2\share\julia\stdlib\v1.4\REPL\src\REPL.jl:146
 [14] (::REPL.var"#do_respond#38"{Bool,Atom.var"#250#251",REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at C:\Users\julia\AppData\Local\Julia-1.4.2\share\julia\stdlib\v1.4\REPL\src\REPL.jl:729
 [15] #invokelatest#1 at .\essentials.jl:712 [inlined]
 [16] invokelatest at .\essentials.jl:711 [inlined]
 [17] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at C:\Users\julia\AppData\Local\Julia-1.4.2\share\julia\stdlib\v1.4\REPL\src\LineEdit.jl:2354
 [18] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at C:\Users\julia\AppData\Local\Julia-1.4.2\share\julia\stdlib\v1.4\REPL\src\REPL.jl:1055
 [19] run_repl(::REPL.AbstractREPL, ::Any) at C:\Users\julia\AppData\Local\Julia-1.4.2\share\julia\stdlib\v1.4\REPL\src\REPL.jl:206
 [20] (::Base.var"#764#766"{Bool,Bool,Bool,Bool})(::Module) at .\client.jl:383
 [21] #invokelatest#1 at .\essentials.jl:712 [inlined]
 [22] invokelatest at .\essentials.jl:711 [inlined]
 [23] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at .\client.jl:367
 [24] exec_options(::Base.JLOptions) at .\client.jl:305
 [25] _start() at .\client.jl:484

Thanks!
Anqi

I think the problem with this version here is VectorDomain(8,lower=[0,0,0,0,-Inf,-Inf,-Inf,-Inf]). Could you please try this version with something like VectorDomain(8,lower=[0,0,0,0,-1e6,-1e6,-1e6,-1e6]) or alternatively VectorDomain(8,lower=[0,0,0,0,-Pumas.∞,-Pumas.∞,-Pumas.∞,-Pumas.∞])? Using Inf in the bounds causes Inf to propagate through the computations causing the error you are getting.

This is a small bug in Pumas. I’ve filed an issue so it should get fixed before the 1.0 release.

Please notice though, that specifying a distribution currently won’t be different from specifying a domain when fitting with Pumas.FOCEI(). Eventually, we might make this do MAP estimation but currently the prior is only used for determining the domain. Hence, you should be able to successfully fit the model and call infer if you use the version suggested in Unable to interpret the fitting error

Dear Andreas,

Thanks for your reply on my question regarding the error of calculating the SE!

I am wondering would the issue of distributional domain also results in the error I asked in another post " Unable to specify a correct prior distribution"?

I tried to specify priors under both FOCEI and HMC-NUTS, and neither of them could pass the “InverseWishart” prior during the fitting step. I have read the Pumas Bayesian example, it’s using univariate InverseWishart, and my case is multivariate InverseWishart. Could it be an issue?

Thanks!
Anqi