You are here

\stnd cov2cor?

6 posts / 0 new
Last post
smedland's picture
Offline
Joined: 08/04/2009 - 16:08
\stnd cov2cor?

Hi
I'm looking for the OpenMx equivilent to the mx \stnd function. Searching the page the cov2cor() function within mxAlgebra pops up a couple of times but looks to have been discontinued(?) in the more recent releases - any similar function currently availble or implemented in the near future?
thanks
Sarah

smedland's picture
Offline
Joined: 08/04/2009 - 16:08
the work arround (below) is

the work arround (below) is hanging and taking forever - any ideas on speeding this up?

mxAlgebra( expression= solve(sqrt(IexpCovMZ)) %% expCovMZ %% solve(sqrt(IexpCovMZ)), name="expCorMZ" )

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
We don't perform automatic

We don't perform automatic common subexpression elimination, so the matrix inverse is computed twice. Use the following:

inverse <- mxAlgebra(solve(sqrt(I * expCovMZ)), name = "inverse")
expCorMZ <- mxAlgebra(inverse %*% expCovMZ %*% inverse, name = "expCorMZ")
tbates's picture
Offline
Joined: 07/31/2009 - 14:25
%&% there's quadratic

%&% there's quadratic multiplier to help:
mxAlgebra(solve(sqrt(I * expCovMZ)), name = "inverse")
mxAlgebra(inverse %&% expCovMZ , name = "expCorMZ")

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
Opened a ticket for cov2cor

Opened a ticket for cov2cor http://openmx.psyc.virginia.edu/issue/2010/06/mxalgebra-wishlist.

neale's picture
Offline
Joined: 07/31/2009 - 15:14
Yes, workshop participants

Yes, workshop participants are struggling in the absence of cov2cor. There's a need for it to be somewhat robust, e.g., if there's a zero or negative value in diagonal element a[i,i] then elements [i,] and [,i] of the result should be NA rather than throwing an error (though a warning may be appropriate).