Skip to content

Commit

Permalink
margloglik: error if cannot fill in unrestricted blocks of covariance…
Browse files Browse the repository at this point in the history
… matrix
  • Loading branch information
ecmerkle committed Apr 15, 2024
1 parent 6a964a6 commit 650c94d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: blavaan
Title: Bayesian Latent Variable Analysis
Version: 0.5-3.1261
Version: 0.5-3.1263
Authors@R: c(person(given = "Edgar", family = "Merkle",
role = c("aut", "cre"),
email = "merklee@missouri.edu",
Expand Down
7 changes: 6 additions & 1 deletion R/margloglik.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ margloglik <- function(lavpartable, lavmodel, lavoptions,
tmpmat <- diag(lavpartable$est[varpars])

if(length(covpars) > 0){
tmpmat[lower.tri(tmpmat)] <- lavpartable$est[covpars]
if(sum(lower.tri(tmpmat)) != length(covpars)){
## TODO need to evaluate blocks of the matrix at a time
stop("blavaan ERROR: margloglik problem evaluating covariance matrix")
} else {
tmpmat[lower.tri(tmpmat)] <- lavpartable$est[covpars]
}
}
tmpmat <- tmpmat + t(tmpmat)
diag(tmpmat) <- diag(tmpmat)/2
Expand Down

0 comments on commit 650c94d

Please sign in to comment.