rmixture: Generating random realizations from the well-known mixture...

View source: R/ForestFit.R

rmixtureR Documentation

Generating random realizations from the well-known mixture models

Description

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.

Usage

rmixture(n, g, K, param)

Arguments

n

Number of requested random realizations.

g

Name of the family including "birnbaum-saunders", "burrxii", "chen", "f", "frechet", "gamma", "gompetrz", "log-normal", "log-logistic", "lomax", "skew-normal", and "weibull".

K

Number of components.

param

Vector of the ω, α, β, and λ.

Details

For the skew-normal case, α, β, and λ 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)

ForestFit documentation built on March 7, 2023, 8:27 p.m.