betabinom function

Beta-binomial distribution

Beta-binomial distribution

Density and random generation for the Beta-binomial distribution with parameters size, mu, and theta.

rbetabinom(n = 1, size, prob, theta) dbetabinom(x, size, prob, theta, log = FALSE)

Arguments

  • n: integer; number of random variates to generate.
  • size: size parameter of the binomial distribution
  • prob: mean of the Beta distribution
  • theta: Beta distribution dispersion parameter
  • x: vector of non-negative integer quantiles
  • log: logical; if TRUE, return logarithm(s) of probabilities.

Returns

  • rbetabinom: Returns a vector of length n containing random variates drawn from the Beta-binomial distribution.

  • dbetabinom: Returns a vector (of length equal to the number of columns of x) containing the probabilities of observing each column of x given the specified parameters (size, prob, theta).

Details

A variable XX is Beta-binomially distributed if X Binomial(n,P)X~{Binomial(n,P)} where P Beta(mu,theta)P~Beta(mu,theta). Using the standard (a,b)(a,b) parameterization, a=muthetaa=mu*theta and b=(1mu)thetab=(1-mu)*theta.

C API

An interface for C codes using these functions is provided by the package. Visit the package homepage to view the c("list("pomp")", " C API document").

See Also

More on implementing POMP models: Csnippet, accumvars, basic_components, covariates, dinit_spec, dmeasure_spec, dprocess_spec, emeasure_spec, eulermultinom, parameter_trans(), pomp-package, pomp_constructor, prior_spec, rinit_spec, rmeasure_spec, rprocess_spec, skeleton_spec, transformations, userdata, vmeasure_spec

  • Maintainer: Aaron A. King
  • License: GPL-3
  • Last published: 2025-04-16