Learn R Programming

marl (version 1.0)

sim.negbin: Simulates data from a mixture of Negative Binomial distribution

Description

This function simulates data from a mixture of Negative Binomial distribution. The parameterization mu and size is used.

Usage

sim.negbin(mu, size, n.obs, n.val)

Arguments

mu
a vector of Nagative Binomial means used for simulating data
size
Size or overdispersion parameter. It is a fixed positive number.
n.obs
Number of observations to simulate.
n.val
Length of each observation.

Details

If necessary readers are referred to rnbinom function in R.

References

rnbinom.

Examples

Run this code
dat.sim <- sim.negbin(c(3,7),2,5,15)

Run the code above in your browser using DataLab