class Statistics::Binomial
- Statistics::Binomial
- Statistics::DiscreteDistribution
- Reference
- Object
Overview
TODO : Implement CDF methods
Defined in:
gsl/base/statistics.crConstructors
Class Method Summary
-
.sample(number : Int, p : Float64, n : UInt64) : Array(UInt64)
This function returns number random integers from the binomial distribution, the number of successes in n independent trials with probability p.
-
.sample(p : Float64, n : UInt64) : UInt64
This function returns a random integer from the binomial distribution, the number of successes in n independent trials with probability p.
Instance Method Summary
Instance methods inherited from class Statistics::DiscreteDistribution
sample : Int
sample
Constructor Detail
Class Method Detail
This function returns number random integers from the binomial distribution, the number of successes in n independent trials with probability p.
Binomial.sample(3, 0.5, 1) # => [1, 1, 0]
def self.sample(p : Float64, n : UInt64) : UInt64
#
This function returns a random integer from the binomial distribution, the number of successes in n independent trials with probability p.
Binomial.sample(0.5, 1) # => 1