Skip to content

Update compatability with bgms = 0.1.6.4#1

Open
sekulovskin wants to merge 1 commit intomainfrom
update_easybgm
Open

Update compatability with bgms = 0.1.6.4#1
sekulovskin wants to merge 1 commit intomainfrom
update_easybgm

Conversation

@sekulovskin
Copy link

@sekulovskin sekulovskin commented Mar 25, 2026

Update easybgm for full compatibility with bgms >= 0.1.6.4.

Problem / Motivation

easybgm relied on direct field access to internal bgms objects (e.g., fit$arguments$..., fit$posterior_summary_pairwise$...) and legacy version checks (packageVersion("bgms") < "0.1.6"), which are incompatible with bgms 0.1.6.4. Most importantly, continuous and mixed data were routed to BGGM by default, even though bgms now supports all data types.

Proposed Changes / New Functionality

  • bgms is now the default for all data types (continuous, ordinal, binary, mixed, blume-capel)
  • bgms extractor functions (extract_arguments(), extract_pairwise_interactions(), extract_rhat(), etc.) are now (hopefully) used consistently throughout the package.
  • Rescaled parameters added to output: $partial_correlations, $precision_matrix, $log_odds
  • BDgraph now correctly fits GGM (not GCGM) for continuous data when having missing values
  • Group comparison for continuous/mixed to require explicit package = "BGGM"
  • All legacy packageVersion() checks and deprecated parameter names removed
  • All the changes in the analyses are detailed in the help files. So it helps to also read those.

bgms is now the default for all types

fit <- easybgm(data, type = "continuous")

Per-variable type specification (bgms only)

fit <- easybgm(data[, 1:3], type = c("ordinal", "ordinal", "continuous"))

Interpretable scales available in output

fit$partial_correlations # for continuous models
fit$log_odds # for ordinal/binary models

BDgraph now correctly fits GGM instead of GCGM when the data has missing values (see also below)

fit <- easybgm(data, type = "continuous", package = "BDgraph")

Open questions:

  • How to properly set the baseline category value for blume-capel variables? Say, I have a mixed model where the last three variables are b-c: How do I set the reference cateogry per variable then (i.e., in cases when I don't want all three variables to have the same value for the reference cateogry)?
  • As mentioned above, I now force bgms always when type = "binary". I think this is a reasonable choice.

Files Edited

R/easybgm.R — Default routing to bgms for all types; per-variable type handling; rewritten documentation
R/functions.bgms.R — Replaced all direct field access with extractor functions; added interpretable parameter scales
R/functions.bgmscompare.R — Removed legacy code paths; migrated to extractors
R/easybgm_compare.R — Added validation gate for continuous/mixed without BGGM; rewritten documentation
R/summary.easybgm.R — Removed version checks; added note about available parameter scales
R/summary.easybgm_compare.R — Removed version checks
R/plottingfunctions.bgms.R — Removed version checks and legacy save conditionals
R/plottingfunctions.bgmCompare.R — Same cleanup
R/plottingfunctions.easybgm.R — Removed version checks
R/functions.bdgraph.R — Fixed GGM vs GCGM routing for continuous data
DESCRIPTION — Version bumped to 0.4.0; bgms dependency set to >= 0.1.6.4
tests/testthat/test-easybgm.R — Added tests for new functionality
Testing and Validation
Unit Tests: All 237 tests pass (0 failures, 0 warnings, 0 skips)
Numerical Validation: Verified extractor outputs match expected structure across all model types (GGM, OMRF, mixed MRF) including edge cases (single-variable blocks)
R CMD check: roxygen2::roxygenise() and tools::checkRd() pass cleanly for all .Rd files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant