From 48af49db2142f14be913e76fbcd061f743c291b1 Mon Sep 17 00:00:00 2001 From: ecmerkle Date: Mon, 28 Aug 2023 14:18:48 -0500 Subject: [PATCH] modify list structure of inits for vb() --- DESCRIPTION | 2 +- R/blav_object_methods.R | 9 +++++++-- R/blavaan.R | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 16765d10..3d12170b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: blavaan Title: Bayesian Latent Variable Analysis -Version: 0.4-9.1158 +Version: 0.4-9.1159 Authors@R: c(person(given = "Edgar", family = "Merkle", role = c("aut", "cre"), email = "merklee@missouri.edu", diff --git a/R/blav_object_methods.R b/R/blav_object_methods.R index 7ba41591..6af2f5cd 100644 --- a/R/blav_object_methods.R +++ b/R/blav_object_methods.R @@ -127,8 +127,13 @@ function(object, header = TRUE, } PE$group[PE$group == 0] <- 1 - attributes(PE)$information <- "MCMC" - attributes(PE)$se <- "MCMC" + if(object@call$target == "vb") { + attributes(PE)$information <- "VB" + attributes(PE)$se <- "VB" + } else { + attributes(PE)$information <- "MCMC" + attributes(PE)$se <- "MCMC" + } ## 95% HPD; FIXME display blanks for equality-constrained parameters ## (like Std.Err column) diff --git a/R/blavaan.R b/R/blavaan.R index 150745aa..f2d34a74 100644 --- a/R/blavaan.R +++ b/R/blavaan.R @@ -712,6 +712,7 @@ blavaan <- function(..., # default lavaan arguments rjcall <- "stan" } else if(usevb){ rjcall <- "vb" + rjarg$init <- rjarg$init[[1]] } else if(target == "cmdstan"){ fname <- paste0("stanmarg_", packageDescription("blavaan")["Version"]) fdir <- paste0(cmdstanr::cmdstan_path(), "/")