Closed ron-wolf closed 3 years ago
The cdf of the Binomial distribution is based on the incomplete Beta function which is very complicated function to implement reliably. However, I guess we could have a naive fallback that sums up the probabilities.
Certainly! I’d be happy to get involved in implementing this. I’m relatively new to Julia though, as well as to statistics generally. I have a few questions:
Related: #33
The issue was fixed by https://github.com/JuliaStats/StatsFuns.jl/pull/125. With StatsFuns 0.9.11:
julia> using Distributions; ccdf(Binomial(7, 1//5), 1)
0.4232832000000002
StatsFuns.binomccdf()
maps to the eponymous R function, as shown below.https://github.com/JuliaStats/StatsFuns.jl/blob/d99fdf43d40a70ca7a688e11afba1a84963eb396/src/distrs/binom.jl#L3-L13
However, when called on a binomial distribution with
𝑝::Rational
, an error occurs; currently, the only option is to convert the parameter usingfloat()
. Note that although the code below uses Distributions, I believe the error is on the part of StatsFuns: see this code in Distributions for the call to StatsFuns.Is this intended behavior? Such distributions work just fine with
StatsPlots.plot()
.