Learn R Programming

norMmix (version 0.2-0)

rnorMmix: 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)

Value

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

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

Author

Nicolas Trutmann

See Also

Examples

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

Run the code above in your browser using DataLab