Example Scripts for mxComputeEM?

Posted on
No user picture. ZZ Joined: 07/22/2018
Dear All,

I wonder if anybody could share example scripts involves using mxComputeEM?

The only sample code I found is in paper by Paritikin, Hunter, and Boker 2015 conducting item factor analysis https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4822086/, where mxComputeEM is called with arguments: "expectation = , predict = ". However, as the help file (version 2.11.5) of mxComputeEM suggests, these two arguments are deprecated, and an argument called "estep" should be used.

I am trying to use mxComputeEM to fit multivariate Gaussian mixture models. Any sample code for this kind of finite mixture models would be helpful as well.

Thanks a lot!

Replied on Mon, 12/10/2018 - 21:00
Picture of user. jpritikin Joined: 05/23/2012

mxComputeEM(e,p,mstep=m) is equivalent to mxComputeEM(estep=mxComputeOnce(e,p), mstep=m). The old style continues to work, but the new style may be more suitable for your needs.

I am curious to learn more about how you wish to implement your model.

Replied on Tue, 12/11/2018 - 14:18
No user picture. ZZ Joined: 07/22/2018

In reply to by jpritikin

Thanks a lot Joshua! However, for mxComputeOnce (version 2.11.5) the "..." is "Not used", so I can't use "expectation = ; predict = " as arguments. Do you have idea how else can I input the estep or work with mxComputeOnce?
Replied on Tue, 12/11/2018 - 14:36
Picture of user. jpritikin Joined: 05/23/2012

In reply to by ZZ

The ... argument only prohibits unnamed arguments. It doesn't mean that you can't use the arguments, you just have to name them. Will you use an mxAlgebra for your estep? If so, you can create the mxAlgebra(..., fixed=TRUE, name="E") and then recompute it in your estep with estep=mxComputeOnce('E')