Description Usage Arguments Details Author(s) Examples
rnegbin.alphabeta simulates data from a negative binomial distribution and dnegbin and dnegbin.alphabeta compute the density.
1 2 3 4 5 | dnegbin(k, r, p)
dnegbin.alphabeta(k, alpha, beta)
rnegbin.alphabeta(n, alpha, beta)
|
k |
numeric. Vector of observed counts. |
r |
scalar, positive. |
p |
scalar, probability. |
alpha |
scalar, positive. |
beta |
scalar, positive. |
n |
scalar, positive. Number of samples. |
The functions with alphabeta
use the parameterization with alpha and beta, while dnegbin
uses the parameterization with r and p.
The functions rgamma
and rstats
from package stats are used for the simulation of negative binomial data.
dnegbin and dnegbin.alphabeta can handle non-integer counts (without warning), because the binomial coefficient is implemented with a gamma function.
Johanna Bertl
1 | # see rnegbinmix
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.