Struct rv::dist::Gaussian[][src]

pub struct Gaussian {
    pub mu: f64,
    pub sigma: f64,
}

Gaussian / Normal distribution, N(μ, σ)

Examples

Compute the KL Divergence between two Gaussians.

use rv::prelude::*;

let gauss_1 = Gaussian::new(0.1, 2.3).unwrap();
let gauss_2 = Gaussian::standard();

// KL is not symmetric
let kl_12 = gauss_1.kl(&gauss_2);
let kl_21 = gauss_2.kl(&gauss_1);

// ... but kl_sym is because it's the sum of KL(P|Q) and KL(Q|P)
let kl_sym = gauss_1.kl_sym(&gauss_2);
assert!((kl_sym - (kl_12 + kl_21)).abs() < 1E-12);

Fields

Mean

Standard deviation

Methods

impl Gaussian
[src]

Standard normal

Trait Implementations

impl Debug for Gaussian
[src]

Formats the value using the given formatter. Read more

impl Clone for Gaussian
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for Gaussian
[src]

Returns the "default value" for a type. Read more

impl Variance<f64> for Gaussian
[src]

Returns None if the variance is undefined

impl Entropy for Gaussian
[src]

The entropy, H(X)

impl Skewness for Gaussian
[src]

impl Kurtosis for Gaussian
[src]

impl KlDivergence for Gaussian
[src]

The KL divergence, KL(P|Q) between this distribution, P, and another, Q Read more

Symmetrised divergence, KL(P|Q) + KL(Q|P) Read more

impl Rv<f32> for Gaussian
[src]

Un-normalized probability function Read more

The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

Single draw from the Rv Read more

Multiple draws of the Rv Read more

Un-normalized probability function Read more

The constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

impl ContinuousDistr<f32> for Gaussian
[src]

The value of the Probability Density Function (PDF) at x Read more

The value of the log Probability Density Function (PDF) at x Read more

impl Support<f32> for Gaussian
[src]

Returns true if x is in the support of the Rv Read more

impl Cdf<f32> for Gaussian
[src]

The value of the Cumulative Density Function at x Read more

Survival function, 1 - CDF(x)

impl InverseCdf<f32> for Gaussian
[src]

The value of the x at the given probability in the CDF Read more

Alias for invcdf

Interval containing p proportion for the probability Read more

impl Mean<f32> for Gaussian
[src]

Returns None if the mean is undefined

impl Median<f32> for Gaussian
[src]

Returns None if the median is undefined

impl Mode<f32> for Gaussian
[src]

Returns None if the mode is undefined or is not a single value

impl HasSuffStat<f32> for Gaussian
[src]

impl Rv<f64> for Gaussian
[src]

Un-normalized probability function Read more

The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

Single draw from the Rv Read more

Multiple draws of the Rv Read more

Un-normalized probability function Read more

The constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

impl ContinuousDistr<f64> for Gaussian
[src]

The value of the Probability Density Function (PDF) at x Read more

The value of the log Probability Density Function (PDF) at x Read more

impl Support<f64> for Gaussian
[src]

Returns true if x is in the support of the Rv Read more

impl Cdf<f64> for Gaussian
[src]

The value of the Cumulative Density Function at x Read more

Survival function, 1 - CDF(x)

impl InverseCdf<f64> for Gaussian
[src]

The value of the x at the given probability in the CDF Read more

Alias for invcdf

Interval containing p proportion for the probability Read more

impl Mean<f64> for Gaussian
[src]

Returns None if the mean is undefined

impl Median<f64> for Gaussian
[src]

Returns None if the median is undefined

impl Mode<f64> for Gaussian
[src]

Returns None if the mode is undefined or is not a single value

impl HasSuffStat<f64> for Gaussian
[src]

impl Rv<Gaussian> for NormalGamma
[src]

Un-normalized probability function Read more

The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

Single draw from the Rv Read more

Un-normalized probability function Read more

The constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

Multiple draws of the Rv Read more

impl Support<Gaussian> for NormalGamma
[src]

Returns true if x is in the support of the Rv Read more

impl ContinuousDistr<Gaussian> for NormalGamma
[src]

The value of the Probability Density Function (PDF) at x Read more

The value of the log Probability Density Function (PDF) at x Read more

impl ConjugatePrior<f64, Gaussian> for NormalGamma
[src]

Computes the posterior distribution from the data

Log marginal likelihood

Log posterior predictive of y given x

Marginal likelihood of x

Posterior Predictive distribution

Auto Trait Implementations

impl Send for Gaussian

impl Sync for Gaussian