Struct Beta

Source
pub struct Beta(/* private fields */);

Implementations§

Source§

impl Beta

Source

pub fn new(alpha: f64, beta: f64) -> Result<Beta, Error>

Source

pub fn new_unchecked(alpha: f64, beta: f64) -> Beta

Trait Implementations§

Source§

impl Clone for Beta

Source§

fn clone(&self) -> Beta

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ContinuousDistribution for Beta

Source§

fn pdf(&self, x: &f64) -> f64

Evaluates the probability density function (PDF) at \(x\). Read more
Source§

fn log_pdf(&self, x: &Sample<Self>) -> f64

Evaluates the log PDF at \(x\).
Source§

impl Debug for Beta

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Beta

Source§

fn default() -> Beta

Returns the “default value” for a type. Read more
Source§

impl Display for Beta

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Distribution for Beta

Source§

type Support = Interval

Support of sample elements.
Source§

type Params = Params

Parameter set uniquely defining the instance.
Source§

fn support(&self) -> Interval

Returns an instance of the support Space, Self::Support. Read more
Source§

fn params(&self) -> Params

Returns an instance of the distribution parameters, Self::Params. Read more
Source§

fn cdf(&self, x: &f64) -> Probability

Evaluates the cumulative distribution function (CDF) at \(x\). Read more
Source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64

Draw a random value from the distribution support.
Source§

fn into_support(self) -> Self::Support

Converts self into an instance of Self::Support.
Source§

fn into_params(self) -> Self::Params

Converts self into an instance of Self::Params.
Source§

fn ccdf(&self, x: &Sample<Self>) -> Probability

Evaluates the complementary CDF at \(x\). Read more
Source§

fn log_cdf(&self, x: &Sample<Self>) -> f64

Evaluates the log CDF at \(x\), i.e. \(\ln{F(x)}\).
Source§

fn log_ccdf(&self, x: &Sample<Self>) -> f64

Evaluates the log complementary CDF at \(x\), i.e. \(\ln{(1 - F(x))}\).
Source§

fn sample_n<R: Rng + ?Sized>(&self, rng: &mut R, n: usize) -> Vec<Sample<Self>>

Draw n random value from the distribution support.
Source§

fn sample_iter<'a, R: Rng + ?Sized>( &'a self, rng: &'a mut R, ) -> Sampler<'a, Self, R>

Draw an indefinite number of random values from the distribution support.
Source§

impl From<Params> for Beta

Source§

fn from(from: Params) -> Beta

Converts to this type from the input type.
Source§

impl Likelihood for Beta

Source§

fn log_likelihood(&self, samples: &[f64]) -> f64

Computes the log-likelihood \(l(\theta \mid \bm{x})\).
Source§

fn likelihood(&self, samples: &[Sample<Self>]) -> f64

Computes the likelihood \(\mathcal{L}(\theta \mid \bm{x})\).
Source§

impl Modes for Beta

Source§

fn modes(&self) -> Vec<f64>

Computes the mode(s) of the distribution.
Source§

impl Quantiles for Beta

Source§

fn quantile(&self, _: Probability) -> f64

Evaluates the inverse cumulative distribution function (CDF) at p. Read more
Source§

fn median(&self) -> f64

Computes the median value of the distribution, Q(0.5). Read more
Source§

fn cquantile(&self, p: Probability) -> f64

Evaluates the complementary quantile function at x: Q(1 - p).
Source§

fn lower_quartile(&self) -> f64

Computes the lower quartile of the distribution, Q(0.25).
Source§

fn upper_quartile(&self) -> f64

Computes the upper quartile of the distribution, Q(0.75).
Source§

fn iqr(&self) -> f64

Computes the interquartile range (IQR) of the distribution, Q(0.75) - Q(0.25).
Source§

fn lower_fence(&self) -> f64

Computes the lower fence of the distribution, Q(0.25) - 1.5 · IQR. Read more
Source§

fn upper_fence(&self) -> f64

Computes the lower fence of the distribution, Q(0.75) + 1.5 · IQR. Read more
Source§

impl Score for Beta

Source§

type Grad = Grad

Source§

fn score(&self, samples: &[f64]) -> Grad

Computes the score function \(s(\theta) = \frac{\partial l(\theta \mid \bm{x})}{\partial \theta}\).
Source§

impl ShannonEntropy for Beta

Source§

fn shannon_entropy(&self) -> f64

Computes the Shannon entropy of the distribution, \(H(X)\).
Source§

impl UnivariateMoments for Beta

Source§

fn mean(&self) -> f64

Computes the expected value of the distribution.
Source§

fn variance(&self) -> f64

Computes the variance of the distribution.
Source§

fn skewness(&self) -> f64

Computes the skewness of the distribution.
Source§

fn excess_kurtosis(&self) -> f64

Computes the excess kurtosis of the distribution.
Source§

fn standard_deviation(&self) -> f64

Computes the standard deviation of the distribution.
Source§

fn kurtosis(&self) -> f64

Computes the kurtosis of the distribution.

Auto Trait Implementations§

§

impl Freeze for Beta

§

impl RefUnwindSafe for Beta

§

impl Send for Beta

§

impl Sync for Beta

§

impl Unpin for Beta

§

impl UnwindSafe for Beta

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V