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
p: f64
Probability of a success (x=1)
Methods
impl Bernoulli
[src]
impl Bernoulli
pub fn new(p: f64) -> Result<Self>
[src]
pub fn new(p: f64) -> Result<Self>
pub fn uniform() -> Self
[src]
pub fn uniform() -> Self
A Bernoulli distribution with a 50% chance of success
pub fn q(&self) -> f64
[src]
pub fn q(&self) -> f64
The complement of p
, i.e. (1 - p)
.
Trait Implementations
impl Debug for Bernoulli
[src]
impl Debug for Bernoulli
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Bernoulli
[src]
impl Clone for Bernoulli
fn clone(&self) -> Bernoulli
[src]
fn clone(&self) -> Bernoulli
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Default for Bernoulli
[src]
impl Default for Bernoulli
impl KlDivergence for Bernoulli
[src]
impl KlDivergence for Bernoulli
fn kl(&self, other: &Self) -> f64
[src]
fn kl(&self, other: &Self) -> f64
The KL divergence, KL(P|Q) between this distribution, P, and another, Q Read more
fn kl_sym(&self, other: &Self) -> f64
[src]
fn kl_sym(&self, other: &Self) -> f64
Symmetrised divergence, KL(P|Q) + KL(Q|P) Read more
impl Entropy for Bernoulli
[src]
impl Entropy for Bernoulli
impl Skewness for Bernoulli
[src]
impl Skewness for Bernoulli
impl Kurtosis for Bernoulli
[src]
impl Kurtosis for Bernoulli
impl Mean<f64> for Bernoulli
[src]
impl Mean<f64> for Bernoulli
impl Median<f64> for Bernoulli
[src]
impl Median<f64> for Bernoulli
impl Variance<f64> for Bernoulli
[src]
impl Variance<f64> for Bernoulli
impl Rv<bool> for Bernoulli
[src]
impl Rv<bool> for Bernoulli
fn f(&self, x: &bool) -> f64
[src]
fn f(&self, x: &bool) -> f64
Un-normalized probability function Read more
fn ln_f(&self, x: &bool) -> f64
[src]
fn ln_f(&self, x: &bool) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> bool
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> bool
Single draw from the Rv
Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<bool>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<bool>
Multiple draws of the Rv
Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
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]
impl Support<bool> for Bernoulli
impl DiscreteDistr<bool> for Bernoulli
[src]
impl DiscreteDistr<bool> for Bernoulli
fn pmf(&self, x: &bool) -> f64
[src]
fn pmf(&self, x: &bool) -> f64
Probability mass function (PMF) at x
Read more
fn ln_pmf(&self, x: &bool) -> f64
[src]
fn ln_pmf(&self, x: &bool) -> f64
Natural logarithm of the probability mass function (PMF) Read more
impl Cdf<bool> for Bernoulli
[src]
impl Cdf<bool> for Bernoulli
fn cdf(&self, x: &bool) -> f64
[src]
fn cdf(&self, x: &bool) -> f64
The value of the Cumulative Density Function at x
Read more
fn sf(&self, x: &X) -> f64
[src]
fn sf(&self, x: &X) -> f64
Survival function, 1 - CDF(x)
impl Mode<bool> for Bernoulli
[src]
impl Mode<bool> for Bernoulli
impl HasSuffStat<bool> for Bernoulli
[src]
impl HasSuffStat<bool> for Bernoulli
type Stat = BernoulliSuffStat
fn empty_suffstat(&self) -> Self::Stat
[src]
fn empty_suffstat(&self) -> Self::Stat
impl Rv<u8> for Bernoulli
[src]
impl Rv<u8> for Bernoulli
fn f(&self, x: &u8) -> f64
[src]
fn f(&self, x: &u8) -> f64
Un-normalized probability function Read more
fn ln_f(&self, x: &u8) -> f64
[src]
fn ln_f(&self, x: &u8) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> u8
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> u8
Single draw from the Rv
Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<u8>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<u8>
Multiple draws of the Rv
Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
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]
impl Support<u8> for Bernoulli
impl DiscreteDistr<u8> for Bernoulli
[src]
impl DiscreteDistr<u8> for Bernoulli
fn pmf(&self, x: &u8) -> f64
[src]
fn pmf(&self, x: &u8) -> f64
Probability mass function (PMF) at x
Read more
fn ln_pmf(&self, x: &u8) -> f64
[src]
fn ln_pmf(&self, x: &u8) -> f64
Natural logarithm of the probability mass function (PMF) Read more
impl Cdf<u8> for Bernoulli
[src]
impl Cdf<u8> for Bernoulli
fn cdf(&self, x: &u8) -> f64
[src]
fn cdf(&self, x: &u8) -> f64
The value of the Cumulative Density Function at x
Read more
fn sf(&self, x: &X) -> f64
[src]
fn sf(&self, x: &X) -> f64
Survival function, 1 - CDF(x)
impl Mode<u8> for Bernoulli
[src]
impl Mode<u8> for Bernoulli
impl HasSuffStat<u8> for Bernoulli
[src]
impl HasSuffStat<u8> for Bernoulli
type Stat = BernoulliSuffStat
fn empty_suffstat(&self) -> Self::Stat
[src]
fn empty_suffstat(&self) -> Self::Stat
impl Rv<u16> for Bernoulli
[src]
impl Rv<u16> for Bernoulli
fn f(&self, x: &u16) -> f64
[src]
fn f(&self, x: &u16) -> f64
Un-normalized probability function Read more
fn ln_f(&self, x: &u16) -> f64
[src]
fn ln_f(&self, x: &u16) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> u16
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> u16
Single draw from the Rv
Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<u16>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<u16>
Multiple draws of the Rv
Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
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]
impl Support<u16> for Bernoulli
impl DiscreteDistr<u16> for Bernoulli
[src]
impl DiscreteDistr<u16> for Bernoulli
fn pmf(&self, x: &u16) -> f64
[src]
fn pmf(&self, x: &u16) -> f64
Probability mass function (PMF) at x
Read more
fn ln_pmf(&self, x: &u16) -> f64
[src]
fn ln_pmf(&self, x: &u16) -> f64
Natural logarithm of the probability mass function (PMF) Read more
impl Cdf<u16> for Bernoulli
[src]
impl Cdf<u16> for Bernoulli
fn cdf(&self, x: &u16) -> f64
[src]
fn cdf(&self, x: &u16) -> f64
The value of the Cumulative Density Function at x
Read more
fn sf(&self, x: &X) -> f64
[src]
fn sf(&self, x: &X) -> f64
Survival function, 1 - CDF(x)
impl Mode<u16> for Bernoulli
[src]
impl Mode<u16> for Bernoulli
impl HasSuffStat<u16> for Bernoulli
[src]
impl HasSuffStat<u16> for Bernoulli
type Stat = BernoulliSuffStat
fn empty_suffstat(&self) -> Self::Stat
[src]
fn empty_suffstat(&self) -> Self::Stat
impl Rv<u32> for Bernoulli
[src]
impl Rv<u32> for Bernoulli
fn f(&self, x: &u32) -> f64
[src]
fn f(&self, x: &u32) -> f64
Un-normalized probability function Read more
fn ln_f(&self, x: &u32) -> f64
[src]
fn ln_f(&self, x: &u32) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> u32
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> u32
Single draw from the Rv
Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<u32>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<u32>
Multiple draws of the Rv
Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
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]
impl Support<u32> for Bernoulli
impl DiscreteDistr<u32> for Bernoulli
[src]
impl DiscreteDistr<u32> for Bernoulli
fn pmf(&self, x: &u32) -> f64
[src]
fn pmf(&self, x: &u32) -> f64
Probability mass function (PMF) at x
Read more
fn ln_pmf(&self, x: &u32) -> f64
[src]
fn ln_pmf(&self, x: &u32) -> f64
Natural logarithm of the probability mass function (PMF) Read more
impl Cdf<u32> for Bernoulli
[src]
impl Cdf<u32> for Bernoulli
fn cdf(&self, x: &u32) -> f64
[src]
fn cdf(&self, x: &u32) -> f64
The value of the Cumulative Density Function at x
Read more
fn sf(&self, x: &X) -> f64
[src]
fn sf(&self, x: &X) -> f64
Survival function, 1 - CDF(x)
impl Mode<u32> for Bernoulli
[src]
impl Mode<u32> for Bernoulli
impl HasSuffStat<u32> for Bernoulli
[src]
impl HasSuffStat<u32> for Bernoulli
type Stat = BernoulliSuffStat
fn empty_suffstat(&self) -> Self::Stat
[src]
fn empty_suffstat(&self) -> Self::Stat
impl Rv<u64> for Bernoulli
[src]
impl Rv<u64> for Bernoulli
fn f(&self, x: &u64) -> f64
[src]
fn f(&self, x: &u64) -> f64
Un-normalized probability function Read more
fn ln_f(&self, x: &u64) -> f64
[src]
fn ln_f(&self, x: &u64) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> u64
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> u64
Single draw from the Rv
Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<u64>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<u64>
Multiple draws of the Rv
Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
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]
impl Support<u64> for Bernoulli
impl DiscreteDistr<u64> for Bernoulli
[src]
impl DiscreteDistr<u64> for Bernoulli
fn pmf(&self, x: &u64) -> f64
[src]
fn pmf(&self, x: &u64) -> f64
Probability mass function (PMF) at x
Read more
fn ln_pmf(&self, x: &u64) -> f64
[src]
fn ln_pmf(&self, x: &u64) -> f64
Natural logarithm of the probability mass function (PMF) Read more
impl Cdf<u64> for Bernoulli
[src]
impl Cdf<u64> for Bernoulli
fn cdf(&self, x: &u64) -> f64
[src]
fn cdf(&self, x: &u64) -> f64
The value of the Cumulative Density Function at x
Read more
fn sf(&self, x: &X) -> f64
[src]
fn sf(&self, x: &X) -> f64
Survival function, 1 - CDF(x)
impl Mode<u64> for Bernoulli
[src]
impl Mode<u64> for Bernoulli
impl HasSuffStat<u64> for Bernoulli
[src]
impl HasSuffStat<u64> for Bernoulli
type Stat = BernoulliSuffStat
fn empty_suffstat(&self) -> Self::Stat
[src]
fn empty_suffstat(&self) -> Self::Stat
impl Rv<usize> for Bernoulli
[src]
impl Rv<usize> for Bernoulli
fn f(&self, x: &usize) -> f64
[src]
fn f(&self, x: &usize) -> f64
Un-normalized probability function Read more
fn ln_f(&self, x: &usize) -> f64
[src]
fn ln_f(&self, x: &usize) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> usize
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> usize
Single draw from the Rv
Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<usize>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<usize>
Multiple draws of the Rv
Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
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]
impl Support<usize> for Bernoulli
impl DiscreteDistr<usize> for Bernoulli
[src]
impl DiscreteDistr<usize> for Bernoulli
fn pmf(&self, x: &usize) -> f64
[src]
fn pmf(&self, x: &usize) -> f64
Probability mass function (PMF) at x
Read more
fn ln_pmf(&self, x: &usize) -> f64
[src]
fn ln_pmf(&self, x: &usize) -> f64
Natural logarithm of the probability mass function (PMF) Read more
impl Cdf<usize> for Bernoulli
[src]
impl Cdf<usize> for Bernoulli
fn cdf(&self, x: &usize) -> f64
[src]
fn cdf(&self, x: &usize) -> f64
The value of the Cumulative Density Function at x
Read more
fn sf(&self, x: &X) -> f64
[src]
fn sf(&self, x: &X) -> f64
Survival function, 1 - CDF(x)
impl Mode<usize> for Bernoulli
[src]
impl Mode<usize> for Bernoulli
impl HasSuffStat<usize> for Bernoulli
[src]
impl HasSuffStat<usize> for Bernoulli
type Stat = BernoulliSuffStat
fn empty_suffstat(&self) -> Self::Stat
[src]
fn empty_suffstat(&self) -> Self::Stat
impl Rv<i8> for Bernoulli
[src]
impl Rv<i8> for Bernoulli
fn f(&self, x: &i8) -> f64
[src]
fn f(&self, x: &i8) -> f64
Un-normalized probability function Read more
fn ln_f(&self, x: &i8) -> f64
[src]
fn ln_f(&self, x: &i8) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> i8
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> i8
Single draw from the Rv
Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<i8>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<i8>
Multiple draws of the Rv
Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
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]
impl Support<i8> for Bernoulli
impl DiscreteDistr<i8> for Bernoulli
[src]
impl DiscreteDistr<i8> for Bernoulli
fn pmf(&self, x: &i8) -> f64
[src]
fn pmf(&self, x: &i8) -> f64
Probability mass function (PMF) at x
Read more
fn ln_pmf(&self, x: &i8) -> f64
[src]
fn ln_pmf(&self, x: &i8) -> f64
Natural logarithm of the probability mass function (PMF) Read more
impl Cdf<i8> for Bernoulli
[src]
impl Cdf<i8> for Bernoulli
fn cdf(&self, x: &i8) -> f64
[src]
fn cdf(&self, x: &i8) -> f64
The value of the Cumulative Density Function at x
Read more
fn sf(&self, x: &X) -> f64
[src]
fn sf(&self, x: &X) -> f64
Survival function, 1 - CDF(x)
impl Mode<i8> for Bernoulli
[src]
impl Mode<i8> for Bernoulli
impl HasSuffStat<i8> for Bernoulli
[src]
impl HasSuffStat<i8> for Bernoulli
type Stat = BernoulliSuffStat
fn empty_suffstat(&self) -> Self::Stat
[src]
fn empty_suffstat(&self) -> Self::Stat
impl Rv<i16> for Bernoulli
[src]
impl Rv<i16> for Bernoulli
fn f(&self, x: &i16) -> f64
[src]
fn f(&self, x: &i16) -> f64
Un-normalized probability function Read more
fn ln_f(&self, x: &i16) -> f64
[src]
fn ln_f(&self, x: &i16) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> i16
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> i16
Single draw from the Rv
Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<i16>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<i16>
Multiple draws of the Rv
Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
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]
impl Support<i16> for Bernoulli
impl DiscreteDistr<i16> for Bernoulli
[src]
impl DiscreteDistr<i16> for Bernoulli
fn pmf(&self, x: &i16) -> f64
[src]
fn pmf(&self, x: &i16) -> f64
Probability mass function (PMF) at x
Read more
fn ln_pmf(&self, x: &i16) -> f64
[src]
fn ln_pmf(&self, x: &i16) -> f64
Natural logarithm of the probability mass function (PMF) Read more
impl Cdf<i16> for Bernoulli
[src]
impl Cdf<i16> for Bernoulli
fn cdf(&self, x: &i16) -> f64
[src]
fn cdf(&self, x: &i16) -> f64
The value of the Cumulative Density Function at x
Read more
fn sf(&self, x: &X) -> f64
[src]
fn sf(&self, x: &X) -> f64
Survival function, 1 - CDF(x)
impl Mode<i16> for Bernoulli
[src]
impl Mode<i16> for Bernoulli
impl HasSuffStat<i16> for Bernoulli
[src]
impl HasSuffStat<i16> for Bernoulli
type Stat = BernoulliSuffStat
fn empty_suffstat(&self) -> Self::Stat
[src]
fn empty_suffstat(&self) -> Self::Stat
impl Rv<i32> for Bernoulli
[src]
impl Rv<i32> for Bernoulli
fn f(&self, x: &i32) -> f64
[src]
fn f(&self, x: &i32) -> f64
Un-normalized probability function Read more
fn ln_f(&self, x: &i32) -> f64
[src]
fn ln_f(&self, x: &i32) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> i32
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> i32
Single draw from the Rv
Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<i32>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<i32>
Multiple draws of the Rv
Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
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]
impl Support<i32> for Bernoulli
impl DiscreteDistr<i32> for Bernoulli
[src]
impl DiscreteDistr<i32> for Bernoulli
fn pmf(&self, x: &i32) -> f64
[src]
fn pmf(&self, x: &i32) -> f64
Probability mass function (PMF) at x
Read more
fn ln_pmf(&self, x: &i32) -> f64
[src]
fn ln_pmf(&self, x: &i32) -> f64
Natural logarithm of the probability mass function (PMF) Read more
impl Cdf<i32> for Bernoulli
[src]
impl Cdf<i32> for Bernoulli
fn cdf(&self, x: &i32) -> f64
[src]
fn cdf(&self, x: &i32) -> f64
The value of the Cumulative Density Function at x
Read more
fn sf(&self, x: &X) -> f64
[src]
fn sf(&self, x: &X) -> f64
Survival function, 1 - CDF(x)
impl Mode<i32> for Bernoulli
[src]
impl Mode<i32> for Bernoulli
impl HasSuffStat<i32> for Bernoulli
[src]
impl HasSuffStat<i32> for Bernoulli
type Stat = BernoulliSuffStat
fn empty_suffstat(&self) -> Self::Stat
[src]
fn empty_suffstat(&self) -> Self::Stat
impl Rv<i64> for Bernoulli
[src]
impl Rv<i64> for Bernoulli
fn f(&self, x: &i64) -> f64
[src]
fn f(&self, x: &i64) -> f64
Un-normalized probability function Read more
fn ln_f(&self, x: &i64) -> f64
[src]
fn ln_f(&self, x: &i64) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> i64
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> i64
Single draw from the Rv
Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<i64>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<i64>
Multiple draws of the Rv
Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
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]
impl Support<i64> for Bernoulli
impl DiscreteDistr<i64> for Bernoulli
[src]
impl DiscreteDistr<i64> for Bernoulli
fn pmf(&self, x: &i64) -> f64
[src]
fn pmf(&self, x: &i64) -> f64
Probability mass function (PMF) at x
Read more
fn ln_pmf(&self, x: &i64) -> f64
[src]
fn ln_pmf(&self, x: &i64) -> f64
Natural logarithm of the probability mass function (PMF) Read more
impl Cdf<i64> for Bernoulli
[src]
impl Cdf<i64> for Bernoulli
fn cdf(&self, x: &i64) -> f64
[src]
fn cdf(&self, x: &i64) -> f64
The value of the Cumulative Density Function at x
Read more
fn sf(&self, x: &X) -> f64
[src]
fn sf(&self, x: &X) -> f64
Survival function, 1 - CDF(x)
impl Mode<i64> for Bernoulli
[src]
impl Mode<i64> for Bernoulli
impl HasSuffStat<i64> for Bernoulli
[src]
impl HasSuffStat<i64> for Bernoulli
type Stat = BernoulliSuffStat
fn empty_suffstat(&self) -> Self::Stat
[src]
fn empty_suffstat(&self) -> Self::Stat
impl Rv<isize> for Bernoulli
[src]
impl Rv<isize> for Bernoulli
fn f(&self, x: &isize) -> f64
[src]
fn f(&self, x: &isize) -> f64
Un-normalized probability function Read more
fn ln_f(&self, x: &isize) -> f64
[src]
fn ln_f(&self, x: &isize) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> isize
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> isize
Single draw from the Rv
Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<isize>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<isize>
Multiple draws of the Rv
Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
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]
impl Support<isize> for Bernoulli
impl DiscreteDistr<isize> for Bernoulli
[src]
impl DiscreteDistr<isize> for Bernoulli
fn pmf(&self, x: &isize) -> f64
[src]
fn pmf(&self, x: &isize) -> f64
Probability mass function (PMF) at x
Read more
fn ln_pmf(&self, x: &isize) -> f64
[src]
fn ln_pmf(&self, x: &isize) -> f64
Natural logarithm of the probability mass function (PMF) Read more
impl Cdf<isize> for Bernoulli
[src]
impl Cdf<isize> for Bernoulli
fn cdf(&self, x: &isize) -> f64
[src]
fn cdf(&self, x: &isize) -> f64
The value of the Cumulative Density Function at x
Read more
fn sf(&self, x: &X) -> f64
[src]
fn sf(&self, x: &X) -> f64
Survival function, 1 - CDF(x)
impl Mode<isize> for Bernoulli
[src]
impl Mode<isize> for Bernoulli
impl HasSuffStat<isize> for Bernoulli
[src]
impl HasSuffStat<isize> for Bernoulli
type Stat = BernoulliSuffStat
fn empty_suffstat(&self) -> Self::Stat
[src]
fn empty_suffstat(&self) -> Self::Stat
impl Rv<Bernoulli> for Beta
[src]
impl Rv<Bernoulli> for Beta
fn ln_f(&self, x: &Bernoulli) -> f64
[src]
fn ln_f(&self, x: &Bernoulli) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> Bernoulli
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> Bernoulli
Single draw from the Rv
Read more
fn f(&self, x: &X) -> f64
[src]
fn f(&self, x: &X) -> f64
Un-normalized probability function Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
The constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>
Multiple draws of the Rv
Read more
impl Support<Bernoulli> for Beta
[src]
impl Support<Bernoulli> for Beta
fn contains(&self, x: &Bernoulli) -> bool
[src]
fn contains(&self, x: &Bernoulli) -> bool
Returns true
if x
is in the support of the Rv
Read more
impl ContinuousDistr<Bernoulli> for Beta
[src]
impl ContinuousDistr<Bernoulli> for Beta
fn pdf(&self, x: &X) -> f64
[src]
fn pdf(&self, x: &X) -> f64
The value of the Probability Density Function (PDF) at x
Read more
fn ln_pdf(&self, x: &X) -> f64
[src]
fn ln_pdf(&self, x: &X) -> f64
The value of the log Probability Density Function (PDF) at x
Read more
impl ConjugatePrior<bool, Bernoulli> for Beta
[src]
impl ConjugatePrior<bool, Bernoulli> for Beta
type Posterior = Self
fn posterior(&self, x: &DataOrSuffStat<bool, Bernoulli>) -> Self
[src]
fn posterior(&self, x: &DataOrSuffStat<bool, Bernoulli>) -> Self
Computes the posterior distribution from the data
fn ln_m(&self, x: &DataOrSuffStat<bool, Bernoulli>) -> f64
[src]
fn ln_m(&self, x: &DataOrSuffStat<bool, Bernoulli>) -> f64
Log marginal likelihood
fn ln_pp(&self, y: &bool, x: &DataOrSuffStat<bool, Bernoulli>) -> f64
[src]
fn ln_pp(&self, y: &bool, x: &DataOrSuffStat<bool, Bernoulli>) -> f64
Log posterior predictive of y given x
fn m(&self, x: &DataOrSuffStat<X, Fx>) -> f64
[src]
fn m(&self, x: &DataOrSuffStat<X, Fx>) -> f64
Marginal likelihood of x
fn pp(&self, y: &X, x: &DataOrSuffStat<X, Fx>) -> f64
[src]
fn pp(&self, y: &X, x: &DataOrSuffStat<X, Fx>) -> f64
Posterior Predictive distribution