rmix.pois: generate a random sample from a mixture of Possions

Description Usage Arguments Value Author(s) See Also Examples

Description

Generate a random sample from a mixture of Possions.

Usage

1
rmix.pois(n, alpha, theta)

Arguments

n

sample size.

alpha

vector of mixture proportions of length m, the order of the mixture.

theta

vector of parameters of each component.

Value

Return a sample of size n from an m-component Poisson mixture.

Author(s)

Shaoting Li, Jiahua Chen and Pengfei Li

See Also

rmix.binom, rmix.exp, rmix.norm

Examples

1
2
3
4
5
#generate a random sample from a 2 component Poisson mixture,
#and compute the sample mean and variance.
x <- rmix.pois(200,c(0.3,0.7),c(2,5))
mean(x)
var(x)

MixtureInf documentation built on May 2, 2019, 3:32 p.m.