Struct rand_simple::Beta
source · pub struct Beta { /* private fields */ }Expand description
ベータ分布
使用例
let mut beta = rand_simple::Beta::new([1192u32, 765u32, 1543u32, 2003u32, 1867u32, 1688u32]);
println!("形状母数 α = 1, 形状母数 β = 1 の標準ベータ分布に従う乱数を生成する -> {}", beta.sample());
// 確率変数のパラメータを変更する場合
let shape_alpha: f64 = 2f64;
let shape_beta: f64 = 1.5f64;
let result: Result<(f64, f64), &str> = beta.try_set_params(shape_alpha, shape_beta);
println!("形状母数 α = {}, 形状母数 β = {} のベータ分布に従う乱数を生成する -> {}", shape_alpha, shape_beta, beta.sample());Implementations§
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Beta
impl Send for Beta
impl Sync for Beta
impl Unpin for Beta
impl UnwindSafe for Beta
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more