[][src]Struct compute::distributions::Beta

pub struct Beta { /* fields omitted */ }

Implements the Beta distribution.

Implementations

impl Beta[src]

pub fn new(alpha: f64, beta: f64) -> Self[src]

Create a new Beta distribution with parameters alpha and beta.

Errors

Panics if alpha <= 0 or beta <= 0.

pub fn set_alpha(&mut self, alpha: f64) -> &mut Self[src]

pub fn set_beta(&mut self, beta: f64) -> &mut Self[src]

Trait Implementations

impl Clone for Beta[src]

impl Continuous for Beta[src]

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

Calculates the probability density function for the given Beta function at x.

Remarks

Returns 0. if x is not in [0, 1]

impl Copy for Beta[src]

impl Debug for Beta[src]

impl Default for Beta[src]

impl Distribution for Beta[src]

fn sample(&self) -> f64[src]

Samples from the given Beta distribution using the Gamma distribution.

impl Mean for Beta[src]

fn mean(&self) -> f64[src]

Returns the mean of the beta distribution, which for a B(a, b) distribution is given by a / (a + b).

impl Variance for Beta[src]

fn var(&self) -> f64[src]

Returns the variance of the beta distribution.

Auto Trait Implementations

impl RefUnwindSafe for Beta

impl Send for Beta

impl Sync for Beta

impl Unpin for Beta

impl UnwindSafe for Beta

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.