rmix: Random Deviates from EMMIX Models

Description Usage Arguments Details Value Examples

Description

Random number generator for emmix models.

Usage

1
rmix(n, model, ...)

Arguments

model

An object of class 'emmix' containing a mode of mfa, mcfa, mtfa, or mctfa.

n

Number of sample to generate.

...

Not used.

Details

This function uses rmvnorm and rmvt functions from the mvtnorm package to generate samples from the mixture components.

Algorithm works by first drawing a component based on the mixture proprotion in the model, and then drawing a sample from the component distribution.

Value

A numeric matrix with samples drawn in rows.

Examples

1
2
3
set.seed(1)
model <- mcfa(iris[, -5], g=3, q=2, nkmeans=1, nrandom=1, itmax = 25)
dat <- rmix(n = 10, model = model)

suren-rathnayake/EMMIXmfa documentation built on May 17, 2019, 8:45 p.m.