Struct rv::dist::StudentsT[][src]

pub struct StudentsT { /* fields omitted */ }

Student’s T distribution over x in (-∞, ∞).

Implementations

impl StudentsT[src]

pub fn new(v: f64) -> Result<Self, StudentsTError>[src]

Create a new Student’s T distribtuion with degrees of freedom, v.

pub fn new_unchecked(v: f64) -> Self[src]

Creates a new StudentsT without checking whether the parameter is valid.

pub fn v(&self) -> f64[src]

Get the degrees of freedom, v

pub fn set_v(&mut self, v: f64) -> Result<(), StudentsTError>[src]

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());

pub fn set_v_unchecked(&mut self, v: f64)[src]

Set the value of v without input validation

Trait Implementations

impl Clone for StudentsT[src]

impl ContinuousDistr<f32> for StudentsT[src]

impl ContinuousDistr<f64> for StudentsT[src]

impl Debug for StudentsT[src]

impl Default for StudentsT[src]

impl Display for StudentsT[src]

impl Kurtosis for StudentsT[src]

impl Mean<f32> for StudentsT[src]

impl Mean<f64> for StudentsT[src]

impl Median<f32> for StudentsT[src]

impl Median<f64> for StudentsT[src]

impl Mode<f32> for StudentsT[src]

impl Mode<f64> for StudentsT[src]

impl PartialEq<StudentsT> for StudentsT[src]

impl Rv<f32> for StudentsT[src]

impl Rv<f64> for StudentsT[src]

impl Skewness for StudentsT[src]

impl StructuralPartialEq for StudentsT[src]

impl Support<f32> for StudentsT[src]

impl Support<f64> for StudentsT[src]

impl Variance<f32> for StudentsT[src]

impl Variance<f64> for StudentsT[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,