powered by
Density and random generation for the beta-binomial distribution.
dbetabinom(x, size, shape1, shape2, log = FALSE)rbetabinom(n, size, shape1, shape2)
rbetabinom(n, size, shape1, shape2)
dbetabinom gives the density and rbetabinom generates random samples.
dbetabinom
rbetabinom
vector of non-negative counts.
vector of total counts (number of trials). Needs to be >= x.
x
positive shape parameter 1 of the Beta prior.
positive shape parameter 2 of the Beta prior.
logical; if TRUE, densities are returned on the log scale.
TRUE
number of random values to return (for rbetabinom).
This implementation of dbetabinom allows for automatic differentiation with RTMB.
RTMB
set.seed(123) x <- rbetabinom(1, 10, 2, 5) d <- dbetabinom(x, 10, 2, 5)
Run the code above in your browser using DataLab