Struct rand_simple::Gamma
source · pub struct Gamma { /* private fields */ }Expand description
ガンマ分布
使用例
let mut gamma = rand_simple::Gamma::new([1192u32, 765u32, 1543u32]);
println!("形状母数 α = 1, 尺度母数 β = 1 の標準ガンマ分布に従う乱数を生成する -> {}", gamma.sample());
// 確率変数のパラメータを変更する場合
let shape: f64 = 2f64;
let scale: f64 = 1.5f64;
let result: Result<(f64, f64), &str> = gamma.try_set_params(shape, scale);
println!("形状母数 α = {}, 尺度母数 β = {} のガンマ分布に従う乱数を生成する -> {}", shape, scale, gamma.sample());Implementations§
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Gamma
impl Send for Gamma
impl Sync for Gamma
impl Unpin for Gamma
impl UnwindSafe for Gamma
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