rmixweibull: Generating Random Data From A Weibull Mixture Model

Description Usage Arguments Details Value See Also Examples

View source: R/rmixweibull.R

Description

The function rmixweibull generates random data from a normal Weibull model.

Usage

1
rmixweibull(n, pi, mu, sd)

Arguments

n

a positive integer specifying the number of observations we want to generate from the mixture model

pi

a numeric vector for the proportion of each component

mu

a numeric vector for the mean of each component

sd

a numeric vector for the standard deviation of each component

Details

The number of random data from each component n_0 (a vector) is generated from a multinomial distribution Multinom(n, pi). Then the random data from each component is generated with the sample sized specified in n_0 and parameters of Weibull distributions specified in mu and sd.

Value

The function rmixweibull returns a numeric vector of random data from the specified Weibull mixture model.

See Also

rmixnormal, rmixgamma, rmixlnorm

Examples

1
2
x <- rmixweibull(1000, c(0.4, 0.6), c(2, 5), c(1, 0.5))
hist(x, breaks = 40)

mixR documentation built on June 1, 2021, 5:07 p.m.