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

pub struct T<K> { /* fields omitted */ }

T distribution

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

Implementations

impl<K> T<K> where
    K: Real
[src]

pub fn new(n: K) -> T<K>[src]

Create a probability distribution

Arguments

  • n: > 0.0

Panics

if n <= 0.0

Example

use mathru::statistics::distrib::{Continuous, T};

let distrib: T<f64> = T::new(1.2);

Trait Implementations

impl<K: Clone> Clone for T<K>[src]

impl<K> Continuous<K> for T<K> where
    K: Real + Beta + Hypergeometric + Gamma
[src]

pub fn pdf(&self, x: K) -> K[src]

Probability density function

Arguments

  • x Random variable x &isin ࡃ

Example

use mathru::statistics::distrib::{Continuous, T};

let distrib: T<f64> = T::new(2.0);
let x: f64 = 0.5;
let p: f64 = distrib.pdf(x);

pub fn cdf(&self, x: K) -> K[src]

Cumulative distribution function

Arguments

  • x Random variable

Example

use mathru::statistics::distrib::{Continuous, T};

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

pub fn quantile(&self, _p: K) -> K[src]

Quantile function of inverse cdf

pub fn mean(&self) -> K[src]

Expected value

Panics

if self.n <= 1.0

Example

use mathru::statistics::distrib::{Continuous, T};

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

pub fn variance(&self) -> K[src]

Variance

Example

use mathru::statistics::distrib::{Continuous, T};

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

pub fn skewness(&self) -> K[src]

Panics

if self.n <= 3

pub fn median(&self) -> K[src]

Median is the value separating the higher half from the lower half of a probability distribution.

pub fn entropy(&self) -> K[src]

impl<K: Copy> Copy for T<K>[src]

impl<K: Debug> Debug for T<K>[src]

impl<'de, K> Deserialize<'de> for T<K> where
    K: Deserialize<'de>, 
[src]

impl<K> Serialize for T<K> where
    K: Serialize
[src]

Auto Trait Implementations

impl<K> RefUnwindSafe for T<K> where
    K: RefUnwindSafe

impl<K> Send for T<K> where
    K: Send

impl<K> Sync for T<K> where
    K: Sync

impl<K> Unpin for T<K> where
    K: Unpin

impl<K> UnwindSafe for T<K> where
    K: UnwindSafe

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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>,