Learn R Programming

FlexReg (version 1.1)

dBetaBin: Beta-binomial probability mass function

Description

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

Usage

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

Value

A vector with the same length as x.

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. It is an alternative way to specify the theta parameter. It must be a positive real value.

Details

The beta-binomial distribution has probability mass function $${n\choose y} \frac{\Gamma{(\phi)}}{\Gamma{(\mu\phi)}\Gamma{((1-\mu)\phi)}} \frac{\Gamma{(\mu\phi+y)}\Gamma{((1-\mu)\phi + n - y)}}{\Gamma{(\phi + n)}},$$ for \(x \in \lbrace 0, 1, \dots, n \rbrace\), where \(0<\mu<1\) identifies the mean and \(\phi=(1-\theta)/\theta >0\) is the precision parameter.

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

Examples

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

Run the code above in your browser using DataLab