.DESLib.RandomLib.Variates.Discrete.Binomial

Information

Binomial

Binomial probability distribution.

Syntax

Binomial(g,t,b)

Description

Generates a random variate following a Binomial(t,p) probability distribution. This distribution is the sum of t random variables from the Bernoulli(b) distribution.

The pseudo-code algorithm used for this distribution is:

1. Generate y[1],...,y[t] as IID Bernoulli(p).
2. Return x = y[1]+...+y[t]

Examples

(u,g) := Binomial(g,4,0.3);

Interface

function Binomial
  extends Var;
end Binomial;

Generated at 2024-11-24T19:25:44Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos