Bernoulli

0th

Percentile

Bernoulli distribution

Probability mass function, distribution function, quantile function and random generation for the Bernoulli distribution.

Keywords
distribution
Usage
dbern(x, prob = 0.5, log = FALSE)

pbern(q, prob = 0.5, lower.tail = TRUE, log.p = FALSE)

qbern(p, prob = 0.5, lower.tail = TRUE, log.p = FALSE)

rbern(n, prob = 0.5)

Arguments
x, q

vector of quantiles.

prob

probability of success; (0 < prob < 1).

log, log.p

logical; if TRUE, probabilities p are given as log(p).

lower.tail

logical; if TRUE (default), probabilities are \(P[X \le x]\) otherwise, \(P[X > x]\).

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

See Also

Binomial

Aliases
  • Bernoulli
  • dbern
  • pbern
  • qbern
  • rbern
Examples
# NOT RUN {
prop.table(table(rbern(1e5, 0.5)))

# }
Documentation reproduced from package extraDistr, version 1.8.11, License: GPL-2

Community examples

Looks like there are no examples yet.