bgms logo bgms logo
  • Overview
  • Get Started
  • Guide
  • Reference
  • Manual
  • Examples

bgms

Bayesian Graphical Models in R

  • Estimate networks of mixed binary, ordinal, and continuous variables
  • Use Bayesian variable selection to:
    • Quantify evidence for including or excluding edges
    • Detect group differences in network parameters
  • Discover communities of related edges with Bayesian edge clustering
  • Fast posterior inference with:
    • No-U-Turn sampler
    • Parallel multi-chain sampling
    • C++ backend

Explore structure in your network with principled Bayesian inference.

Get Started

User’s Guide

Quick Start

# Install from CRAN
install.packages("bgms")

# Fit an ordinal Markov random field to the Wenchuan earthquake data
library(bgms)
data(Wenchuan)
fit <- bgm(Wenchuan)
summary(fit)

User’s Guide

Learn bgms from the ground up: installation, basic usage, and statistical concepts behind Bayesian graphical models for mixed variable types.

Guide →

Reference

Complete documentation for all R functions: bgm(), bgmCompare(), S3 methods, and extractor functions.

Reference →

Manual

Technical documentation for contributors: C++ architecture, MCMC algorithms, and implementation details.

Manual →

Citation

If you use bgms in your research, please cite the software package.

Choose a citation format (version is set to the documented release):

Marsman, M., & van den Bergh, D. (2026). bgms: Bayesian analysis of graphical models (R package, version 0.2.0.0). https://CRAN.R-project.org/package=bgms

Marsman, Maarten, and Don van den Bergh. 2026. bgms: Bayesian Analysis of Graphical Models. R package, version 0.2.0.0. https://CRAN.R-project.org/package=bgms.


@Manual{bgms-package,
  title   = {bgms: Bayesian Analysis of Graphical Models},
  author  = {Marsman, Maarten and van den Bergh, Don},
  year    = {2026},
  note    = {R package version 0.2.0.0},
  url     = {https://CRAN.R-project.org/package=bgms}
}

TY  - COMP
TI  - bgms: Bayesian Analysis of Graphical Models
AU  - Marsman, Maarten
AU  - van den Bergh, Don
PY  - 2026
N1  - R package version 0.2.0.0
UR  - https://CRAN.R-project.org/package=bgms
ER  -

To generate citations directly from your installed package in R:

citation("bgms")
toBibtex(citation("bgms"))

Developed by the BGM Lab

Built with Quarto

  • Edit this page
  • Report an issue