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

Description Usage Arguments Value Author(s) See Also Examples

View source: R/rmix.exp.R

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)

MixtureInf documentation built on May 30, 2017, 6:56 a.m.

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