Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7c894ef
updated the name of the summarySBM function in the roxygen text (#40)
sekulovskin Apr 12, 2025
b3e4209
setup pr-commands and styler (#43)
vandenman Jun 3, 2025
8253987
Update organization
MaartenMarsman Jun 27, 2025
39222e6
New datasets: 'ADHD' and 'Boredom (#45)
L-Groot Jul 2, 2025
80e3621
Delete inst/.DS_Store
MaartenMarsman Jul 2, 2025
198a8bb
Merge pull request #46 from Bayesian-Graphical-Modelling-Lab/MaartenM…
vandenman Jul 2, 2025
91060ae
Delete data/.DS_Store
MaartenMarsman Jul 2, 2025
bb13cba
Delete .DS_Store
MaartenMarsman Jul 3, 2025
c044edb
Streamline dataset documentation.
MaartenMarsman Jul 3, 2025
2997289
Update DESCRIPTION, NEWS, and .gitignore
MaartenMarsman Jul 3, 2025
6d04bc3
Update bgmCompare documentation
MaartenMarsman Jul 3, 2025
0a394fc
Update bgm and bgmCompare documentation
MaartenMarsman Jul 3, 2025
a135694
Update version number.
MaartenMarsman Jul 3, 2025
be8fa30
Fix issue with group indexing in bgmCompare
MaartenMarsman Jul 3, 2025
72fa740
Update code for bgm example.
MaartenMarsman Jul 4, 2025
ea7a42f
Update references
MaartenMarsman Jul 7, 2025
63d56e8
APA style referencing Readme
MaartenMarsman Jul 7, 2025
a90efd6
Badges
MaartenMarsman Jul 7, 2025
3334b9a
Custom exp and log (#44)
vandenman Jul 9, 2025
d817c27
Update News
MaartenMarsman Jul 10, 2025
7ceadb8
add sticker (#49)
vandenman Jul 11, 2025
95ed61d
Fix out of bounds issue for bgmCompare + na.action = "impute".
MaartenMarsman Jul 11, 2025
c76de1a
Update readme, and relocate sticker
MaartenMarsman Jul 11, 2025
a91793e
update website link (#50)
vandenman Jul 17, 2025
6d9314f
cran update
MaartenMarsman Aug 3, 2025
8239504
Merge branch 'main' of https://github.com/Bayesian-Graphical-Modellin…
MaartenMarsman Aug 3, 2025
b660efe
Resolve merge conflicts
MaartenMarsman Sep 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
^renv$
^renv\.lock$
^.*\.Rproj$
^\.Rproj\.user$

Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
issue_comment:
types: [created]

name: pr-commands.yaml

permissions: read-all

jobs:
document:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
name: document
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::roxygen2
needs: pr-document

- name: Document
run: roxygen2::roxygenise()
shell: Rscript {0}

- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add man/\* NAMESPACE
git commit -m 'Document'

- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

style:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}
name: style
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-r@v2

- name: Install dependencies
run: install.packages(c("styler", "roxygen2"))
shell: Rscript {0}

- name: Style
run: |
source("inst/styler/bgms_style.R")
styler::style_pkg(
style = bgms_style,
exclude_files = c("R/RcppExports\\.R", "R/cpp11\\.R", "R/import-standalone.*\\.R", "\\.Rprofile\\.R")
)

shell: Rscript {0}

- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add \*.R
git commit -m 'Style'

- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ src/*.o
src/*.so
src/*.dll
inst/doc
/doc/
/Meta/
.DS_Store
16 changes: 11 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ Package: bgms
Type: Package
Title: Bayesian Analysis of Networks of Binary and/or Ordinal Variables
Version: 0.1.5.0
<<<<<<< HEAD
Date: 2025-08-03
=======
Date: 2025-06-27
>>>>>>> adaMala
Authors@R: c(
person("Maarten", "Marsman", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-5309-7502")),
Expand All @@ -16,19 +20,21 @@ Authors@R: c(
comment = c(ORCID = "0000-0002-9838-7308"))
)
Maintainer: Maarten Marsman <[email protected]>
Description: Bayesian variable selection methods for analyzing the structure of a Markov Random Field model for a network of binary and/or ordinal variables. Details of the implemented methods can be found in: Marsman, van den Bergh, and Haslbeck (in press) <doi:10.31234/osf.io/ukwrf>.
Description: Bayesian variable selection methods for analyzing the structure of a Markov Random Field model for a network of binary and/or ordinal variables. Details of the implemented methods can be found in: Marsman, van den Bergh, and Haslbeck (2025) <doi:10.31234/osf.io/ukwrf>.
Copyright: Includes datasets 'ADHD' and 'Boredom', which are licensed under CC-BY 4. See individual data documentation for license and citation.
License: GPL (>= 2)
URL: https://maartenmarsman.github.io/bgms/
BugReports: https://github.com/MaartenMarsman/bgms/issues
URL: https://Bayesian-Graphical-Modelling-Lab.github.io/bgms/
BugReports: https://github.com/Bayesian-Graphical-Modelling-Lab/bgms/issues
Imports: Rcpp (>= 1.0.7), RcppParallel, Rdpack, methods, coda, dqrng
RdMacros: Rdpack
LinkingTo: Rcpp, RcppProgress, RcppArmadillo, RcppParallel, dqrng, BH
RoxygenNote: 7.3.2
Depends:
R (>= 2.10)
R (>= 3.5)
LazyData: true
Encoding: UTF-8
Suggests:
ggplot2,
knitr,
parallel,
qgraph,
Expand All @@ -37,4 +43,4 @@ Suggests:
testthat (>= 3.0.0)
VignetteBuilder: knitr
Config/testthat/edition: 3
Config/Needs/website: tidyverse/tidytemplate
Config/Needs/website: tidyverse/tidytemplate
Binary file added Meta/vignette.rds
Binary file not shown.
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
# bgms 0.1.4.3
# bgms 0.1.5.0

## New features

* The bgmCompare function now allows for network comparison for two or more groups.
* The new summary_sbm function can be used to summarize the output from the bgm function with the "Stochastic-Block" prior.
* Two new data sets are included in the package: ADHD and Boredom.

## Other changes

* The bgm function with the "Stochastic-Block" prior can now also return the sampled allocations and block probabilities, and sample and return the number of blocks.
* The underlying R and c++ functions received a massive update to improve their efficiency and maintainance.
* Repository moved to the Bayesian Graphical Modelling Lab organization.
* Included custom c++ implementations for exp and log on Windows.

## Bug fixes

* Fixed a bug in the bgmCompare function with selecting group differences of blume-capel parameters. Parameter differences that were not selected and should be fixed to zero were still updated.
* Fixed a bug in the bgmCompare function with handling the samples of blume-capel parameters. Output was not properly stored.
* Fixed a bug in the bgmCompare function with handling threshold estimation when missing categories and main_model = "Free". The sufficient statistics and number of categories were not computed correctly.
* Partially fixed a bug in which the bgms package is slower on Windows than on Linux or MacOS. This is because the computation of exp and log using the gcc compiler for Windows is really slow. With a custom c++ implementation, the speed is now closer to the speed achieved on Linux and MacOS.

# bgms 0.1.4.2

Expand Down
15 changes: 13 additions & 2 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

get_explog_switch <- function() {
.Call(`_bgms_get_explog_switch`)
}

rcpp_ieee754_exp <- function(x) {
.Call(`_bgms_rcpp_ieee754_exp`, x)
}

rcpp_ieee754_log <- function(x) {
.Call(`_bgms_rcpp_ieee754_log`, x)
}

run_bgmCompare_parallel <- function(observations, num_groups, counts_per_category, blume_capel_stats, pairwise_stats, num_categories, main_alpha, main_beta, pairwise_scale, difference_scale, difference_selection_alpha, difference_selection_beta, difference_prior, iter, burnin, na_impute, missing_data_indices, is_ordinal_variable, baseline_category, difference_selection, main_effect_indices, pairwise_effect_indices, target_accept, nuts_max_depth, learn_mass_matrix, projection, group_membership, group_indices, interaction_index_matrix, inclusion_probability, num_chains, nThreads, seed, update_method, hmc_num_leapfrogs) {
.Call(`_bgms_run_bgmCompare_parallel`, observations, num_groups, counts_per_category, blume_capel_stats, pairwise_stats, num_categories, main_alpha, main_beta, pairwise_scale, difference_scale, difference_selection_alpha, difference_selection_beta, difference_prior, iter, burnin, na_impute, missing_data_indices, is_ordinal_variable, baseline_category, difference_selection, main_effect_indices, pairwise_effect_indices, target_accept, nuts_max_depth, learn_mass_matrix, projection, group_membership, group_indices, interaction_index_matrix, inclusion_probability, num_chains, nThreads, seed, update_method, hmc_num_leapfrogs)
}
Expand All @@ -19,5 +31,4 @@ sample_bcomrf_gibbs <- function(no_states, no_variables, no_categories, interact

compute_Vn_mfm_sbm <- function(no_variables, dirichlet_alpha, t_max, lambda) {
.Call(`_bgms_compute_Vn_mfm_sbm`, no_variables, dirichlet_alpha, t_max, lambda)
}

}
Loading
Loading