Learn R Programming

boostmath (version 1.0.0)

bernoulli_distribution: Bernoulli Distribution Functions

Description

Functions to compute the probability density function, cumulative distribution function, and quantile function for the Bernoulli distribution.

Usage

bernoulli_pdf(x, p_success)

bernoulli_lpdf(x, p_success)

bernoulli_cdf(x, p_success)

bernoulli_lcdf(x, p_success)

bernoulli_quantile(p, p_success)

Value

A single numeric value with the computed probability density, log-probability density, cumulative distribution, log-cumulative distribution, or quantile depending on the function called.

Arguments

x

quantile (0 or 1)

p_success

probability of success (0 <= p_success <= 1)

p

probability (0 <= p <= 1)

See Also

Boost Documentation for more details on the mathematical background.

Examples

Run this code
bernoulli_pdf(1, 0.5)
bernoulli_lpdf(1, 0.5)
bernoulli_cdf(1, 0.5)
bernoulli_lcdf(1, 0.5)
bernoulli_quantile(0.5, 0.5)

Run the code above in your browser using DataLab