[][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> Continuous<T> for Gamma<T> where
    T: Real + Gamma
[src]

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);

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);

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

Quantile function of inverse cdf

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

Expected value

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();

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

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

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

fn entropy(&self) -> T[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> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<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<V, T> VZip<V> for T where
    V: MultiLane<T>,