A structural model I fitted in lavaan 0.7-2 (WLSMV, ordered indicators) converged normally, issued no warnings, and returned TRUE for lavInspect(fit, "post.check"). The solution was nevertheless improper: psi had an eigenvalue of -0.269, because the freely estimated residual covariances among three single-indicator endogenous outcomes were far larger than their residual variances allow, giving residual correlations of -3.55 and -2.28.
This is documented behaviour, not a bug. check.post verifies the variances and the model-implied covariance matrices, and both of those were fine here: the smallest eigenvalues of cov.lv and cov.ov were 0.285 and 0.133.
Would it be worth extending check.post, or adding a separate warning, to psi and theta? The impossible values are already visible in the Std.all column of summary(), but among sixty other numbers they are easy to read past when a model has otherwise converged cleanly.
ATB
Adriaan--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/lavaan/4d4949a0-c164-4efd-a409-6c916da907b1n%40googlegroups.com.
Hi Felipe,
Thanks for looking at the source and for opening the issue.
Your dummy latent variable idea matches what I see. In my own fit the residual covariances of the three ordinal endogenous outcomes appear in both psi and theta, and it is the psi block that fails: eigenvalues .407, .169 and -0.269, with residual correlations of -3.55 and -2.28. The psi diagonal is positive throughout, the smallest being .048, so nothing shows up there and post.check returns TRUE.
The original data cannot be shared. Below is a simulated example with the same structure as the model where I met this: four correlated factors on ordinal indicators, a genuine method component in the items, three single-indicator ordinal outcomes whose residual covariances sem() frees, and an equality-constrained unmeasured latent method factor orthogonal to the substantive factors, as in Podsakoff et al. (2003).
The reprex (drafted with an AI assistant, then checked and corrected):
On lavaan 0.7-2, R 4.6.1, Windows 11 x64 this gives post.check TRUE, psi's smallest eigenvalue -0.1083525, a psi diagonal of .187, .296 and .207, and a residual correlation between y1 and y3 of -1.081. The diagonal is positive and the matrix is improper only through the off-diagonal.
Two observations that may help locate it.
The miss looks like a band rather than a threshold. Pushing further, e_sd = .45 or gamma = .65, gives eigenvalues of -0.364 and -0.762, and post.check then correctly returns FALSE. Across seeds 1 to 8 at this setting, five give FALSE, two give TRUE with a proper psi, and one, seed 1, gives TRUE with an improper one. So the gross failures are caught and the marginal ones are not, which is the awkward way round: a residual correlation of 1.08 is just as impossible as one of 3.55 and much easier to read past. It also means the example sits close to the boundary, so if seed 1 does not reproduce for you, scanning a few seeds should find the band.
It also looks specific to the off-diagonal. Across the seeds above, every case that post.check does catch comes back through "some estimated ov variances are negative", never through the covariance matrix itself, and the same is true if I fix an impossible residual covariance by hand with y1 ~~ 5*y2. In the cases that slip through, no variance is negative and the matrix is non-positive-definite only through its off-diagonal structure.
ATB,
Adriaan