rnorMmix {norMmix}R Documentation

Random Sample from Multivariate Normal Mixture Distribution

Description

Draw n (p-dimensional) observations randomly from the multivariate normal mixture distribution specified by obj.

Usage

rnorMmix(n, obj, index = FALSE, permute = TRUE)

Arguments

n

sample size, non-negative.

obj

a "norMmix" object

index

Logical, store the clustering information as first column

permute

Logical, indicating if the observations should be randomly permuted after creation “cluster by cluster”.

Value

n p-dimensional observations, as numeric n \times p matrix.

Author(s)

Nicolas Trutmann

See Also

rmultinom

Examples

x <- rnorMmix(500, MW213)
plot(x)
x <- rnorMmix(500, MW213, index=TRUE)
plot(x[,-1], col=x[,1]) ## using index column to color components

[Package norMmix version 0.1-1 Index]