rflexmix {flexmix} | R Documentation

## Random number generator for finite mixtures

### Description

Given a finite mixture model generate random numbers from it.

### Usage

    rflexmix(object, newdata, ...)

### 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.

### 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.

### Value

A list with components

`y` | Random sample
`group` | Grouping factor
`class` | Class membership

### Author(s)

Bettina Gruen

### Examples

    example(flexmix)
    sample <- rflexmix(ex1)

[Package flexmix version 2.2-4 Index]