You are here

Estimation of class transitions

3 posts / 0 new
Last post
lands101's picture
Offline
Joined: 10/15/2009 - 10:26
Estimation of class transitions

Currently, I am studying three mixed variables in which I expect dissimilar classes for each of the three variables. It is not unlike example 8.2 in the Mplus manual (only with continuous variables). I can do this in Mplus, but I am wondering if it is also possible in OpenMx. So I need to define separate classes for each variable, but the definition of the model is a puzzle to me. Is it possible (yet)? If so, how do I define the matrix of class probabilities and how do I bind the six classes and their objectives together?

Ryne's picture
Offline
Joined: 07/31/2009 - 15:12
My copy of the Mplus manual

My copy of the Mplus manual lists example 8.2 as a two class growth mixture model with user-specified starting values, which should be exactly what is given in the gmm.R file in the 'posterior class probabilities and entropy' thread we both just came from. I'll be basing this off of your description instead of that Mplus example.

Rather than think of each person being simultaneously in three classes (one of two classes in each of the three variables), I'd think of there being 8 classes, one for each combination of binary class membership (2^3), with appropriate constraints across classes. To make things very simple, we'll say you have three variables x, y and z. These three variables are each assumed to be mixtures of two normal distributions, varying in their mean and variance across classes. I'll further assume that each class differs in its covariances between the three variables for simplicity, though including those parameters may make the model difficult to estimate. I'm writing code directly in the window, so I apologize for unforseen errors. Here's how I'd make the model for class 1 (or class 111, as it is).

class1 <- mxModel("Class111",
  mxMatrix("Symm", 3, 3, free=TRUE,
    values=c(1, .5, .5, 1, .5, 1),
    labels=c("x1", "xy111", "xz111", "y1", "yz111", "z1"),
    name="Cov111"),
  mxMatrix("Full", 1, 3, TRUE, 0, c("mx1", "my1", "mz1"), name="Mean111"),
  mxFIMLObjective("Cov111", "Mean111", dimnames=names(data))
 
Class 2 (or class 112) would then have change the z1 and mz1 parameters, leaving the x1, mx1, y1 and my1 alone.
 
<code>
class2 <- mxModel("Class112",
  mxMatrix("Symm", 3, 3, free=TRUE,
    values=c(1, .5, .5, 1, .5, 1),
    labels=c("x1", "xy112", "xz112", "y1", "yz112", "z2"),
    name="Cov112"),
  mxMatrix("Full", 1, 3, TRUE, 0, c("mx1", "my1", "mz2"), name="Mean112"),
  mxFIMLObjective("Cov112", "Mean112", dimnames=names(data))
 
And so on and so on for all eight classes. Classes 111, 112, 121 and 122 would all have the same parameters for x, while classes 211, 212, 221 and 222 would have a second set of x parameters, essentially creating two classes of x. Put them all in a container model and define the class probabilities just as we did in the previous thread.
 
-ryne
lands101's picture
Offline
Joined: 10/15/2009 - 10:26
Sorrie I led you astray with

Sorrie I led you astray with the example: it is example 8.12 (in my manual for Mplus4.1). I'll try to extend your example.