Struct rand_simple::Laplace
source · pub struct Laplace { /* private fields */ }Expand description
ラプラス分布
使用例
let mut laplace = rand_simple::Laplace::new(1192u32);
println!("位置母数 μ = 0, 尺度母数 θ = 1 の標準ラプラス分布に従う乱数を生成する -> {}", laplace.sample());
// 確率変数のパラメータを変更する場合
let location: f64 = -2f64;
let scale: f64 = 1.5f64;
let result: Result<(f64, f64), &str> = laplace.try_set_params(location, scale);
println!("位置母数 μ = {}, 尺度母数 θ = {} のラプラス分布に従う乱数を生成する -> {}", location, scale, laplace.sample());Implementations§
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Laplace
impl Send for Laplace
impl Sync for Laplace
impl Unpin for Laplace
impl UnwindSafe for Laplace
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