Package: bgms 0.2.0.0

Maarten Marsman

bgms: Bayesian Analysis of Graphical Models

Bayesian estimation and edge selection for graphical models of mixed binary, ordinal, and continuous variables. The variable types determine the model: an ordinal Markov random field for discrete data, a Gaussian graphical model for continuous data, or a mixed Markov random field combining both. Edge inclusion is determined through spike-and-slab priors, yielding posterior inclusion probabilities for each edge. Supports multi-group comparison via 'bgmCompare()', simulation, prediction, and missing data imputation.

Authors:Maarten Marsman [aut, cre], Don van den Bergh [aut], Nikola Sekulovski [ctb], Giuseppe Arena [ctb], Laura Groot [ctb], Gali Geller [ctb]

bgms_0.2.0.0.tar.gz
bgms_0.2.0.0.zip(r-4.7-x86_64)bgms_0.2.0.0.zip(r-4.7-arm64)bgms_0.2.0.0.zip(r-4.6-x86_64)bgms_0.2.0.0.zip(r-4.6-arm64)bgms_0.2.0.0.zip(r-4.5-x86_64)
bgms_0.2.0.0.tgz(r-4.6-x86_64)bgms_0.2.0.0.tgz(r-4.6-arm64)bgms_0.2.0.0.tgz(r-4.5-x86_64)bgms_0.2.0.0.tgz(r-4.5-arm64)
bgms_0.2.0.0.tar.gz(r-4.7-arm64)bgms_0.2.0.0.tar.gz(r-4.7-x86_64)bgms_0.2.0.0.tar.gz(r-4.6-arm64)bgms_0.2.0.0.tar.gz(r-4.6-x86_64)
bgms_0.2.0.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
bgms/json (API)

