You are here

Error message when using mxRowObjective

12 posts / 0 new
Last post
jdellava's picture
Offline
Joined: 10/14/2009 - 21:13
Error message when using mxRowObjective

Hi All,

I am trying to fit the alternate forms comorbidity model with raw data. When I run the script (attached) I get the following error message:

Error: The entity 'MZExpectedFrequency' in model 'MZ' generated the error message: 'lbound' must have length equal to diag(covariance).

Any suggestions?

Cheers,
Jocilyn

Steve's picture
Offline
Joined: 07/30/2009 - 14:03
Hi Jocilyn, The script did

Hi Jocilyn,

The script did not come through. Could you try attaching it again?

Cheers,
Steve

jdellava's picture
Offline
Joined: 10/14/2009 - 21:13
Sorry about that, here are

Sorry about that, here are the files.

Cheers,
Jocilyn

Ryne's picture
Offline
Joined: 07/31/2009 - 15:12
That looks like an error in

That looks like an error in the omxMnor call. If I'm reading your code right, your expected covariance and means matrices are for four variables, while your lower and upper bounds are for two variables. I haven't messed around with the GenEpi library enough to be absolutely sure, but it appears that omxMnor requires that the lengths of the mean, lbound and ubound vectors be equal to the number of rows (and columns) in the covariance matrix. The error showed up as an error in the mxAlgebra call 'MZExpectedFrequencies' because the GenEpi functions are helper functions outside of the core OpenMx library, so they evaluated as part of the algebra. Change the lbound and ubound arguments in omxMnor to nvar*2 and you should be fine.

Hope this helps.

ryne

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
I'll take a look at the

I'll take a look at the script later today. But to respond to an earlier post, omxMnor is one of the matrix functions supported by mxAlgebra() expressions: http://openmx.psyc.virginia.edu/wiki/matrix-operators-and-functions.

Ryne's picture
Offline
Joined: 07/31/2009 - 15:12
Thanks for the clarification,

Thanks for the clarification, and apologies for the error. I was able to replicate the error message using just the omxMnor function, which can be fixed by supplying the same dimensionality to the lbound and ubound vectors as the means vector. I didn't know that we had mxAlgebra expressions that could exist as objects outside of MxAlgebra objects, so I foolishly assumed that it was a GenEpi function. My mistake.

jdellava's picture
Offline
Joined: 10/14/2009 - 21:13
Thank you for the help. I

Thank you for the help. I made a few changes to the script (attached) and got the following:

Running AlternateForms

*** caught bus error ***
address 0x1, cause 'non-existent physical address'

Traceback:
1: .Call("callNPSOL", objective, startVals, constraints, matrices, parameters, algebras, data, intervalList, communication, options, state, PACKAGE = "OpenMx")
2: runHelper(model, frontendStart, intervals, silent, suppressWarnings, unsafe, checkpoint, useSocket, onlyFrontend)
3: mxRun(AltFormsModel)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: summary(AltFormsRun)
Selection:

Any suggestions?

Thank you,
Jocilyn

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
The script needs to be

The script needs to be altered in the following way to get it to run. It does crash.

data <- read.table("data.csv", header=TRUE, sep=",")
data[,c(selVars)] <- mxFactor(data[,c(selVars)], levels=c(0,1))
jdellava's picture
Offline
Joined: 10/14/2009 - 21:13
Hi all, Thank you for the

Hi all,

Thank you for the help. The script still seems to generate the same error message when I run it. Are there any changes I can make to prevent the crash?

Cheers,
Jocilyn

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
We're working on it.

We're working on it. Evidence points to the presence of a definition variable that is triggering a bug. I imagine it would be difficult to transform the model into one without a definition variable. We'll find the bug within a few days from now.

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
The crash has been fixed.

The crash has been fixed. You can grab the latest version from the subversion repository, or wait until the next binary release. Subversion directions are here: http://openmx.psyc.virginia.edu/wiki/howto-build-openmx-source-repository

jdellava's picture
Offline
Joined: 10/14/2009 - 21:13
Thank you!

Thank you!