rmixture {ForestFit} | R Documentation |
Generating random realizations from the well-known mixture models
Description
Generates iid realizations from the mixture model with pdf given by
where is the number of components,
, for
is parameter space of the
-th component, i.e.
, and
is the whole parameter vector
. Parameters
and
are the shape and scale parameters or both are the shape parameters. In the latter case, parameters
and
are called the first and second shape parameters, respectively. We note that the constants
s sum to one, i.e.,
. The families considered for the cdf
include Birnbaum-Saunders, Burr type XII, Chen, F, Fr\'echet, Gamma, Gompertz, Log-normal, Log-logistic, Lomax, skew-normal, and Weibull.
Usage
rmixture(n, g, K, param)
Arguments
n |
Number of requested random realizations. |
g |
Name of the family including " |
K |
Number of components. |
param |
Vector of the |
Details
For the skew-normal case, ,
, and
are the location, scale, and skewness parameters, respectively.
Value
A vector of length , giving a sequence of random realizations from given mixture model.
Author(s)
Mahdi Teimouri
Examples
n<-50
K<-2
weight<-c(0.3,0.7)
alpha<-c(1,2)
beta<-c(2,1)
param<-c(weight,alpha,beta)
rmixture(n, "weibull", K, param)