Not positive definite

74 views
Skip to first unread message

rachelly...@gmail.com

unread,
Mar 4, 2016, 12:30:58 PM3/4/16
to lavaan
Hi, 
I am trying to test the fit of a model where I am fixing or freeing constraints. I first ran it with no constraints and it converged. However, when I constrained the variables across wave then across measure, I received a not positive definite warning each time. 

I have adjusted the model before by fixing certain factors to 0. 

MPLUS provides output with a non positive definite warning suggesting which is the "problematic variable." Is there a way to ask R which would be the best variable to fix to zero?


Terrence Jorgensen

unread,
Mar 5, 2016, 5:57:23 AM3/5/16
to lavaan
lavaan gives you a warning message about which matrix is nonpositive definite, and the message also tells you how to investigate it (using the inspect() function -- which has actually been superseded by the lavInspect() function).  If your lavaan object is called "fit" and the error message was about the latent variable covariance matrix, then you could inspect it like this:

lavInspect(fit, what = "cov.lv")

A negative value on the diagonal would be an out-of-bounds estimated variance, making it nonpositive definite.  If the problem is a correlation being beyond +/- 1, then you can find it looking at the correlation matrix:

lavInspect(fit, what = "cor.lv")

Look at the ?lavInspect help page to see what else you can look up.

Terry

rachelly...@gmail.com

unread,
Mar 10, 2016, 12:32:37 PM3/10/16
to lavaan
Thanks!
Reply all
Reply to author
Forward
0 new messages