# Wrong algebra?

Posted on

suzannejak
Joined: 01/06/2010

I keep finding differences between my Mx and OpenMx analysis and I think I must have made a mistake in translating the following algebra:

in Mx:

G = (Y-X)@(A.((A.A)*(V-J))) + X@(A.((U-I)*(A.A)));

in OpenMx (wrong?):

algebraG = mxAlgebra(expression = (Y-X) %x% (A*((A*A)%*%(V-J))) + X %x% (A * ((U-I)%*%(A*A))), name = "G")

Does anyone of you check whether this is correct or not? I hope so, thanks in advance,

Suzanne

## The parser translated your

Assuming there is no bug in the Mx/OpenMx algebra parser, it looks like a match to what you've written.

Log in or register to post comments

In reply to The parser translated your by mspiegel

## Thanks for checking!

Log in or register to post comments

In reply to Thanks for checking! by suzannejak

## different solutions with the same fit

I am translating an Mx script for exploratory factor analysis (with oblique rotation) to openMx. So I have the right solution from Mx.

In openMx, I obtain the same fit as with Mx, but different parameter estimates depending on the startvalues. When I use -.1 as startvalues for factor correlations (matrix F) I get the same solution as with Mx. However, if I use 0, I get another solution (but still the same fit).

I attached my openMX script and the old Mx script, in case you want to take a look. Thanks in advance!

Suzanne

Log in or register to post comments

In reply to different solutions with the same fit by suzannejak

## First, leaving the

The two different sets of results go a bit deeper than the loadings, as the factor correlations vary across models and the D matrix includes a negative value in the second optimization (though the latter doesn't matter in your code). I think this is just a case of the rotation not working the way its supposed to. My (admittedly weak) understanding of the algebra behing exploratory factor analysis and rotation is that it is traditionally a two-step procedure, where rotation is a method for picking one of any number of models that fit equally well. In a single-step procedure, OpenMx could feasibly get a correct minimum for the model but a local minimum for the rotation. I don't know enough about how rotation is handled in other programs to give you a clearer answer.

Log in or register to post comments

In reply to First, leaving the by Ryne

## I am very sorry about the

The script indeed uses the single-step procedure described by Oort (2010), who used Mx. The weird thing is that in Mx it is all fine, but it seems that in openMx the rotation constraint is not working as it should.

This is the paper from Oort:

Oort, F.J. (2010). Likelihood based confidence intervals in exploratory factor analysis. Structural Equation Modeling, 18, 383-396.

Log in or register to post comments