The function computes the probability mass function of the flexible beta-binomial distribution.
dFBB(x, size, mu, theta = NULL, phi = NULL, p, w)A vector with the same length as x.
a vector of quantiles.
the total number of trials.
the mean parameter. It must lie in (0, 1).
the overdispersion paramete. It must lie in (0, 1).
the precision parameter. It is an alternative way to specify the theta parameter. It must be a positive real value.
the mixing weight. It must lie in (0, 1).
the normalized distance among clusters. It must lie in (0, 1).
The FBB distribution is a special mixture of two beta-binomial distributions $$p BB(x;\lambda_1,\phi)+(1-p)BB(x;\lambda_2,\phi)$$ for \(x \in \lbrace 0, 1, \dots, n \rbrace\) where \(BB(x;\cdot,\cdot)\) is the beta-binomial distribution with a mean-precision parameterization. Moreover, \(\phi=(1-\theta)/\theta\), \(0<p<1\) is the mixing weight, \(\phi>0\) is a precision parameter, \(\lambda_1=\mu+(1-p)w\) and \(\lambda_2=\mu-pw\) are the component means of the first and second component of the mixture, \(0<\mu=p\lambda_1+(1-p)\lambda_2<1\) is the overall mean, and \(0<w<1\) is the normalized distance between clusters.
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
dFBB(x = c(5,7,8), size=10, mu = .3, phi = 20, p = .5, w = .5)
Run the code above in your browser using DataLab