I am trying to compute quantiles of the Dirichlet distribution using Distributions, but I am getting this error:
julia> quantile(Dirichlet([1,1,1]), 0.5)
ERROR: MethodError: no method matching iterate(::Dirichlet{Float64})
Closest candidates are:
iterate(::Union{LinRange, StepRangeLen}) at range.jl:664
iterate(::Union{LinRange, StepRangeLen}, ::Int64) at range.jl:664
iterate(::T) where T<:Union{Base.KeySet{var"#s79", var"#s78"} where {var"#s79", var"#s78"<:Dict}, Base.ValueIterator{var"#s77"} where var"#s77"<:Dict} at dict.jl:693
...
Stacktrace:
[1] copyto!(dest::Vector{Float64}, src::Dirichlet{Float64})
@ Base .\abstractarray.jl:843
[2] _collect(cont::UnitRange{Int64}, itr::Dirichlet{Float64}, #unused#::Base.HasEltype, isz::Base.HasLength)
@ Base .\array.jl:608
[3] collect(itr::Dirichlet{Float64})
@ Base .\array.jl:602
[4] quantile(itr::Dirichlet{Float64}, p::Float64; sorted::Bool, alpha::Float64, beta::Float64)
@ Statistics C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Statistics\src\Statistics.jl:1049
[5] quantile(itr::Dirichlet{Float64}, p::Float64)
@ Statistics C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Statistics\src\Statistics.jl:1049
[6] top-level scope
@ REPL[39]:1
Maybe quantile
cannot handle the Dirichlet distribution? Are there alternatives?