Skip to main content

beta_sample

Function beta_sample 

Source
pub fn beta_sample(a: f64, b: f64, n: usize, rng: &mut Rng) -> Vec<f64>
Expand description

Sample n values from Beta(a, b) using the gamma ratio method.

X ~ Gamma(a, 1), Y ~ Gamma(b, 1), then X / (X + Y) ~ Beta(a, b).