Struct rand_simple::LogNormal
source · pub struct LogNormal { /* private fields */ }Expand description
対数正規分布
使用例
let mut log_normal = rand_simple::LogNormal::new(1192u32, 765u32);
println!("平均値 μ = 0, 分散 σ^2 = 1 の標準対数正規分布乱数を生成する -> {}", log_normal.sample());
// 確率変数のパラメータを変更する場合
let mean: f64 = -3f64;
let variance: f64 = 2f64;
let result: Result<(f64, f64), &str> = log_normal.try_set_params(mean, variance);
println!("平均値 μ = {}, 分散 σ^2 = {} の正規分布乱数を生成する -> {}", mean, variance, log_normal.sample());Implementations§
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for LogNormal
impl Send for LogNormal
impl Sync for LogNormal
impl Unpin for LogNormal
impl UnwindSafe for LogNormal
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