gaussSim {UEM} | R Documentation |
Functions to simulate data from Gaussian, Poisson, and Cauchy mixtures.
gaussSim(theta) gaussSimN(n, theta) poisSim(theta) poisSimN(n, theta) cauchSim(theta) cauchSimN(n, theta)
theta |
a list with elements |
n |
sample size |
J. Einbeck, D. Bonetti, Z. Kalantan
rho <-0.7 Sigma <- list(diag(c(1,2)), matrix(c(2, 2*rho, 2*rho, 1), byrow=TRUE, ncol=2)) theta <-list(pi=c(1/3, 2/3), mu=matrix(c(3,1,0,4), byrow=TRUE, ncol=2), Sigma=Sigma) sim <- gaussSimN(1000, theta) fit2 <- EM(sim, K=2) plot.umix(fit2) sim1 <- cauchSimN(100,theta=list(pi=rep(0.5,2), mu=c(0,20), Sigma=list(gamma=1, gamma=2))) hist(sim1, breaks=40)