newSim: Simulate counts from a negative binomial model

newSimR Documentation

Simulate counts from a negative binomial model

Description

Given an object that describes negative binomial distribution, simulate counts from the distribution.

Usage

newSim(object, seed, ...)

## S4 method for signature 'newmodel'
newSim(object, seed)

Arguments

object

an object that describes a matrix of negative binomial.

seed

an optional integer to specify how the random number generator should be initialized with a call to set.seed. If missing, the random generator state is not changed.

...

additional arguments.

Value

A list with the following elements.

  • countsthe matrix with the simulated counts.

  • dataNBthe data simulated from the negative binomial.

  • dataDropoutsthe data simulated from the binomial process.

  • zeroFractionthe fraction of zeros.

Methods (by class)

  • newmodel: simulate from a nb distribution.

Examples

a <- newmodel(n=5, J=10)
newSim(a)

fedeago/NewWave documentation built on March 28, 2022, 5:46 a.m.