Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
haziqj committed May 30, 2024
1 parent 63a4291 commit e978b33
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion R/30-inlavaan.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ inlavaan <- function(
# FOR MY DEBUGGING
stop_at_jagtrans = FALSE,

bcontrol = list()) {
bcontrol = list(num.threads = 6)) {

# To play nice with blavaan code
cp = "srs"
Expand Down
4 changes: 2 additions & 2 deletions R/40-lav_export_INLA.R
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ coeffun_inla <- function(
} else {
psi_tab <-
lapply(res$internal.marginals.hyperpar[c(idx_psi)], \(m) {
INLA::inla.tmarginal(function(x) exp(x), m) |>
INLA::inla.tmarginal(exp, m) |>
INLA::inla.zmarginal(silent = TRUE) |>
as.data.frame()
}) |>
Expand Down Expand Up @@ -1501,7 +1501,7 @@ coeffun_inla <- function(
} else {
theta_tab <-
lapply(res$internal.marginals.hyperpar[c(idx_theta)], \(m) {
INLA::inla.tmarginal(function(x) exp(x), m) |>
INLA::inla.tmarginal(exp, m) |>
INLA::inla.zmarginal(silent = TRUE) |>
as.data.frame()
}) |>
Expand Down
10 changes: 2 additions & 8 deletions inst/demo.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,12 @@ myModel <- '

fit <- isem(
model = myModel,
data = scale(PoliticalDemocracy, center = FALSE, scale = FALSE),
meanstructure = TRUE,
# stop_at_jagtrans = TRUE,
data = PoliticalDemocracy,
# meanstructure = TRUE,
verbose = TRUE
)

tmp <- fit
tmp$the_model$f$rgeneric$definition("Q")

with(tmp$the_model$f$rgeneric$definition("Q", .debug = TRUE), {
solve(Lambda %*% IminB %*% Psi %*% t(IminB) %*% t(Lambda) + Theta)
})



Expand Down

0 comments on commit e978b33

Please sign in to comment.