pub struct StudentsT { /* private fields */ }
Expand description
Student’s T distribution over x in (-∞, ∞).
Implementations§
source§impl StudentsT
impl StudentsT
sourcepub fn new(v: f64) -> Result<Self, StudentsTError>
pub fn new(v: f64) -> Result<Self, StudentsTError>
Create a new Student’s T distribtuion with degrees of freedom, v.
sourcepub fn new_unchecked(v: f64) -> Self
pub fn new_unchecked(v: f64) -> Self
Creates a new StudentsT without checking whether the parameter is valid.
sourcepub fn set_v(&mut self, v: f64) -> Result<(), StudentsTError>
pub fn set_v(&mut self, v: f64) -> Result<(), StudentsTError>
Set the value of v
§Example
use rv::dist::StudentsT;
let mut t = StudentsT::new(1.2).unwrap();
assert_eq!(t.v(), 1.2);
t.set_v(4.3).unwrap();
assert_eq!(t.v(), 4.3);
Will error for invalid values
assert!(t.set_v(2.1).is_ok());
// must be greater than zero
assert!(t.set_v(0.0).is_err());
assert!(t.set_v(-1.0).is_err());
assert!(t.set_v(std::f64::INFINITY).is_err());
assert!(t.set_v(std::f64::NEG_INFINITY).is_err());
assert!(t.set_v(std::f64::NAN).is_err());
sourcepub fn set_v_unchecked(&mut self, v: f64)
pub fn set_v_unchecked(&mut self, v: f64)
Set the value of v without input validation
Trait Implementations§
source§impl ContinuousDistr<f32> for StudentsT
impl ContinuousDistr<f32> for StudentsT
source§impl ContinuousDistr<f64> for StudentsT
impl ContinuousDistr<f64> for StudentsT
source§impl<'de> Deserialize<'de> for StudentsT
impl<'de> Deserialize<'de> for StudentsT
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 PartialEq for StudentsT
impl PartialEq for StudentsT
source§impl Rv<f32> for StudentsT
impl Rv<f32> for StudentsT
source§impl Rv<f64> for StudentsT
impl Rv<f64> for StudentsT
impl StructuralPartialEq for StudentsT
Auto Trait Implementations§
impl Freeze for StudentsT
impl RefUnwindSafe for StudentsT
impl Send for StudentsT
impl Sync for StudentsT
impl Unpin for StudentsT
impl UnwindSafe for StudentsT
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
source§impl<Fx> Rv<Datum> for Fxwhere
Fx: RvDatum,
impl<Fx> Rv<Datum> for Fxwhere
Fx: RvDatum,
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.