pub struct Beta { /* private fields */ }Expand description
Β distribution with shape parameters a > 0 and b > 0.
Defined over the interval [0 . . 1], with density f(x; a, b) = xᵃ ⁻ ¹ (1 − x)ᵇ ⁻ ¹ / Β(a, b).
§Example
use cdflib::Beta;
use cdflib::traits::ContinuousCdf;
let b = Beta::new(2.0, 5.0);
// Pr[X ≤ 0.3]
let p = b.cdf(0.3);
// Compute parameter a given Pr[X ≤ 0.5] = 0.9 and b = 2.0
let a = Beta::search_a(0.9, 0.1, 0.5, 2.0).unwrap();Implementations§
Source§impl Beta
impl Beta
Sourcepub fn try_new(a: f64, b: f64) -> Result<Self, BetaError>
pub fn try_new(a: f64, b: f64) -> Result<Self, BetaError>
Fallible counterpart of new returning a BetaError
instead of panicking.
Returns ANotPositive, ANotFinite, BNotPositive, or
BNotFinite if either parameter fails its validity check.
Trait Implementations§
Source§impl Continuous for Beta
impl Continuous for Beta
Source§impl ContinuousCdf for Beta
impl ContinuousCdf for Beta
impl Copy for Beta
impl StructuralPartialEq for Beta
Auto Trait Implementations§
impl Freeze for Beta
impl RefUnwindSafe for Beta
impl Send for Beta
impl Sync for Beta
impl Unpin for Beta
impl UnsafeUnpin for Beta
impl UnwindSafe for Beta
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