pub struct Beta<F>{ /* private fields */ }
Expand description
The Beta distribution Beta(α, β)
.
The Beta distribution is a continuous probability distribution
defined on the interval [0, 1]
. It is the conjugate prior for the
parameter p
of the Binomial
distribution.
It has two shape parameters α
(alpha) and β
(beta) which control
the shape of the distribution. Both a
and β
must be greater than zero.
The distribution is symmetric when α = β
.
§Plot
The plot shows the Beta distribution with various combinations
of α
and β
.
§Example
use rand_distr::{Distribution, Beta};
let beta = Beta::new(2.0, 5.0).unwrap();
let v = beta.sample(&mut rand::rng());
println!("{} is from a Beta(2, 5) distribution", v);
Implementations§
Trait Implementations§
Source§impl<'de, F> Deserialize<'de> for Beta<F>
impl<'de, F> Deserialize<'de> for Beta<F>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<F> Distribution<F> for Beta<F>
impl<F> Distribution<F> for Beta<F>
impl<F> Copy for Beta<F>
impl<F> StructuralPartialEq for Beta<F>
Auto Trait Implementations§
impl<F> Freeze for Beta<F>where
F: Freeze,
impl<F> RefUnwindSafe for Beta<F>where
F: RefUnwindSafe,
impl<F> Send for Beta<F>where
F: Send,
impl<F> Sync for Beta<F>where
F: Sync,
impl<F> Unpin for Beta<F>where
F: Unpin,
impl<F> UnwindSafe for Beta<F>where
F: UnwindSafe,
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