dnegbin: The negative binomial distribution

Description Usage Arguments Details Author(s) Examples

Description

rnegbin.alphabeta simulates data from a negative binomial distribution and dnegbin and dnegbin.alphabeta compute the density.

Usage

1
2
3
4
5
dnegbin(k, r, p)

dnegbin.alphabeta(k, alpha, beta)

rnegbin.alphabeta(n, alpha, beta)

Arguments

k

numeric. Vector of observed counts.

r

scalar, positive.

p

scalar, probability.

alpha

scalar, positive.

beta

scalar, positive.

n

scalar, positive. Number of samples.

Details

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.

Author(s)

Johanna Bertl

Examples

1
# see rnegbinmix

johannabertl/SelectionMix documentation built on May 3, 2019, 4:03 p.m.