betabinomial
The beta-binomial distribution is a discrete probability distribution that describes the number of successes in a fixed number of independent trials when the probability of success in each trial is itself random and follows a beta distribution. It arises as a compound distribution: if the success probability p is drawn from a Beta(alpha, beta) distribution and then K is drawn from a Binomial(n, p) distribution, the marginal distribution of K is beta-binomial.
Its probability mass function is P(K = k) = binomial(n, k) times Beta(k + alpha, n - k + beta) divided
Key moments include the mean and variance. The mean is E[K] = n * alpha / (alpha + beta). The
Applications include modeling overdispersion in binomial data, Bayesian hierarchical modeling, and fields such as ecology, genetics,