rnormalmix: Simulate from a normal mixture distribution

Description Usage Arguments Value

View source: R/rnormalmix.R

Description

Simulate from a normal mixture distribution

Usage

1
rnormalmix(n, g, return.Z = FALSE)

Arguments

n

Number of points to simulate

g

Object of class normalmix (from ashr package). g has elements pi, mean and sd each of which has class K.

return.Z

if TRUE, also return a vector of indicators indicating which of the K classes each sample belongs to

Value

If return.Z=TRUE, returns a list with elements beta (samples) and Z (indicators). Otherwise returns a length n vector of samples.


jean997/sherlockAsh documentation built on Oct. 6, 2018, 3:14 p.m.