# Install 'bgms' in R:
install.packages('bgms', repos = c('https://bayesian-graphical-modelling-lab.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/bayesian-graphical-modelling-lab/bgms/issues

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
Datasets:
  • ADHD - ADHD Symptom Checklist for Children Aged 6-8 Years
  • Boredom - Short Boredom Proneness Scale Responses
  • Wenchuan - PTSD Symptoms in Wenchuan Earthquake Survivors Who Lost a Child

On CRAN:

Conda:

bayesian-inferencebayesian-statisticsedge-selectiongaussian-graphical-modelgraphical-modelshamiltonian-monte-carlomarkov-chain-monte-carlomarkov-random-fieldmcmcmetropolis-hastingsnetwork-analysisparallel-computingspike-and-slabopenblascpp

9.09 score 9 stars 1 packages 109 scripts 738 downloads 39 exports 12 dependencies

Last updated from:6126312a02. Checks:15 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK419
linux-devel-x86_64OK691
source / vignettesOK682
linux-release-arm64OK443
linux-release-x86_64OK680
macos-release-arm64OK367
macos-release-x86_64OK692
macos-oldrel-arm64OK439
macos-oldrel-x86_64OK794
windows-devel-arm64OK683
windows-devel-x86_64OK808
windows-release-arm64OK691
windows-release-x86_64OK764
windows-oldrel-x86_64OK789
wasm-releaseOK207

Exports:bernoulli_priorbeta_bernoulli_priorbeta_prime_priorbgmbgmComparecalibration_checkcauchy_priorexponential_priorextract_argumentsextract_category_thresholdsextract_centralityextract_edge_indicatorsextract_essextract_group_paramsextract_inclusion_bfextract_indicator_priorsextract_indicatorsextract_log_oddsextract_main_effectsextract_pairwise_interactionsextract_pairwise_thresholdsextract_partial_correlationsextract_posterior_inclusion_probabilitiesextract_precisionextract_prior_inclusion_probabilitiesextract_rhatextract_sbmgamma_priormrfSamplernormal_priorplot_edge_posteriorprior_sensitivity_checksample_ggm_priorsample_graph_priorsample_sbm_priorsbm_priorsimulate_mrfsummarize_zratio_gaugeverdicts

Dependencies:BHclidqrnglifecyclerbibutilsRcppRcppArmadilloRcppParallelRdpackrlangS7sitmo

Checking Prior Sensitivity
Why the scale is the reader's problem | The check | The anchored curve | Run-to-run noise | The chosen scale versus the data | Cost and samplers

Last update: 2026-08-03
Started: 2026-08-01

Checking your fitted model
Introduction | What the evidence settles | Are the conditional predictions calibrated? | Checking the joint distribution with simulate() | What the three checks answer | Next steps

Last update: 2026-08-03
Started: 2026-08-01

Diagnostics and Spike-and-Slab Summaries
Introduction | Example fit | Convergence diagnostics | Diagnostics for edge-selected parameters | Traceplots | Spike-and-slab summaries | Bayes factors | NUTS diagnostics | E-BFMI | Divergent transitions | Tree depth | Non-reversible steps | Warmup and equilibration | Hierarchical prior trust gauge | The two alarms | Fits that skip the approximation instead | What to do when a chain is flagged | Next steps

Last update: 2026-08-03
Started: 2025-09-23

Getting Started with bgms
The models | A worked example | What the fit contains | Which edges the evidence settles | The edge evidence plot | Priors | The Gaussian and mixed members | Comparing groups | Where to go next | References

Last update: 2026-08-03
Started: 2025-09-23

Model Comparison with bgmCompare
Introduction | ADHD dataset | Fitting a model | Posterior summaries | Visualizing the groups | Next steps | References

Last update: 2026-08-03
Started: 2025-09-23

Readme and manuals

Help Manual

Help pageTopics
Access elements of a bgmCompare object$.bgmCompare [[.bgmCompare
Access elements of a bgms object$.bgms [[.bgms
ADHD Symptom Checklist for Children Aged 6-8 YearsADHD
Bernoulli Prior for Inclusion Indicatorsbernoulli_prior
Beta-Bernoulli Prior for Inclusion Indicatorsbeta_bernoulli_prior
Beta-Prime Prior for Model Parametersbeta_prime_prior
Bayesian Estimation or Edge Selection for Markov Random Fieldsbgm
Bayesian Estimation and Variable Selection for Group Differences in Markov Random FieldsbgmCompare
Short Boredom Proneness Scale ResponsesBoredom
Calibration Checkcalibration_check
Cauchy Prior for Model Parameterscauchy_prior
Extract Coefficients from a bgmCompare Objectcoef.bgmCompare
Extract Coefficients from a bgms Objectcoef.bgms
Exponential Prior for Scale Parametersexponential_prior
Extract Model Argumentsextract_arguments
Extract Category Threshold Estimatesextract_category_thresholds
Extract Posterior Centralityextract_centrality
Extract Effective Sample Sizeextract_ess
Extract Group-Specific Parametersextract_group_params
Extract Rao-Blackwellized Inclusion Bayes Factorsextract_inclusion_bf
Extract Indicator Prior Structureextract_indicator_priors
Extract Indicator Samplesextract_indicators
Extract Posterior Mean Log-Odds (Pairwise Interactions)extract_log_odds
Extract Main Effect Estimatesextract_main_effects
Extract Pairwise Interaction Samplesextract_pairwise_interactions
Extract Posterior Mean Partial Correlationsextract_partial_correlations
Extract Posterior Inclusion Probabilitiesextract_posterior_inclusion_probabilities
Extract Posterior Mean Precision Matrixextract_precision
Extract Prior Inclusion Probabilitiesextract_prior_inclusion_probabilities
Extract R-hat Convergence Diagnosticsextract_rhat
Extract Stochastic Block Model Summariesextract_sbm
Gamma Prior for Scale Parametersgamma_prior
Normal Prior for Model Parametersnormal_prior
Plot the Posterior of One Edge Weightplot_edge_posterior
Plot a Fitted bgmCompare Modelplot.bgmCompare
Plot a Fitted bgms Modelplot.bgms
Plot a Calibration Checkplot.bgms_calibration
Plot Posterior Centralityplot.bgms_centrality
Plot a Prior Sensitivity Checkplot.bgms_prior_sensitivity
Predict Conditional Probabilities from a Fitted bgmCompare Modelpredict.bgmCompare
Predict Conditional Probabilities from a Fitted bgms Modelpredict.bgms
Print method for 'bgmCompare' objectsprint.bgmCompare
Print method for 'bgms' objectsprint.bgms
Print a Calibration Checkprint.bgms_calibration
Print a Prior Sensitivity Checkprint.bgms_prior_sensitivity
Print Edge Verdictsprint.bgms_verdicts
Prior Sensitivity of Inclusion Verdictsprior_sensitivity_check
Sample from the GGM (Partial-Association) Priorsample_ggm_prior
Sample from the Graph Priorsample_graph_prior
Sample from the Stochastic-Block Edge-Prior Hyperpriorsample_sbm_prior
Stochastic Block Model Prior for Inclusion Indicatorssbm_prior
Simulate Observations from a Markov Random Fieldsimulate_mrf
Simulate Data from a Fitted bgmCompare Modelsimulate.bgmCompare
Simulate Data from a Fitted bgms Modelsimulate.bgms
Summarize the Hierarchical Prior Trust Gaugesummarize_zratio_gauge
Summary method for 'bgmCompare' objectssummary.bgmCompare
Summary method for 'bgms' objectssummary.bgms
Summarize Posterior Centralitysummary.bgms_centrality
Edge Verdicts and Their Monte Carlo Fragilityverdicts
PTSD Symptoms in Wenchuan Earthquake Survivors Who Lost a ChildWenchuan