rnormmix: Generate mixture with normal components.

Description Usage Arguments Value Examples

Description

Generate a mixture on a 2d window where the mean and variance of the components are random. The number of component can either be fixed or random.

Usage

1
rnormmix(m, sig0, df, rand_m = FALSE, xlim = c(0, 1), ylim = c(0, 1))

Arguments

m

Number of components in normal mixture.

sig0

Tunning parameter in generating random matrix from Wishart distribution.

df

Degree of freedom in generating random matrix from Wishart distribution.

rand_m

whether number of components is random. When rand_m = FALSE, it will randomly choose number of components from 1:m.

xlim, ylim

Vector of length two, the limit are used to sample the mu's from a uniform distribution.

Value

Object of class normmix.

Examples

1
2
3
4
5
mix1 <- rnormmix(m = 3, sig0 = .1, df = 5)
summary(mix1)

mix2 <- rnormmix(m = 5, sig0 = .1, df = 5, rand_m = TRUE, ylim = c(0, 5))
summary(mix2)

wangyuchen/sppmix documentation built on May 4, 2019, 12:58 a.m.