Learn R Programming

flexmix (version 2.3-19)

rflexmix: Random Number Generator for Finite Mixtures

Description

Given a finite mixture model generate random numbers from it.

Usage

rflexmix(object, newdata, ...)

Value

A list with components

y

Random sample

group

Grouping factor

class

Class membership

Arguments

object

A fitted finite mixture model of class flexmix or an unfitted of class FLXdist.

newdata

Optionally, a data frame in which to look for variables with which to predict or an integer specifying the number of random draws for model-based clustering. If omitted, the data to which the model was fitted is used.

...

Further arguments to be passed to or from methods.

Author

Bettina Gruen

Details

rflexmix provides the creation of the model matrix for new data and the sampling of the cluster memberships. The sampling of the component distributions given the classification is done by calling rFLXM. This step has to be provided for the different model classes.

Examples

Run this code
example(flexmix)
sample <- rflexmix(ex1)

Run the code above in your browser using DataLab