Computes the bernoulli probability mass function (PMF).
value to evaluate PMF
true probability
import mir.math.common: approxEqual; assert(true.bernoulliPMF(0.5) == 0.5); assert(false.bernoulliPMF(0.5) == 0.5); assert(true.bernoulliPMF(0.7).approxEqual(0.7)); assert(false.bernoulliPMF(0.7).approxEqual(0.3));
Bernoulli Distribution
See Implementation
Computes the bernoulli probability mass function (PMF).