Hi,

I have been running longitudinal multivariate cholesky decomposition. This seems o run ok but the problem is comparing nested models to ACE model and the Saturated model.

The error message is:

Error: The following error occurred while evaluating the subexpression 'solve(sqrt(CholAE.I * CholAE.C))' during the evaluation of 'iSDc' in model 'CholAE' : Lapack routine dgesv: system is exactly singular: U[1,1] = 0

The code:

# -----------------------------------------------------------------------------

# Cholesky Decomposition AE Model

# ------------------------------------------------------------------------------

CholAeModel <- mxModel( CholAceFit, name="CholAE" )

CholAeModel <- omxSetParameters( CholAeModel, labels=cLabs, free=FALSE, values=0 )

CholAeFit <- mxRun(CholAeModel)

mxCompare(CholAceFit, CholAeFit)

The issue here is that the CholAE.I *CholAE.C matrix cannot be inverted, because it has a zero in the first element (U[1,1]). This error message is, I agree, not very transparent. It seems to stem from the attempted standardization of the A C and E matrices so that confidence intervals can be calculated on the proportions of variance and the genetic/C/E correlations. These are reasonable things to do, but lead to problems on fitting submodels because inverting a matrix with zeroes in the diagonal (as is the case with C when it has had its elements fixed to zero) is not going to work - it involves dividing by zero which is a Bad Thing.

To solve your problem you could wipe out the standardization parts of the model

and subsequent references to these objects in the model:

`# Print the rG, rC, rE matrices (above, in the summary output you will find them with 95% CI) CholAceFit$Acor CholAceFit$Ccor CholAceFit$Ecor CholAceFit$Phcor CholAceFit$scalar`

Should you want them to inspect, you could use mxEval() to obtain them later, e.g.,

If, however, you wanted to see the confidence intervals (they've been commented out in your script anyway so I somewhat doubt it) then you could add those algebras expected to work. So A,C and E for the ACE model, or just A and E for the AE model with something like

Hi Neale,

Thank you very much for the detailed answer, this works now and the problem is resolved.