class Statistics::Binomial

Overview

TODO : Implement CDF methods

Defined in:

gsl/base/statistics.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Statistics::DiscreteDistribution

sample : Int sample

Constructor Detail

def self.new(p : Float64, n : UInt64) #

[View source]

Class Method Detail

def self.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.

Binomial.sample(3, 0.5, 1) # => [1, 1, 0]

[View source]
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

[View source]

Instance Method Detail

def sample : Int #

[View source]