generate a random sample from a mixture of exponentials

Share:

Description

Generate a random sample from a mixture of exponentials.

Usage

1
rmix.exp(n, alpha, theta)

Arguments

n

sample size

alpha

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

theta

vector of parameters of component distributions.

Value

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

Author(s)

Shaoting Li, Jiahua Chen and Pengfei Li

See Also

emtest.exp, plotmix.exp, pmle.exp

Examples

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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.