Converting ClassicMx script to OpenMx

Posted on
No user picture. amr438 Joined: 03/09/2016
Hello,

I am currently trying to recreate ClassicMx script for an ECOT model into OpenMx and I am coming across an error that I am not sure how to solve.
When I run the model I get the following error:

Error: The following error occurred while evaluating the subexpression 'solve(ecot.matF %*% solve(ecot.matI - ecot.matA) %*% ecot.matM %*% ecot.matU)' during the evaluation of 'MZtoss.expMeanMZtoss' in model 'modelECOT' : 'a' (4 x 1) must be square

I have attached the ClassicMX code and OpenMx code.

Replied on Tue, 03/13/2018 - 14:19
Picture of user. AdminRobK Joined: 01/24/2014

There is an extraneous solve() operation in the MxAlgebras that define the model-expected means. I think what you probably want to do is

t(ecot.matF%*%solve(ecot.matI-ecot.matA)%*%ecot.matM%*%ecot.matU)

, although I don't really understand what the 'U' matrix is supposed to do.