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