Skip to main content

FDist

Struct FDist 

Source
pub struct FDist {
    pub nu1: f64,
    pub nu2: f64,
}
Expand description

Struct for the F distribution X ~ F(nu1, nu2).

§Parameters

  • nu1 > 0
  • nu2 > 0

§Support

  • x > 0

§Example

Suppose X ~ F(nu1=4.0, nu2=18.0). Use.

use ruststat::FDist;
let mut myf = FDist{nu1:4.0, nu2:18.0};
println!("Probability density function f(2.5): {}", myf.pdf(2.5));
println!("Cumulative distribution function P(X<=2.5): {}", myf.cdf(2.5));
println!("99th percentile: {}", myf.per(0.99));
println!("Random draw: {}", myf.ran());
println!("Random vector: {:?}", myf.ranvec(5));
println!("Mean: {}", myf.mean());
println!("Variance: {}", myf.var());
println!("Standard deviation: {}", myf.sd());

Fields§

§nu1: f64§nu2: f64

Implementations§

Source§

impl FDist

Source

pub fn pdf(&mut self, x: f64) -> f64

Source

pub fn cdf(&mut self, x: f64) -> f64

Source

pub fn per(&mut self, x: f64) -> f64

Source

pub fn ran(&mut self) -> f64

Source

pub fn ranvec(&mut self, n: u64) -> Vec<f64>

Source

pub fn mean(&mut self) -> f64

Source

pub fn var(&mut self) -> f64

Source

pub fn sd(&mut self) -> f64

Auto Trait Implementations§

§

impl Freeze for FDist

§

impl RefUnwindSafe for FDist

§

impl Send for FDist

§

impl Sync for FDist

§

impl Unpin for FDist

§

impl UnsafeUnpin for FDist

§

impl UnwindSafe for FDist

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.