How to use "mxFitFunctionAlgebra" instead of "mxAlgebraObjective"

Posted on
Picture of user. rabil Joined: 01/14/2010

This code used to work using "mxAlgebraObjective", but now says I have to use "mxFitFunctionAlgebra" instead of "mxAlgebraObjective".

###############
models_1_v4 <- mxModel("Models_1",
Model_1_t1_v4,
Model_1_t2_v4,
mxAlgebra(
Model_1_t1_v4.objective+
Model_1_t2_v4.objective,
name="multi"),

# mxAlgebraObjective("multi"),

mxFitFunctionAlgebra(algebra = "multi")
)

m1_fit_v4 <- mxRun(models_1_v4)
##################

I tried changing ".objective" to ".fitfunction" but this did not work either. What am I doing wrong?

Replied on Thu, 03/10/2016 - 20:46
Picture of user. AdminHunter Joined: Mar 01, 2013

In reply to by rabil

One benefit of the mxFitFunctionMultigroup() is that is allows you, in many cases, to get the factor scores from a multigroup model. It gives you a list of factor scores arrays. Each element of the list corresponds to one of the groups.

See this: https://github.com/OpenMx/OpenMx/blob/master/inst/models/nightly/FactorScores.R#L191-L209