You are here

Example Scripts for mxComputeEM?

4 posts / 0 new
Last post
ZZ's picture
ZZ
Offline
Joined: 07/22/2018 - 15:34
Example Scripts for mxComputeEM?

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!

jpritikin's picture
Offline
Joined: 05/24/2012 - 00:35
examples

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.

ZZ's picture
ZZ
Offline
Joined: 07/22/2018 - 15:34
Thanks a lot Joshua! However,

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?

jpritikin's picture
Offline
Joined: 05/24/2012 - 00:35
api

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')