Struct rv::dist::Bernoulli[][src]

pub struct Bernoulli {
    pub p: f64,
}

Bernoulli distribution with success probability p

Examples

use rv::prelude::*;

let b = Bernoulli::new(0.75).unwrap();
assert!((b.pmf(&true) - 0.75).abs() < 1E-12);

Fields

Probability of a success (x=1)

Methods

impl Bernoulli
[src]

A Bernoulli distribution with a 50% chance of success

The complement of p, i.e. (1 - p).

Trait Implementations

impl Debug for Bernoulli
[src]

Formats the value using the given formatter. Read more

impl Clone for Bernoulli
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for Bernoulli
[src]

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

impl KlDivergence for Bernoulli
[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 Entropy for Bernoulli
[src]

The entropy, H(X)

impl Skewness for Bernoulli
[src]

impl Kurtosis for Bernoulli
[src]

impl Mean<f64> for Bernoulli
[src]

Returns None if the mean is undefined

impl Median<f64> for Bernoulli
[src]

Returns None if the median is undefined

impl Variance<f64> for Bernoulli
[src]

Returns None if the variance is undefined

impl Rv<bool> for Bernoulli
[src]

Un-normalized probability function Read more

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

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

impl Support<bool> for Bernoulli
[src]

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

impl DiscreteDistr<bool> for Bernoulli
[src]

Probability mass function (PMF) at x Read more

Natural logarithm of the probability mass function (PMF) Read more

impl Cdf<bool> for Bernoulli
[src]

The value of the Cumulative Density Function at x Read more

Survival function, 1 - CDF(x)

impl Mode<bool> for Bernoulli
[src]

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

impl HasSuffStat<bool> for Bernoulli
[src]

impl Rv<u8> for Bernoulli
[src]

Un-normalized probability function Read more

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

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

impl Support<u8> for Bernoulli
[src]

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

impl DiscreteDistr<u8> for Bernoulli
[src]

Probability mass function (PMF) at x Read more

Natural logarithm of the probability mass function (PMF) Read more

impl Cdf<u8> for Bernoulli
[src]

The value of the Cumulative Density Function at x Read more

Survival function, 1 - CDF(x)

impl Mode<u8> for Bernoulli
[src]

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

impl HasSuffStat<u8> for Bernoulli
[src]

impl Rv<u16> for Bernoulli
[src]

Un-normalized probability function Read more

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

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

impl Support<u16> for Bernoulli
[src]

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

impl DiscreteDistr<u16> for Bernoulli
[src]

Probability mass function (PMF) at x Read more

Natural logarithm of the probability mass function (PMF) Read more

impl Cdf<u16> for Bernoulli
[src]

The value of the Cumulative Density Function at x Read more

Survival function, 1 - CDF(x)

impl Mode<u16> for Bernoulli
[src]

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

impl HasSuffStat<u16> for Bernoulli
[src]

impl Rv<u32> for Bernoulli
[src]

Un-normalized probability function Read more

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

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

impl Support<u32> for Bernoulli
[src]

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

impl DiscreteDistr<u32> for Bernoulli
[src]

Probability mass function (PMF) at x Read more

Natural logarithm of the probability mass function (PMF) Read more

impl Cdf<u32> for Bernoulli
[src]

The value of the Cumulative Density Function at x Read more

Survival function, 1 - CDF(x)

impl Mode<u32> for Bernoulli
[src]

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

impl HasSuffStat<u32> for Bernoulli
[src]

impl Rv<u64> for Bernoulli
[src]

Un-normalized probability function Read more

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

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

impl Support<u64> for Bernoulli
[src]

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

impl DiscreteDistr<u64> for Bernoulli
[src]

Probability mass function (PMF) at x Read more

Natural logarithm of the probability mass function (PMF) Read more

impl Cdf<u64> for Bernoulli
[src]

The value of the Cumulative Density Function at x Read more

Survival function, 1 - CDF(x)

impl Mode<u64> for Bernoulli
[src]

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

impl HasSuffStat<u64> for Bernoulli
[src]

impl Rv<usize> for Bernoulli
[src]

Un-normalized probability function Read more

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

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

impl Support<usize> for Bernoulli
[src]

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

impl DiscreteDistr<usize> for Bernoulli
[src]

Probability mass function (PMF) at x Read more

Natural logarithm of the probability mass function (PMF) Read more

impl Cdf<usize> for Bernoulli
[src]

The value of the Cumulative Density Function at x Read more

Survival function, 1 - CDF(x)

impl Mode<usize> for Bernoulli
[src]

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

impl HasSuffStat<usize> for Bernoulli
[src]

impl Rv<i8> for Bernoulli
[src]

Un-normalized probability function Read more

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

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

impl Support<i8> for Bernoulli
[src]

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

impl DiscreteDistr<i8> for Bernoulli
[src]

Probability mass function (PMF) at x Read more

Natural logarithm of the probability mass function (PMF) Read more

impl Cdf<i8> for Bernoulli
[src]

The value of the Cumulative Density Function at x Read more

Survival function, 1 - CDF(x)

impl Mode<i8> for Bernoulli
[src]

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

impl HasSuffStat<i8> for Bernoulli
[src]

impl Rv<i16> for Bernoulli
[src]

Un-normalized probability function Read more

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

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

impl Support<i16> for Bernoulli
[src]

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

impl DiscreteDistr<i16> for Bernoulli
[src]

Probability mass function (PMF) at x Read more

Natural logarithm of the probability mass function (PMF) Read more

impl Cdf<i16> for Bernoulli
[src]

The value of the Cumulative Density Function at x Read more

Survival function, 1 - CDF(x)

impl Mode<i16> for Bernoulli
[src]

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

impl HasSuffStat<i16> for Bernoulli
[src]

impl Rv<i32> for Bernoulli
[src]

Un-normalized probability function Read more

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

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

impl Support<i32> for Bernoulli
[src]

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

impl DiscreteDistr<i32> for Bernoulli
[src]

Probability mass function (PMF) at x Read more

Natural logarithm of the probability mass function (PMF) Read more

impl Cdf<i32> for Bernoulli
[src]

The value of the Cumulative Density Function at x Read more

Survival function, 1 - CDF(x)

impl Mode<i32> for Bernoulli
[src]

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

impl HasSuffStat<i32> for Bernoulli
[src]

impl Rv<i64> for Bernoulli
[src]

Un-normalized probability function Read more

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

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

impl Support<i64> for Bernoulli
[src]

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

impl DiscreteDistr<i64> for Bernoulli
[src]

Probability mass function (PMF) at x Read more

Natural logarithm of the probability mass function (PMF) Read more

impl Cdf<i64> for Bernoulli
[src]

The value of the Cumulative Density Function at x Read more

Survival function, 1 - CDF(x)

impl Mode<i64> for Bernoulli
[src]

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

impl HasSuffStat<i64> for Bernoulli
[src]

impl Rv<isize> for Bernoulli
[src]

Un-normalized probability function Read more

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

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

impl Support<isize> for Bernoulli
[src]

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

impl DiscreteDistr<isize> for Bernoulli
[src]

Probability mass function (PMF) at x Read more

Natural logarithm of the probability mass function (PMF) Read more

impl Cdf<isize> for Bernoulli
[src]

The value of the Cumulative Density Function at x Read more

Survival function, 1 - CDF(x)

impl Mode<isize> for Bernoulli
[src]

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

impl HasSuffStat<isize> for Bernoulli
[src]

impl Rv<Bernoulli> for Beta
[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<Bernoulli> for Beta
[src]

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

impl ContinuousDistr<Bernoulli> for Beta
[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<bool, Bernoulli> for Beta
[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 Bernoulli

impl Sync for Bernoulli