So I am familiar with being able to refer to an MxModel object, and in particular its objective function, by name, thusly:
algObj <- mxAlgebra(-2*sum(log(classProbs[1,1]%x%Class1.objective + classProbs[2,1]%x%Class2.objective)), name="mixtureObj")
where Class1 and Class2 are models, and their vector=T (individual observation vector) likelihoods are returned in Class1.objective & Class2.objective vectors. However, I am trying to specify a model with hundreds of models, and it would be much more convenient to be able to refer to them by an array index variable, so that I could use something like
algObj <- mxAlgebra(-2*sum(log(classProbs[1,1]%x%submodels.objective + classProbs[2,1]%x%submodels.objective)), name="mixtureObj")
with a view to having a much simplified matrix algebra form for the -2lnL, constructed by, e.g., cbind'ing all the vector=TRUE'd likelihoods (not quite sure how to do this within mxAlgebra() either), and post-multiplying that matrix by the classProbs matrix.
I have a feeling I may be needing mxRowObjective() but perhaps someone else has tackled this problem?