data(zmat)
input.to.piem <- ztobins(zmat, 3, plot = TRUE)
pbz <- input.to.piem$pdf.binned.z
bz <- input.to.piem$binned.z.mat
output <- piem(pbz, bz, control = em.control(verbose = TRUE,nr.threads = 2))
# converge after 209 iterations.
# iterations are printed
# Set nr.threads = 0 to optimal use of threads.
Pi <- output$last.iteration
Run the code above in your browser using DataLab