RAM Cholesky Decomposition

Posted on
No user picture. benruk Joined: 12/09/2019
Hello,

I am playing around with different kinds of twin models which I try to implement using the RAM-matrix approach, but not defining the expectation object with mxExpectationRAM(), but with mxExpectationNormal(). My idea is to create the A, S (one for MZs and one for DZs) and F matrices as well as the Identity matrix with the mxMatrix() functions and then creating the expected covariance matrices for MZs and DZs with the mxAlgebra() function following the RAM matrix formula.

It may be some more coding compared to the "normal" matrix approach, but my hope is that the model specified this way can be easily extended: You can simply add covariates into the covariance matrix, define the ACE decomposed variable as a latent factor etc.. I am aware that you can do the same things with the "normal" matrix approach, but following the RAM logic you just have to modify the three matrices accordingly and the formula to create the expected covariance matrices remains the same.

For a first univariate model this works fine. My questions is about implementing a bivariate model. Leohlin (1996; doi: 10.1007/BF02361160) presents different parametrizations of the same multivariate model. I think the correlated factor solution where you specify the covariances between the ACE factors instead of the cross paths can be implemented without problems with the RAM-matrices. But I am not sure how to implement the Cholesky parametrization using the RAM matrices. I am aware of the problems of the Cholesky approach as discussed in Verhulst et al. (2019; doi: 10.1007/s10519-018-9942-y), but for the sake of completeness I am interested in implementing the Cholesky approach with the RAM matrices.

EDIT: To make my point more clearly: Just filling the A matrix with the path coefficients is straightforward. But I am not sure if it is right because there is no explicit multiplication of two lower triangluar matrices. So I was wondering whether I have to rebuild the A matrix in order to ensure this multiplication. But maybe I am on the wrong track here?

Replied on Thu, 10/08/2020 - 07:59
Picture of user. jpritikin Joined: 05/23/2012

The model expected covariance for RAM is F (I − A)^{−1} S (I − A)^{−T} F^T. Suppose S is set to the identity matrix. If you put a Cholesky factor in the (I − A)^{−1} term then it is multiplied with itself. See twoACEc.R at [Hermine's script collection](https://hermine-maes.squarespace.com/#/two/)
Replied on Thu, 10/08/2020 - 10:43
No user picture. benruk Joined: 12/09/2019

I see, but if I set S to the identity, wouldn't that mean that the off-diagonals are zero including the covariances of the latent A's and C's and the diagonals including the error variances of the manifests are set to one?
Replied on Sat, 10/10/2020 - 04:59
No user picture. benruk Joined: 12/09/2019

Thanks for the code. Now I see your point, but I still doubt what are the steps to come to the point where I have all the matrices necessary for the colesky style computation. In the concrete case of a bivariate cholesky model I have 4 observed and 12 latent variables, so 16 in total. That is, my A, S and I matrices have a shape of 16x16, the F matrix of 4x16. I suppose that I have to divide these original matrices to get into the starting position for a Cholesky decomposition with the RAM-matrices? Attached you find the script with the "normal" RAM matrices which may help following my question. The results I get seem valid.
File attachments
Replied on Tue, 10/13/2020 - 10:32
No user picture. benruk Joined: 12/09/2019

No, I want to use the matrix algebra with mxExpectationNormal() using the RAM matrix approach (not mxExpectationRAM()) but I am not sure whether the script I posted above does properly address the Cholesky decomposition.
Replied on Wed, 10/21/2020 - 06:07
No user picture. benruk Joined: 12/09/2019

Now I wrote a script with LISREL matrices and calculated a bivariate model using the matrix approach within OpenMx. I compared the results with the model with RAM matrices and the "manual" matrix approach with an adapted script by [Hermine Maes](https://hermine-maes.squarespace.com/#/two/) (I adapted the starting values and switched from mxRun to mxTryHard). The models have the same fit and the coefficients and SEs are quite similar. All in all, it seems to me that using the RAM or LISREL matrices for the matrix approach seems to be ok, since the results are comparable to the scripts whith the "manual" matrices. But maybe I am missing something?