Skip to content
Prev 1671 / 5636 Next

[R-meta] Non-positive definite variance-covariance matrix

Erik,

A few possibilities occur to me:
1) Is the data frame sorted by ID? If not, then the split-calculate-bldiag
calculations will return a matrix that is not in the same order as the
original data frame.
2) Why do you use sapply rather than lapply in creating the remove_zero_mat
object? Perhaps it makes no difference.
3) To further isolate the problem, it might be useful to check for
positive-definiteness of the component covariance matrices. The matrixcalc
package provides a handy function for doing so:
library(matrixcalc)
lapply(remove_zero_mat, is.positive.definite)

James

On Sun, Aug 18, 2019 at 12:42 PM E. van der Meulen <E.vdrMeulen_1 at uvt.nl>
wrote: