Output from Mixture Model - How to Determine Latent Scores
Posted on

Attachment | Size |
---|---|
Mixture Model Code | 1.31 KB |
I fit a mixture model using mxExpectationMixture and mxFitFunctionML. I estimate means and residual variances for the second class (the values for the first class are arbitrarily fixed). How can I determine how the observations are classified?
I've attached a file with the relevant code.
Thanks.
Rick
Fiddle with the vectors of likelihoods
likeC1 <- attr(out$class1$fitfunction,'result')
likeC2 <- attr(out$class2$fitfunction,'result')
likeTot <- likeC1+likeC2
class1Probs <- likeC1/likeTot
class2Probs <- likeC2/likeTot
In your case, optimization seemed to go haywire so all the likelihoods in class 2 were zero. Possibly, using a different OpenMx optimizer, such as simulated annealing, might work better. Or perhaps it was just the dummy data for x1:x4 that I used that caused the issue.
You referred to 'classified' which is often a partner to mixture modeling. However, participants' class membership vector is rarely elementary with 1's and 0's. In the event that classification is probabilistic, it may be better to include the uncertainty in their class membership when evaluating the validity of the classes with external variables. It turns out it's just another mixture likelihood :).
Log in or register to post comments
Thanks
Log in or register to post comments