[−][src]Struct compute::distributions::Beta
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.
fn update(&mut self, params: &[f64])
[src]
fn sample_iter(&self, n: usize) -> Vec<f64>
[src]
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]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,