The Beta-Binomial Distribution
Density, distribution function, quantile function and random generation
for the beta-binomial distribution when parameterized
by the mean mu
and the overdispersion parameter rho
rather than the typical shape parameters.
dbetabinom(x, size, mu, rho, log) pbetabinom(q, size, mu, rho, log_p) qbetabinom(p, size, mu, rho) rbetabinom(n, size, mu, rho)
x, q |
A vector of quantiles. |
size |
A vector of sizes. |
mu |
Either a scalar of the mean for each observation,
or a vector of means of each observation, and thus
the same length as |
rho |
Either a scalar of the overdispersion parameter
for each observation, or a vector of overdispersion
parameters of each observation, and thus the same length as
|
log, log_p |
A logical vector either of length 1 or the same
length as |
p |
A vector of probabilities. |
n |
The number of observations. |
Let μ and ρ be the mean and overdispersion parameters. Let α and β be the usual shape parameters of a beta distribution. Then we have the relation
μ = α/(α + β),
and
ρ = 1/(1 + α + β).
This necessarily means that
α = μ (1 - ρ)/ρ,
and
β = (1 - μ) (1 - ρ)/ρ.
Either a random sample (rbetabinom
),
the density (dbetabinom
), the tail
probability (pbetabinom
), or the quantile
(qbetabinom
) of the beta-binomial distribution.
dbetabinom
: Density function.
pbetabinom
: Distribution function.
qbetabinom
: Quantile function.
rbetabinom
: Random generation.
David Gerard
x <- rbetabinom(n = 10, size = 10, mu = 0.1, rho = 0.01) dbetabinom(x = 1, size = 10, mu = 0.1, rho = 0.01, log = FALSE) pbetabinom(q = 1, size = 10, mu = 0.1, rho = 0.01, log_p = FALSE) qbetabinom(p = 0.6, size = 10, mu = 0.1, rho = 0.01)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.