Tim and I were discussing my recent botched growth mixture code, and have a proposal for a future version of mixture modeling which should be a little bit easier on the user. It consists of two parts:
-A new matrix type, "Prop" or proportional. A (row-wise) proportional matrix consists of k rows which must sum to a constant (1, unless someone really wants to be able to change it). A 1 x k prop matrix would be used for model-wide class probabilities, while an n x k prop matrix would be used for individual class probabilities. Prop matrices also open us up to compositional data and associated models.
-A mixture optimizer, named something like "mxMixtureObjective." This objective function would take the names of submodels (or their objectives) as arguments, as well as a matrix indicating class probabilities. In addition to making mixture/LCA specification simpler, it also opens us up to optimization of the mixture routines above and beyond improvements to the FIML objective.
Assuming that R objects model1
and model2
are models representing two classes with omx names "M1"
and "M2"
, this model would look something like this:
mxModel("Mixture Example", mxData(myDataFrame, type="raw"), model1, model2, mxMatrix("Prop", 1, 2, free=TRUE, start=.5, labels=c("classprob1", "classprob2"), name="class"), mxMixtureObjective(c("M1", "M2"), "class") ) This could be shortened more with a default class probability matrix, but that's probably too far. This proposal frees users from specifying their own constraints on class probabilities (i.e., to keep them between zero and one with a unit sum) and simplifies the objective function with possible speedups in the future. It may be too big for a 1.0 release, but that's part of why we have a wishlist.