rcnb: Random Number Generation from Conditional Negative Binomial

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Random number generation from the conditional distribution of X given X + Y = D, where X ~ NB(r1, p1) and Y ~ NB(r2, p2) are drawn from two negative binomials, independent of each other, and assuming p1/p2 = lambda.

Usage

1
rcnb(n, D, r1, r2, lambda)

Arguments

n

a positive integer.

D

a positive integer.

r1

a positive value.

r2

a positive value.

lambda

a positive value.

Details

Need to specify full list of arguments, as default values have not been set.

Value

n iid draws from X|X+Y=D.

Author(s)

Xiaotian Zhu, [email protected]

See Also

dcnb, pcnb, qcnb.

Examples

1
2
x <- rcnb(1e3, 7, 2, 0.4, 0.6)
hist(x)

cnbdistr documentation built on July 17, 2017, 5:02 p.m.