set.seed(12345)
## Simulate data as shown in Rau et al. (2011)
## Library size setting "A", high cluster separation
## n = 500 observations
simulate <- PoisMixSim(n = 500, libsize = "A", separation = "high")
y <- simulate$y
conds <- simulate$conditions
## Calculate initial values for lambda and pi using the Small-EM
## initialization (4 classes, PMM-II model with "TC" library size)
init.values <- emInit(y, g = 4, conds, lib.size = TRUE,
lib.type = "TC", alg.type = "EM")
pi.init <- init.values$pi.init
lambda.init <- init.values$lambda.initRun the code above in your browser using DataLab