I don't understand how a variance-covariance matrix may not be symmetric. Is it due to the way the numbers are rounded?
If we take the example presented on the merDeriv
package to get the full variance-covariance matrix (fixed and random parameters):
lme4fit <- glmer(corr ~ jmeth + (1 | item), data = finance,
family = binomial, nAGQ = 20)
# variance covariance matrix for all parameters
nnn=vcov(lme4fit, full = TRUE, ranpar = "var")
isSymmetric(nnn)
[1] FALSE
The problem is that I use the variance-covariance matrix obtained in glmer
and merDeriv
in rtmvnorm
(function to generate numbers from a multivariate normal distribution) for Monte-Carlo simulations.
However, I have errors in the following, because the variance-covariance matrix never passes the test of
checkSymmetricPositiveDefinite(H, name = "H")
included in the rtmvnorm
function for the sigma (Covariance matrix used for the random numbers generation).
What should I do?