rmixture | R Documentation |
Generates iid realizations from the mixture model with pdf given by
f(x,{Θ}) = ∑_{j=1}^{K}ω_j f(x,θ_j),
where K is the number of components, θ_j, for j=1,…,K is parameter space of the j-th component, i.e. θ_j=(α_j,β_j)^{T}, and Θ is the whole parameter vector Θ=(θ_1,…,θ_K)^{T}. 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 ω_js sum to one, i.e., ∑_{j=1}^{K}ω_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.
rmixture(n, g, K, param)
n |
Number of requested random realizations. |
g |
Name of the family including " |
K |
Number of components. |
param |
Vector of the ω, α, β, and λ. |
For the skew-normal case, α, β, and λ are the location, scale, and skewness parameters, respectively.
A vector of length n, giving a sequence of random realizations from given mixture model.
Mahdi Teimouri
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.