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
f(x,{\Theta}) = \sum_{j=1}^{K}\omega_j f(x,\theta_j),
where K
is the number of components, \theta_j
, for j=1,\dots,K
is parameter space of the j
-th component, i.e. \theta_j=(\alpha_j,\beta_j)^{T}
, and \Theta
is the whole parameter vector \Theta=(\theta_1,\dots,\theta_K)^{T}
. Parameters \alpha
and \beta
are the shape and scale parameters or both are the shape parameters. In the latter case, parameters \alpha
and \beta
are called the first and second shape parameters, respectively. We note that the constants \omega_j
s sum to one, i.e., \sum_{j=1}^{K}\omega_j=1
. The families considered for the cdf f
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, \alpha
, \beta
, and \lambda
are the location, scale, and skewness parameters, respectively.
Value
A vector of length n
, 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)