Problem with fitting Beta distribution

Trying to do a simple distribution fitting with Distributions package throws me an error. I’ve been able to get it working with various other distributions, including Dirichlet and Binomial, but can’t for Beta. I’m doing:

k = rand(Beta(1.0, 1.0), 10)
fit_mle(Beta, k)

Which throws me the error:

suffstats is not implemented for (Beta, Vector{Float64}).

 [1] error(s::String)
   @ Base ./error.jl:33
 [2] suffstats(dt::Type{Beta}, xs::Vector{Float64})
   @ Distributions ~/.julia/packages/Distributions/HjzA0/src/genericfit.jl:5
 [3] fit_mle(dt::Type{Beta}, x::Vector{Float64})
   @ Distributions ~/.julia/packages/Distributions/HjzA0/src/genericfit.jl:27
 [4] top-level scope
   @ In[154]:5
 [5] eval
   @ ./boot.jl:360 [inlined]
 [6] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base ./loading.jl:1116

I read through an example of this on Poisson data, but my data type is correct as far as I know, given it was sampled from Beta.

Thanks everyone!

1 Like