pub struct Laplace {
pub mean: Ex,
pub scale: Ex,
}Expand description
Laplace(μ, b): density e^{−|x−μ|/b} / (2b) on ℝ.
Fields§
§mean: ExLocation μ (mean and median).
scale: ExScale b > 0.
Trait Implementations§
Source§impl Family for Laplace
impl Family for Laplace
Source§fn parameters(&self) -> Vec<(&'static str, Ex)>
fn parameters(&self) -> Vec<(&'static str, Ex)>
The parameters, named, in the family’s documented order.
Source§fn eq_family(&self, other: &dyn Family) -> bool
fn eq_family(&self, other: &dyn Family) -> bool
Structural equality with another family (see
same_family).Source§fn density(&self, x: &Ex) -> Ex
fn density(&self, x: &Ex) -> Ex
The density (continuous) or probability mass function (discrete) as
an expression in
x, valid on the support.Source§fn quantile(&self, p: &Ex) -> Option<Ex>
fn quantile(&self, p: &Ex) -> Option<Ex>
Closed-form quantile function (inverse CDF) at
p ∈ (0, 1).Source§fn entropy(&self) -> Option<Ex>
fn entropy(&self) -> Option<Ex>
Closed-form entropy (differential for a continuous family, Shannon
for a discrete one), in nats.
Source§fn probability_of(&self, _region: &Support) -> Option<Result<Ex, SymplexError>>
fn probability_of(&self, _region: &Support) -> Option<Result<Ex, SymplexError>>
P(X ∈ region) when the family can answer more directly than by
integrating its density over support ∩ region (a mixture sums its
components). None leaves it to the generic route.Source§fn expectation_over(
&self,
_g: &Ex,
_x: &Ex,
_region: &Support,
) -> Option<Result<Ex, SymplexError>>
fn expectation_over( &self, _g: &Ex, _x: &Ex, _region: &Support, ) -> Option<Result<Ex, SymplexError>>
E[g(X)·1_{X ∈ region}] for g in the symbol x, when the family
can answer directly. None leaves it to the generic route.Source§fn sampler(&self) -> Option<Result<Sampler, SymplexError>>
fn sampler(&self) -> Option<Result<Sampler, SymplexError>>
A sampler, when the family has a route of its own (a wrapper
transforms its inner family’s samples).
None leaves it to the
generic route: inverse transform through the quantile, or cumulative
sums of the mass function.Source§fn fmt_display(&self, f: &mut Formatter<'_>) -> Result
fn fmt_display(&self, f: &mut Formatter<'_>) -> Result
Name(p₁, p₂, …).impl StructuralPartialEq for Laplace
Auto Trait Implementations§
impl !RefUnwindSafe for Laplace
impl !UnwindSafe for Laplace
impl Freeze for Laplace
impl Send for Laplace
impl Sync for Laplace
impl Unpin for Laplace
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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