Tue, 11/09/2010 - 21:19

Dear all:

I am new to OpenMx. I have a question non-linear modeling in openMx. I have been trying to utilize a framework that observed measurement variables determine latent variable, and latent variables impact observed outcome variable. The thing is that the way latent variables impact outcome variable is non linear. Is there a way to modify the mxPath command to allow nonlinear estimations?

Thanks!

-Lin

Yes. The trick is to create an mxAlgebra that evaluates the nonlinear function and results in a 1x1 matrix. Then give the name of the mxAlgebra as the label for the chosen mxPath.

Hi Steve,

I added an mxAlgebra to a simple x->y model, calculating x^2

With the path free, I get

Error: In model 'play' the following are both named entities and free parameters: 'nonlin'

But fixing the path, I get

Error: In model 'play' the following are both named entities and fixed parameters: 'nonlin'

Catch 22? Or is a constraint needed, rather than matching labels?

Model code

tbates, Thansk for Information

Oops. Steve's advice is slightly outdated. We changed the rule so that free and fixed parameters would not be confused with matrices and algebras. You need to use square-brackets, like so:

Thanks Mike: Very clear.

Would be helpful to update the error message from the existing one to:

Error: In model ''. '' is used in both a named entity (mxAlgebra) and a parameter label.

Or to be super-duper helpful, add. "If you want to fix a path to the value of an mxAlgebra, refer to the Algebra with square-bracket notation: i.,e, instead of

labels="nonlin"

use

labels="nonlin[1,1]"

I like the super-duper helpful error message! My philosophy with error messages is that they should be somewhat similar to the steel barriers in the middle of highways. These are designed a) to stop the vehicle going, e.g., across the central reservation into oncoming traffic (like a bad software error) and b) to guide the vehicle back onto its likely intended path.

Thanks!

nice..