Learn R Programming

nbconv (version 1.0.1)

rnbconv: Random deviates

Description

Generates random samples from the convolution of arbitrary negative binomial random variables.

Usage

rnbconv(mus, phis, ps, n.samp, n.cores = 1)

Value

A numeric vector of random deviates.

Arguments

mus

Vector of individual mean values

phis

Vector of individual dispersion parameters. Equivalent to 'size' in dnbinom.

ps

Vector of individual probabilities of success.

n.samp

The number of samples per distribution

n.cores

The number of CPU cores to use in the evaluation. Allows parallelization.

Examples

Run this code
rnbconv(mus = c(100, 10), phis = c(5, 8), n.samp = 10)

Run the code above in your browser using DataLab