m <- lvm(Y1~eta,Y2~eta,Y3~eta)
latent(m) <- ~eta
d <- lava::sim(m,1e2)
e <- estimate(m, d)
## basic pre-computation
res1 <- moments2(e, data = d, initialize = TRUE, usefit = FALSE,
score = TRUE, information = TRUE, hessian = TRUE, vcov = TRUE,
dVcov = TRUE, dVcov.robust = TRUE, residuals = TRUE, leverage = FALSE,
derivative = "analytic")
res1$skeleton$param$Sigma
## full pre-computation
res2 <- moments2(e, param = coef(e), data = d, initialize = TRUE, usefit = TRUE,
score = TRUE, information = TRUE, hessian = TRUE, vcov = TRUE,
dVcov = TRUE, dVcov.robust = TRUE, residuals = TRUE, leverage = FALSE,
derivative = "analytic")
res2$moment$Omega
Run the code above in your browser using DataLab