pub struct Triangular {
pub lo: Ex,
pub hi: Ex,
pub mode: Ex,
}Expand description
Triangular(a, b, c): density rising linearly from 0 at a to
2/(b−a) at the mode c and falling linearly to 0 at b, on
[a, b] with a ≤ c ≤ b.
Fields§
§lo: ExLower end a.
hi: ExUpper end b > a.
mode: ExMode c ∈ [a, b].
Trait Implementations§
Source§impl Clone for Triangular
impl Clone for Triangular
Source§impl Debug for Triangular
impl Debug for Triangular
Source§impl Family for Triangular
impl Family for Triangular
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₂, …).Source§impl PartialEq for Triangular
impl PartialEq for Triangular
impl StructuralPartialEq for Triangular
Auto Trait Implementations§
impl !RefUnwindSafe for Triangular
impl !UnwindSafe for Triangular
impl Freeze for Triangular
impl Send for Triangular
impl Sync for Triangular
impl Unpin for Triangular
impl UnsafeUnpin for Triangular
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