Skip to content

Commit

Permalink
Merge pull request #61 from sfcheung/devel
Browse files Browse the repository at this point in the history
0.1.3.16: Fix x_net_y for nonconvergence
  • Loading branch information
sfcheung authored Sep 15, 2024
2 parents 4be8ed6 + f92f917 commit 6a0dc73
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: modelbpp
Title: Model BIC Posterior Probability
Version: 0.1.3.15
Version: 0.1.3.16
Authors@R:
c(person(given = "Shu Fai",
family = "Cheung",
Expand Down Expand Up @@ -28,7 +28,7 @@ Description: Fits the neighboring models of a fitted
License: GPL (>= 3)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Suggests:
knitr,
rmarkdown,
Expand Down
8 changes: 7 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# modelbpp 0.1.3.15
# modelbpp 0.1.3.16

## New Features

Expand Down Expand Up @@ -61,6 +61,12 @@
Print them by setting `cumulative_bpp`
to `TRUE`. (0.1.3.15)

- Update an internal function to handle
nonconvergence in checking nested
relation. Only affect the graphs and
only happen in some rare cases.
(0.1.3.16)

## Bug Fixes

- The `must_not_add` argument should
Expand Down
8 changes: 7 additions & 1 deletion R/helpers3_for_model_graph.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ models_network2 <- function(object,
y = models[[j]],
x_df = df_i,
y_df = df_j)
if (is.na(net_chk)) next
if (net_chk == "x_within_y") {
net_out[i, j] <- df_i - df_j
} else if (net_chk == "y_within_x") {
Expand Down Expand Up @@ -274,8 +275,13 @@ x_net_y <- function(x,
sample.nobs = f1_nobs,
sample.th = implied_threshold,
WLS.V = f1_WLS.V,
NACOV = f1_NACOV)
NACOV = f1_NACOV,
warn = FALSE)
if (!lavaan::lavInspect(f2_1, "converged")) {
# If estimation failed to converged,
# then do not assume a nested relation.
# Should not be a major problem because this only
# affect the graph.
return(NA)
}
f2_1_chisq <- unname(lavaan::fitMeasures(f2_1, fit.measures = "chisq"))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# modelbpp: Model BIC Posterior Probability <img src="man/figures/logo.png" align="right" />

(Version 0.1.3.15 updated on 2024-09-04, [release history](https://sfcheung.github.io/modelbpp/news/index.html))
(Version 0.1.3.16 updated on 2024-09-15, [release history](https://sfcheung.github.io/modelbpp/news/index.html))

This package is for assessing model uncertainty in structural
equation modeling (SEM) by the BIC posterior
Expand Down

0 comments on commit 6a0dc73

Please sign in to comment.