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

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

Chi-Squared distribution

Fore more information: https://en.wikipedia.org/wiki/Chi-squared_distribution

Implementations

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

pub fn new(df: u32) -> ChiSquared<T>[src]

Creates a probability distribution

Arguments

  • df: Degree of freedom, df >= 1

Panics

if df < 1

Example

use mathru::statistics::distrib::ChiSquared;

let distrib: ChiSquared<f64> = ChiSquared::new(3);

Trait Implementations

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

impl<T> Continuous<T> for ChiSquared<T> where
    T: Real + Gamma + Error
[src]

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

Probability density function

Arguments

  • x Random variable x ∈ &#x2115

Example

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

let distrib: ChiSquared<f64> = ChiSquared::new(2);
let x: f64 = 5.0;
let p: f64 = distrib.pdf(x);

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

Cumulative distribution function

Arguments

  • x Random variable

Example

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

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

pub fn quantile(&self, p: T) -> T[src]

Quantile function of inverse cdf

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

Expected value

Example

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

let distrib: ChiSquared<f64> = ChiSquared::new(2);
let mean: f64 = distrib.mean();

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

Variance

Example

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

let distrib: ChiSquared<f64> = ChiSquared::new(2);
let var: f64 = distrib.variance();

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

Skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean

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

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

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

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

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

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

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

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for ChiSquared<T> where
    T: 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>,