class Statistics::Distributions::Bernoulli
- Statistics::Distributions::Bernoulli
- Statistics::Distributions::DiscreteDistribution(Int32)
- Statistics::Distributions::Distribution(Int32)
- Reference
- Object
Overview
The discrete probability distribution of a random variable which takes
the value 1 with probability p
and the value 0 with probability
q=1-p
(source: wikipedia).
Defined in:
lib/distributions.crConstructors
-
.new(p : Float64)
Creates Bernoulli distribution with success rate
p
.
Instance Method Summary
-
#pmf(x)
The Probability Mass Function (PMF) of a discrete random variable.
-
#rand : Int32
Samples a random variable with the given distribution.
Instance methods inherited from class Statistics::Distributions::DiscreteDistribution(Int32)
pmf(x)
pmf
Instance methods inherited from class Statistics::Distributions::Distribution(Int32)
rand : T
rand
Constructor Detail
Instance Method Detail
def pmf(x)
#
Description copied from class Statistics::Distributions::DiscreteDistribution(Int32)
The Probability Mass Function (PMF) of a discrete random variable.
def rand : Int32
#
Description copied from class Statistics::Distributions::Distribution(Int32)
Samples a random variable with the given distribution.