| betabinom | R Documentation |
Density and random generation for the beta-binomial distribution.
dbetabinom(x, size, shape1, shape2, log = FALSE)
rbetabinom(n, size, shape1, shape2)
x |
vector of non-negative counts. |
size |
vector of total counts (number of trials). Needs to be >= |
shape1 |
positive shape parameter 1 of the Beta prior. |
shape2 |
positive shape parameter 2 of the Beta prior. |
log |
logical; if |
n |
number of random values to return (for |
This implementation of dbetabinom allows for automatic differentiation with RTMB.
dbetabinom gives the density and rbetabinom generates random samples.
set.seed(123)
x <- rbetabinom(1, 10, 2, 5)
d <- dbetabinom(x, 10, 2, 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.