[][src]Struct mathru::stats::distrib::T

pub struct T { /* fields omitted */ }

T distribution

Fore more information: https://en.wikipedia.org/wiki/T_distribution

Methods

impl T[src]

pub fn new(n: &f64) -> T[src]

Create a probability distribution

Arguments

  • n: > 0.0

Panics

if n <= 0.0

Example

extern crate mathru;
use mathru::stats::distrib::{Continuous, T};

let distrib: T = T::new(&1.2);

Trait Implementations

impl Continuous<f64, f64> for T[src]

fn pdf<'a>(&'a self, x: f64) -> f64[src]

Probability density function

Arguments

  • x Random variable x &isin ࡃ

Example

extern crate mathru;
use mathru::stats::distrib::{Continuous, T};

let distrib: T = T::new(&1.2);
let x: f64 = 0.5;
let p: f64 = distrib.pdf(x);

fn cdf<'a>(&'a self, x: f64) -> f64[src]

Cumulative distribution function

Arguments

  • x Random variable

Example

extern crate mathru;
use mathru::stats::distrib::{Continuous, T};

let distrib: T = T::new(&1.3);
let x: f64 = 0.4;
let p: f64 = distrib.cdf(x);

fn quantile<'a, 'b>(&'a self, _p: f64) -> f64[src]

Quantile function of inverse cdf

fn mean<'a>(&'a self) -> f64[src]

Expected value

Panics

if self.n <= 1.0

Example

extern crate mathru;
use mathru::stats::distrib::{Continuous, T};

let distrib: T = T::new(&1.2);
let mean: f64 = distrib.mean();

fn variance<'a>(&'a self) -> f64[src]

Variance

Example

extern crate mathru;
use mathru::stats::distrib::{Continuous, T};

let distrib: T = T::new(&2.2);
let var: f64 = distrib.variance();

Auto Trait Implementations

impl Send for T

impl Sync for T

Blanket Implementations

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

impl<T> From<T> for T[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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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