[−][src]Trait rstat::Distribution
Trait for probability distributions with a well-defined CDF.
Associated Types
type Support: Space
Support of sample elements.
type Params
Parameter set uniquely defining the instance.
Required methods
fn support(&self) -> Self::Support
Returns an instance of the support Space
, Self::Support
.
fn params(&self) -> Self::Params
Returns an instance of Self::Params
matching the parameters of self
.
fn cdf(&self, x: &Sample<Self>) -> Probability
Evaluates the cumulative distribution function (CDF) at \(x\).
The CDF is defined as the probability that a random variable \(X\) takes on a value less than or equal to \(x\), i.e. \(F(x) = P(X \leq x)\).
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Sample<Self>
Draw a random value from the distribution support.
Provided methods
fn into_support(self) -> Self::Support
fn into_params(self) -> Self::Params
fn ccdf(&self, x: &Sample<Self>) -> Probability
Evaluates the complementary CDF at \(x\).
The complementary CDF (also known as the survival function) is defined as the probability that a random variable \(X\) takes on a value strictly greater than \(x\), i.e. \(\bar{F}(x) = P(X > x) = 1 - F(x)\).
fn log_cdf(&self, x: &Sample<Self>) -> f64
Evaluates the log CDF at \(x\), i.e. \(\ln{F(x)}\).
fn log_ccdf(&self, x: &Sample<Self>) -> f64
Evaluates the log complementary CDF at \(x\), i.e. \(\ln{(1 - F(x))}\).
fn sample_n<R: Rng + ?Sized>(&self, rng: &mut R, n: usize) -> Vec<Sample<Self>>
Draw n random value from the distribution support.
fn sample_iter<'a, R: Rng + ?Sized>(
&'a self,
rng: &'a mut R
) -> Sampler<'a, Self, R>
&'a self,
rng: &'a mut R
) -> Sampler<'a, Self, R>
Draw an indefinite number of random values from the distribution support.
Implementors
impl Distribution for Dirichlet
[src]
type Support = ProductSpace<Interval>
type Params = Concentrations
fn support(&self) -> ProductSpace<Interval>
[src]
fn params(&self) -> Concentrations
[src]
fn cdf(&self, _: &Vec<f64>) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Vec<f64>
[src]
impl Distribution for Multinomial
[src]
type Support = ProductSpace<Ordinal>
type Params = Params
fn support(&self) -> ProductSpace<Ordinal>
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, _: &Vec<usize>) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> Vec<usize>
[src]
impl Distribution for Arcsine
[src]
type Support = Interval
type Params = Params
fn support(&self) -> Interval
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> f64
[src]
impl Distribution for Bernoulli
[src]
type Support = Binary
type Params = Probability
fn support(&self) -> Binary
[src]
fn params(&self) -> Probability
[src]
fn cdf(&self, k: &bool) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> bool
[src]
impl Distribution for Beta
[src]
type Support = Interval
type Params = Params
fn support(&self) -> Interval
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for BetaBinomial
[src]
type Support = Ordinal
type Params = Params
fn support(&self) -> Ordinal
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, k: &usize) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> usize
[src]
impl Distribution for BetaPrime
[src]
type Support = PositiveReals
type Params = Params
fn support(&self) -> PositiveReals
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> f64
[src]
impl Distribution for Binomial
[src]
type Support = Ordinal
type Params = Params
fn support(&self) -> Ordinal
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, k: &usize) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> usize
[src]
impl Distribution for Categorical
[src]
type Support = Ordinal
type Params = SimplexVector
fn support(&self) -> Ordinal
[src]
fn params(&self) -> SimplexVector
[src]
fn cdf(&self, x: &usize) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> usize
[src]
impl Distribution for Cauchy
[src]
type Support = Reals
type Params = Params
fn support(&self) -> Reals
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for Chi
[src]
type Support = PositiveReals
type Params = DOF<usize>
fn support(&self) -> PositiveReals
[src]
fn params(&self) -> DOF<usize>
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> f64
[src]
impl Distribution for ChiSq
[src]
type Support = PositiveReals
type Params = DOF<usize>
fn support(&self) -> PositiveReals
[src]
fn params(&self) -> DOF<usize>
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for Cosine
[src]
type Support = Interval
type Params = Params
fn support(&self) -> Interval
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> f64
[src]
impl Distribution for Degenerate<f64>
[src]
type Support = Reals
type Params = Loc<f64>
fn support(&self) -> Reals
[src]
fn params(&self) -> Loc<f64>
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> f64
[src]
impl Distribution for Degenerate<i64>
[src]
type Support = Integers
type Params = Loc<i64>
fn support(&self) -> Integers
[src]
fn params(&self) -> Loc<i64>
[src]
fn cdf(&self, x: &i64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> i64
[src]
impl Distribution for Erlang
[src]
type Support = PositiveReals
type Params = Params
fn support(&self) -> PositiveReals
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> f64
[src]
impl Distribution for Exponential
[src]
type Support = PositiveReals
type Params = Rate<f64>
fn support(&self) -> PositiveReals
[src]
fn params(&self) -> Rate<f64>
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for FDist
[src]
type Support = PositiveReals
type Params = Params
fn support(&self) -> PositiveReals
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for FoldedNormal
[src]
type Support = NonNegativeReals
type Params = Params
fn support(&self) -> NonNegativeReals
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for Frechet
[src]
type Support = Interval
type Params = Shape<f64>
fn support(&self) -> Interval
[src]
fn params(&self) -> Shape<f64>
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for Gamma
[src]
type Support = PositiveReals
type Params = Params
fn support(&self) -> PositiveReals
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for Geometric
[src]
type Support = NonNegativeIntegers
type Params = Probability
fn support(&self) -> NonNegativeIntegers
[src]
fn params(&self) -> Probability
[src]
fn cdf(&self, k: &u64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> u64
[src]
impl Distribution for GeneralisedExtremeValue
[src]
type Support = Interval
type Params = Params
fn support(&self) -> Interval
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> f64
[src]
impl Distribution for GeneralisedPareto
[src]
type Support = Interval
type Params = Params
fn support(&self) -> Interval
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> f64
[src]
impl Distribution for Gumbel
[src]
type Support = Reals
type Params = Params
fn support(&self) -> Reals
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> f64
[src]
impl Distribution for InvGamma
[src]
type Support = PositiveReals
type Params = Params
fn support(&self) -> PositiveReals
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> f64
[src]
impl Distribution for InvNormal
[src]
type Support = PositiveReals
type Params = Params
fn support(&self) -> PositiveReals
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for Kumaraswamy
[src]
type Support = Interval
type Params = Params
fn support(&self) -> Interval
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for Laplace
[src]
type Support = Reals
type Params = Params
fn support(&self) -> Reals
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for Levy
[src]
type Support = Interval
type Params = Params
fn support(&self) -> Interval
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> f64
[src]
impl Distribution for Logistic
[src]
type Support = Reals
type Params = Params
fn support(&self) -> Reals
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> f64
[src]
impl Distribution for rstat::univariate::lognormal::LogNormal
[src]
type Support = PositiveReals
type Params = Params
fn support(&self) -> PositiveReals
[src]
fn params(&self) -> Params
[src]
fn into_params(self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for Normal
[src]
type Support = Reals
type Params = Params
fn support(&self) -> Reals
[src]
fn params(&self) -> Self::Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for Pareto
[src]
type Support = Interval
type Params = Params
fn support(&self) -> Interval
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for Poisson
[src]
type Support = Naturals
type Params = Rate<f64>
fn support(&self) -> Naturals
[src]
fn params(&self) -> Rate<f64>
[src]
fn cdf(&self, _: &u64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> u64
[src]
impl Distribution for Rayleigh
[src]
type Support = PositiveReals
type Params = Shape<f64>
fn support(&self) -> PositiveReals
[src]
fn params(&self) -> Shape<f64>
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, _: &mut R) -> f64
[src]
impl Distribution for StudentT
[src]
type Support = Reals
type Params = Loc<f64>
fn support(&self) -> Reals
[src]
fn params(&self) -> Loc<f64>
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for Triangular
[src]
type Support = Interval
type Params = Params
fn support(&self) -> Interval
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for Uniform<f64>
[src]
type Support = RealInterval
type Params = Params<f64>
fn support(&self) -> RealInterval
[src]
fn params(&self) -> Params<f64>
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for Uniform<i64>
[src]
type Support = DiscreteInterval
type Params = Params<i64>
fn support(&self) -> DiscreteInterval
[src]
fn params(&self) -> Params<i64>
[src]
fn cdf(&self, k: &i64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> i64
[src]
impl Distribution for Weibull
[src]
type Support = PositiveReals
type Params = Params
fn support(&self) -> PositiveReals
[src]
fn params(&self) -> Params
[src]
fn cdf(&self, x: &f64) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64
[src]
impl Distribution for DiagonalNormal
[src]
type Support = ProductSpace<Reals>
type Params = Params<Array1<f64>>
fn support(&self) -> ProductSpace<Reals>
[src]
fn params(&self) -> Self::Params
[src]
fn cdf(&self, _: &Vec<f64>) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Vec<f64>
[src]
impl Distribution for FullNormal
[src]
type Support = ProductSpace<Reals>
type Params = Params<Array2<f64>>
fn support(&self) -> ProductSpace<Reals>
[src]
fn params(&self) -> Self::Params
[src]
fn cdf(&self, _: &Vec<f64>) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Vec<f64>
[src]
impl Distribution for IsotropicNormal
[src]
type Support = ProductSpace<Reals>
type Params = Params<f64>
fn support(&self) -> ProductSpace<Reals>
[src]
fn params(&self) -> Self::Params
[src]
fn cdf(&self, _: &Vec<f64>) -> Probability
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Vec<f64>
[src]
impl<C: Distribution> Distribution for Mixture<C> where
C::Support: Union + Clone,
[src]
C::Support: Union + Clone,
type Support = C::Support
type Params = Params<C::Params>
fn support(&self) -> Self::Support
[src]
fn params(&self) -> Params<C::Params>
[src]
fn cdf(&self, x: &<Self::Support as Space>::Value) -> Probability
[src]
fn sample<R: Rng + ?Sized>(
&self,
rng: &mut R
) -> <Self::Support as Space>::Value
[src]
&self,
rng: &mut R
) -> <Self::Support as Space>::Value
impl<S> Distribution for rstat::multivariate::lognormal::LogNormal<S> where
Normal<S>: From<Params<S>> + Distribution<Support = ProductSpace<Reals>, Params = Params<S>>,
[src]
Normal<S>: From<Params<S>> + Distribution<Support = ProductSpace<Reals>, Params = Params<S>>,