Error with vpc() function

Hello I am trying to run the vpc function but I am getting the following error

julia> ufh_vpc = vpc(modfit, 500; observations = [:CONC],
                    ensemblealg=EnsembleThreads(), prediction_correction = true)
[ Info: Continuous VPC
ERROR: MethodError: Cannot `convert` an object of type Missing to an object of type Float64
Closest candidates are:
  convert(::Type{T}, ::Static.StaticFloat64{N}) where {N, T<:AbstractFloat} at /builds/PumasAI/PumasSystemImages-jl/.julia/packages/Static/pkxBE/src/float.jl:26
  convert(::Type{T}, ::LLVM.GenericValue, ::LLVM.LLVMType) where T<:AbstractFloat at /builds/PumasAI/PumasSystemImages-jl/.julia/packages/LLVM/WjSQG/src/execution.jl:39
  convert(::Type{T}, ::LLVM.ConstantFP) where T<:AbstractFloat at /builds/PumasAI/PumasSystemImages-jl/.julia/packages/LLVM/WjSQG/src/core/value/constant.jl:111
  ...
Stacktrace:
  [1] setindex!(A::Vector{Float64}, x::Missing, i1::Int64)
    @ Base ./array.jl:903
  [2] DataFrame(subject::Subject{NamedTuple{(:CONC,), Tuple{Vector{Union{Missing, Float64}}}}, Pumas.ConstantInterpolationStructArray{Vector{Float64}, NamedTuple{(:logwt, :AGE_GROUP, :logecmo, :WT, :AGE_D, :ISMALE, :SCR, :GFR, :AGEYRS, :TYPE_MODELING, :IS_BLEEDING, :IS_CIRCUIT_CHANGE, :ECMO_DAYS, :Occassions, :IS_CIRCUIT_CHANGE_UPDATE, :IS_BLEEDING_UPDATE), Tuple{Vector{Float64}, Vector{String31}, Vector{Float64}, Vector{Float64}, Vector{Int64}, Vector{Int64}, Vector{Float64}, Vector{Int64}, Vector{Float64}, Vector{Int64}, Vector{Int64}, Vector{Int64}, Vector{Int64}, Vector{Int64}, Vector{Int64}, Vector{Int64}}}, Symbol}, Vector{Pumas.Event{Float64, Float64, Float64, Float64, Float64, Float64, Int64}}, Vector{Float64}}; include_covariates::Bool, include_observations::Bool, include_events::Bool, extra_time::Vector{Float64})
    @ Pumas /builds/PumasAI/PumasSystemImages-jl/.julia/packages/Pumas/MxXdQ/src/data_parsing/io.jl:1180

Any idea why I am getting this error ?

Thanks

Unfortunately, it’s the same bug as Error with DataFrame function when using output from predict function since the vpc function is hitting that method. I’ll try to see if there is a workaround. In any case, this will be fixed in the upcoming release.

1 Like