dBetaBin function

Probability mass function of the beta-binomial distribution

Probability mass function of the beta-binomial distribution

The function computes the probability mass function of the beta-binomial distribution.

dBetaBin(x, size, mu, theta = NULL, phi = NULL)

Arguments

  • x: a vector of quantiles.
  • size: the total number of trials.
  • mu: the mean parameter. It must lie in (0, 1).
  • theta: the overdispersion parameter. It must lie in (0, 1).
  • phi: the precision parameter, an alternative way to specify the overdispersion parameter theta. It must be a real positive value.

Returns

A vector with the same length as x.

Details

The beta-binomial distribution has probability mass function

fBB(x;μ,ϕ)=(nx)Γ(ϕ)Γ(μϕ)Γ((1μ)ϕ)Γ(μϕ+x)Γ((1μ)ϕ+nx)Γ(ϕ+n), f_{BB}(x;\mu,\phi)={n\choose x} \frac{\Gamma{(\phi)}}{\Gamma{(\mu\phi)}\Gamma{((1-\mu)\phi)}} \frac{\Gamma{(\mu\phi+x)}\Gamma{((1-\mu)\phi + n - x)}}{\Gamma{(\phi + n)}},

for x{0,1,,n}x \in \lbrace 0, 1, \dots, n \rbrace, where 0<μ<10<\mu<1 identifies the mean and ϕ=(1θ)/θ>0\phi=(1-\theta)/\theta >0 is the precision parameter.

Examples

dBetaBin(x = 5, size = 10, mu = .3, phi = 10)

References

Ascari, R., Migliorati, S. (2021). A new regression model for overdispersed binomial data accounting for outliers and an excess of zeros. Statistics in Medicine, 40 (17), 3895--3914. doi:10.1002/sim.9005

  • Maintainer: Roberto Ascari
  • License: GPL (>= 2)
  • Last published: 2025-04-14

Useful links