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 distribution 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(f64::INFINITY).is_err());
assert!(t.set_v(f64::NEG_INFINITY).is_err());
assert!(t.set_v(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 HasDensity<f32> for StudentsT
impl HasDensity<f32> for StudentsT
source§impl HasDensity<f64> for StudentsT
impl HasDensity<f64> for StudentsT
source§impl Parameterized for StudentsT
impl Parameterized for StudentsT
type Parameters = f64
fn emit_params(&self) -> Self::Parameters
fn from_params(v: Self::Parameters) -> Self
source§impl PartialEq for StudentsT
impl PartialEq for StudentsT
source§impl Sampleable<f32> for StudentsT
impl Sampleable<f32> for StudentsT
source§impl Sampleable<f64> for StudentsT
impl Sampleable<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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§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.