rmix.exp: generate a random sample from a mixture of exponentials

Description Usage Arguments Value Author(s) See Also Examples

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)


Search within the MixtureInf package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.