geo2_ran

Function geo2_ran 

Source
pub fn geo2_ran(p: f64) -> i32
Expand description

Random draw from X ~ Geo(p) distribution where X = the trial on which the first success is observed.

§Parameters

  • p = probability of success (0 < p <= 1)

§Example

Suppose X ~ Geo(p=0.6). Use

use ruststat::geo2_ran;
println!("Random draw: {}", geo2_ran(0.6));