mixgen {pcensmix} | R Documentation |
Generating Mixture Datasets
Description
This function generates two-component mixture data from a various different mixture distributions.
Usage
mixgen(N, dist1, dist2, control)
Arguments
N |
population size. |
dist1 , dist2 |
respective distributions of the first and second mixture
components to be simulated from. For Normal, Log-normal, Weibull, Gamma,
Cauchy and Beta distributions, they must be provided as |
control |
a list of parameters for controlling the simulation process.
This includes parameters of the first and second mixture component
distributions and the mixture proportion |
Details
It generates a two-component mixture dataset from a density function
\pi f_1 + (1 - \pi) f_2,
where f_1
and f_2
are the first
and the second mixture component distributions respectively.
Value
An object of class data.frame
containing the following
information:
z |
mixture data |
label |
component indicator |
Author(s)
Lida Fallah, John Hinde
Maintainer: Lida Fallah <l.fallah22@gmail.com>
See Also
Examples
## Generate a sample from a two component Normal-Weibull mixture distribution
## with mixing components as N(12, 2) and Weibull(15, 4), mixing proportion 0.3
## and size of N = 20.
mixture<- mixgen(N = 20, dist1 = 'norm', dist2 = 'weibull', control = list(12, 2, 15, 4, 0.3))