.DESLib.RandomLib.Variates.Discrete.Geometric

Information

Geometric

Geometric probability distribution function.

Syntax

Geometric(g,b)

Description

Generates a random variate following the Geometric probability distribution with probabitity b.

The pseudo-code algorithm used for this distribution is:

1. Set i = 0.
2. Generate u as U(0,1).
3. If u &le b, return i. Otherwise i=i+1 and go back to 2.

Examples


(u,g) := Geometric(g,0.5);

Interface

function Geometric
  extends Var;
end Geometric;

Generated at 2024-05-18T18:16:21Z by OpenModelicaOpenModelica 1.22.4 using GenerateDoc.mos