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

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

Gamma distribution

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

Implementations

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

pub fn new(alpha: T, beta: T) -> Gamma<T>[src]

Creates a probability distribution

Arguments

  • alpha > 0.0
  • beta > 0.0

Panics

if alpha <= 0.0 || beta <= 0.0

Example

use mathru::statistics::distrib::Gamma;

let distrib: Gamma<f64> = Gamma::new(0.3, 0.2);

Trait Implementations

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

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

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

Probability density function

Arguments

  • x Random variable x ∈ &#x2115 | x > 0.0

Panics

if x <= 0.0

Example

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

let distrib: Gamma<f64> = Gamma::new(0.3, 0.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::{Continuous, Gamma};

let distrib: Gamma<f64> = Gamma::new(0.3, 0.2);
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

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

Variance

Example

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

let distrib: Gamma<f64> = Gamma::new(0.2, 0.5);
let var: f64 = distrib.variance();

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

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 Gamma<T>[src]

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

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

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

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for Gamma<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>,