Module peroxide::statistics::rand

source ·
Expand description

Random number generator

§Uniform random number generator

  • Peroxide uses external rand crate to generate random number

    use rand::prelude::*;
    
    fn main() {
        let mut rng = thread_rng();
    
        let a = rng.gen_range(0f64..=1f64); // Generate random f64 number ranges from 0 to 1
    }
  • To want more detailed explanation, see rand crate

§Piece-wise Rejection Sampling

Functions§