rpmd {PoissonMultinomial}R Documentation

Poisson-Multinomial Distribution Random Number Generator

Description

Generates random samples from the PMD specified by the success probability matrix.

Usage

rpmd(pmat, s = 1)

Arguments

pmat

An \rm n \times m success probability matrix, where \rm n is the number of independent trials and \rm m is the number of categories. Each row of pmat contains the success probabilities for the corresponding trial, and each row adds up to 1.

s

The number of samples to be generated.

Value

An s \times m matrix of samples, each row stands for one sample from the PMD with success probability matrix pmat.

Examples

pp <- matrix(c(.1, .1, .1, .7, .1, .3, .3, .3, .5, .2, .1, .2), nrow = 3, byrow = TRUE)
 
rpmd(pmat = pp, s = 5)


[Package PoissonMultinomial version 1.1 Index]