Latent Covariance Helper Function

2 replies [Last post]
mhunter's picture
Offline
Joined: 07/31/2009

Hi All,

Is there already a helper function to allow users to easily extract the model-implied covariance matrix for the latent variables in a RAM-type model? If not, then I created one (attached). If there was already one, then I've duplicated it under possibly different implementation.

If this is useful to many people, then it could be incorporated into OpenMx at some point.

mhunter's picture
Offline
Joined: 07/31/2009
Silly latent attachments.

Silly latent attachments.

AttachmentSize
funcMxLatentCov.R 2 KB
Steve's picture
Offline
Joined: 07/30/2009
Nice. You might wish to use

Nice.

You might wish to use mxEval to obtain the A and S matrix so that you aren't directly accessing what is inside a slot. Granted, this has a bit more overhead, but it is negligible in comparison with being a bit more future proof.

I would also consider how to exit from the function if type!="RAM".