Skip to content

Commit 4438e6d

Browse files
committed
allow for all-zero Sigma if multilevel, and level > 1
1 parent 242c257 commit 4438e6d

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: lavaan
22
Title: Latent Variable Analysis
3-
Version: 0.6-22.2517
3+
Version: 0.6-22.2520
44
Authors@R: c(person(given = "Yves", family = "Rosseel",
55
role = c("aut", "cre"),
66
email = "Yves.Rosseel@UGent.be",

R/lav_graph.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ lav_graph_topological_matrix <- function(
325325
if (topborderfixed) addrows <- 1L
326326
if (bottomborderfixed) addrows <- 2L
327327
rowmax <- max(colmax, colmax[1L] + addrows, colmax[length(colmax)] + addrows)
328-
if (addrows > 0L) { # adapt rows for nodes in maxrow and inner columns
328+
if (addrows > 0L) { # adapt rows for nodes in maxrow and inner columns
329329
welke <- which(rvcol > 1L & rvcol < length(colmax) & rvrow == max(colmax))
330330
rvrow[welke] <- rowmax
331331
}

R/lav_model_loglik.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ lav_model_loglik <- function(lavdata = NULL,
4141
# catch all-zero Sigma (new in 0.6-20)
4242
nblocks <- lavmodel@nblocks
4343
for (b in seq_len(nblocks)) {
44+
# except for level-2, where Sigma could be all zero (0.6-22)
45+
if (lavdata@nlevels > 1L && ((b %% lavdata@nlevels) != 1)) {
46+
next
47+
}
4448
if (lavmodel@conditional.x) {
4549
if (all(lavimplied$res.cov[[b]] == 0)) {
4650
logl.ok <- FALSE

0 commit comments

Comments
 (0)