pub enum Dist {
Normal {
mean: f64,
sigma: f64,
},
Uniform {
lo: f64,
hi: f64,
},
TruncNormal {
mean: f64,
sigma: f64,
cut: f64,
},
Fixed(f64),
End {
lo: f64,
hi: f64,
},
Disc {
center: f64,
radius: f64,
normal: Option<f64>,
},
}Expand description
分布(公称値からのずれ)。抽選(Draws)では、変数ごとに標準正規の値 z を引き(相関があれば混ぜてから)、
分布の逆関数で値にする(ガウスのコピュラ)。相関がなければ変数ごとに独立
Variants§
Normal
正規分布(平均 mean、標準偏差 sigma)
Uniform
一様分布 [lo, hi]
TruncNormal
平均 ± cut·sigma で切った正規分布(公差の ±値を cut σ と見るときなど)。逆関数法で引く
Fixed(f64)
定数(ずれを固定する。比べるときに)
End
lo か hi を半々(最悪側の組合せを見る)
Disc
円(楕円)の中の分布の 1 成分: 中心 center・半径 radius。Joint::Disc で 2 つを組にして、
組の (x, y) が円の中に入るように引く(偏心・傾きの大きさを公差以下にする)。normal が None なら円の中で一様、
Some(cut) なら半径が cut σ の等方の 2 次元正規分布を円で切ったもの。組にしないと使えない
Trait Implementations§
impl StructuralPartialEq for Dist
Auto Trait Implementations§
impl Freeze for Dist
impl RefUnwindSafe for Dist
impl Send for Dist
impl Sync for Dist
impl Unpin for Dist
impl UnsafeUnpin for Dist
impl UnwindSafe for Dist
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more