# Converting ClassicMx script to OpenMx

2 posts / 0 new
Offline
Joined: 03/09/2016 - 16:21
Converting ClassicMx script to OpenMx
AttachmentSize
44.54 KB
359.6 KB

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.

Offline
Joined: 01/24/2014 - 12:15
extraneous solve()

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.