Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
ca6425c
docs: update mixed MRF implementation plan
MaartenMarsman Mar 5, 2026
6454d37
feat: add MixedMRFModel skeleton and data structures
MaartenMarsman Mar 5, 2026
8bca7d2
test: add mixed MRF skeleton tests
MaartenMarsman Mar 5, 2026
5df7c3b
fix: resolve test-bgm-spec failures and hidden files NOTE
MaartenMarsman Mar 5, 2026
34f73db
feat: add conditional PL likelihood functions (B.1)
MaartenMarsman Mar 5, 2026
b0265e9
feat: add conditional PL Metropolis updates (B.3/B.4)
MaartenMarsman Mar 5, 2026
a5fe0e4
feat: add mixed MRF sampler test helper and fix c3 constant
MaartenMarsman Mar 6, 2026
ede74a1
docs: add Phase B+ rank-1 Cholesky optimization plan
MaartenMarsman Mar 6, 2026
e65ae57
refactor: rank-1 Cholesky optimization for Kyy updates (audit #6a)
MaartenMarsman Mar 6, 2026
c5823e1
test: add rank-1 Cholesky correctness tests (audit #6b)
MaartenMarsman Mar 6, 2026
d2d858c
feat: marginal pseudo-likelihood for mixed MRF
MaartenMarsman Mar 6, 2026
2b2b7db
test: marginal pseudo-likelihood tests (Phase C.5)
MaartenMarsman Mar 6, 2026
ca16817
feat: mixed MRF edge selection (Phase D)
MaartenMarsman Mar 6, 2026
ea8c41b
test: mixed MRF edge selection (Phase D)
MaartenMarsman Mar 6, 2026
8701450
feat: wire mixed MRF into bgm() R interface (Phase 5.1–5.2)
MaartenMarsman Mar 6, 2026
7a3910f
feat: Robbins-Monro proposal-SD adaptation for MixedMRFModel (Phase F)
MaartenMarsman Mar 6, 2026
e44e131
feat: mixed MRF simulation and prediction (Phase G)
MaartenMarsman Mar 7, 2026
137a5dd
docs: code quality pass — styler, lintr, C++ documentation (audit #8)
MaartenMarsman Mar 7, 2026
5e28c30
docs: update package documentation for mixed MRF support (audit #9)
MaartenMarsman Mar 7, 2026
1901c89
docs: add integrated NUTS+MH hybrid sampler plan for mixed MRF
MaartenMarsman Mar 7, 2026
b19afe3
fix: remove double-counting of edge-indicator updates in mixed MRF
MaartenMarsman Mar 7, 2026
4dff31c
refactor: NUTS vectorization excludes Kyy from gradient block (phase 1)
MaartenMarsman Mar 7, 2026
dcae43e
feat: logp_and_gradient for mixed MRF (conditional + marginal PL) (ph…
MaartenMarsman Mar 7, 2026
5a85fb1
feat: extract do_kyy_metropolis_step for hybrid NUTS+MH (phase 3)
MaartenMarsman Mar 7, 2026
2203f7a
fix: correct 3 marginal PL gradient bugs in mixed MRF
MaartenMarsman Mar 7, 2026
31f6773
feat: add hybrid NUTS sampler for mixed MRF models
MaartenMarsman Mar 7, 2026
04b9562
fix: remove test scaffolding, wire NUTS diagnostics, fix gradient ove…
MaartenMarsman Mar 8, 2026
84a7ba1
docs: add phases H-L to mixed MRF implementation plan
MaartenMarsman Mar 8, 2026
9e21374
feat: missing data imputation for mixed MRF (Phase I)
MaartenMarsman Mar 8, 2026
cad3426
perf: use MY_LOG/MY_EXP macros in GGM and OMRF models (Phase J)
MaartenMarsman Mar 9, 2026
676b49f
docs: naming conformance + MY_LOG/MY_EXP for MixedMRFModel (audit K, …
MaartenMarsman Mar 9, 2026
d58848b
refactor: code deduplication + move cholupdate to src/math (audit K, …
MaartenMarsman Mar 9, 2026
b944cd4
fix: document overflow-guard bitwise break, regenerate HMC fixtures, …
MaartenMarsman Mar 9, 2026
ee3b9ba
docs: R output audit — extract_main_effects, GGM quadratic fix, print…
MaartenMarsman Mar 9, 2026
0544d95
chore: untrack dev/ directory from git
MaartenMarsman Mar 9, 2026
a4416c9
docs: ignore and untrack paper directory
MaartenMarsman Mar 9, 2026
0e3c757
test: consolidate fixture lists into helper-fixtures.R, add coverage …
MaartenMarsman Mar 9, 2026
47205e4
style: apply bgms_style and lintr formatting
MaartenMarsman Mar 9, 2026
d978eac
tests: mixed MRF test suite — tolerance, likelihood, simulate/predict…
MaartenMarsman Mar 9, 2026
3ce2f96
refactor: separate quadratic effects from main effects in GGM output
MaartenMarsman Mar 9, 2026
8edb437
fix: move R API calls out of TBB workers to prevent C stack overflow …
MaartenMarsman Mar 9, 2026
9dc6caf
tests: suppress progress bars in mixed MRF tests, catch double deprec…
MaartenMarsman Mar 9, 2026
19ecb3b
fix: use bgm()-style parallelFor pattern in simulation workers to pre…
MaartenMarsman Mar 9, 2026
85f22b4
test: keep CI on assertion-based tests only
MaartenMarsman Mar 10, 2026
1fb0293
fix: address PR comments 1 and 2
MaartenMarsman Mar 10, 2026
0e9584b
fix: clarify variable_bool semantics and dead-branch guard (audit #3)
MaartenMarsman Mar 10, 2026
db0ecc8
fix: replace nested expect_warning with capture_warnings (audit #6)
MaartenMarsman Mar 10, 2026
735de01
docs: enable roxygen2 markdown mode, regenerate Rd files (audit #4)
MaartenMarsman Mar 10, 2026
f9d2e6a
docs: remove opaque AI-session references from mixed MRF comments (au…
MaartenMarsman Mar 10, 2026
16593ca
docs: replace reversible-jump/birth-death with MH add-delete terminol…
MaartenMarsman Mar 10, 2026
f2997a1
docs: fix lifecycle version for extract_category_thresholds deprecati…
MaartenMarsman Mar 10, 2026
6236b1b
docs: mention continuous and mixed variables in bgm() roxygen
MaartenMarsman Mar 10, 2026
bb71002
docs: drop coupling-strength claim from @param pseudolikelihood
MaartenMarsman Mar 10, 2026
d7905a8
docs: fix broken Rd cross-reference in coef.bgmCompare, regenerate Rd…
MaartenMarsman Mar 10, 2026
61ca822
docs: add pre-commit checks to copilot instructions; restyle R code
MaartenMarsman Mar 10, 2026
7d67b9b
tests: mixed MRF full factorial expansion (8 fixtures, 12 test blocks)
MaartenMarsman Mar 10, 2026
964c882
docs: fix malformed Rd markup for variable_type param
MaartenMarsman Mar 10, 2026
410c427
fix: use post-NA row count for num_cases in mixed MRF spec
MaartenMarsman Mar 10, 2026
56ec60b
fix: add error for unexpected source in generate_data() test helper
MaartenMarsman Mar 10, 2026
e6eb320
perf: eliminate redundant ESS/Rhat computation in post-sampling
MaartenMarsman Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

# GitHub / CI
^\.github$
^CONTRIBUTING\.md$

# Hidden config files (development only)
^\.lintr$
^\.editorconfig$

# R CMD build artifacts
^doc$
Expand Down
42 changes: 35 additions & 7 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ Rules for AI agents (Copilot, Claude, etc.) working on this codebase.
be captured, use `<-`. With `=` R treats it as a named argument.
Example: `expect_message(result <- foo(), "pattern")`.
- No space between `if`/`for`/`while` and `(`: write `if(`, not `if (`.
- Enforced by `inst/styler/bgms_style.R`. Run before committing:
```r
source("inst/styler/bgms_style.R")
styler::style_pkg(style = bgms_style)
```
After running, check test files for `expect_*(result = ...)` and
revert those to `result <- ...`.
- Enforced by `inst/styler/bgms_style.R` (see Pre-commit checks).

## Exported R functions (Tier 1)

Expand Down Expand Up @@ -80,6 +74,40 @@ Rules for AI agents (Copilot, Claude, etc.) working on this codebase.
the same commit.
- When adding a new exported function, add it to `_pkgdown.yml`.

## Pre-commit checks

Before every commit that touches R code, run these checks and fix
any issues they report:

1. **Style** — enforce the project code style:
```r
source("inst/styler/bgms_style.R")
styler::style_pkg(style = bgms_style)
```
After running, check test files for `expect_*(result = ...)` and
revert those to `result <- ...`.

2. **Lint** — catch issues the CI lint workflow will flag:
```r
lintr::lint_package()
```
The `.lintr` config enables `T_and_F_symbol_linter()` and
`seq_linter()` (among defaults). Fix all findings before
committing.

3. **Roxygen** — regenerate Rd files if any roxygen comment changed:
```r
roxygen2::roxygenise()
```
Stage the regenerated `man/*.Rd` files in the same commit.

4. **R CMD check** — if the change is non-trivial, run:
```r
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"))
```
CI uses `error-on = "warning"`, so warnings are treated as
failures.

## Do not

- Add `@keywords internal` to exported functions.
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/nightly-validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: nightly-validation
on:
schedule:
- cron: '0 3 * * 1,4' # Monday and Thursday at 3 AM UTC
workflow_dispatch: {}

jobs:
validate:
runs-on: ubuntu-latest
timeout-minutes: 120
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
BGMS_RUN_SLOW_TESTS: true

steps:
- uses: actions/checkout@v5

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

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::devtools

- name: Run full test suite (including slow tests)
run: Rscript -e 'devtools::test()'

35 changes: 35 additions & 0 deletions .github/workflows/weekly-compliance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: weekly-compliance
on:
schedule:
- cron: '0 5 * * 0' # Sunday at 5 AM UTC
workflow_dispatch: {}

jobs:
compliance:
runs-on: ubuntu-latest
timeout-minutes: 120
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v5

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

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

- name: Install mixedGM (needed for cross-package tests)
run: Rscript -e 'remotes::install_github("MaartenMarsman/mixedGM")'

- name: Generate compliance fixtures (if missing)
run: |
if [ ! -f tests/compliance/fixtures/manifest.rds ]; then
Rscript tests/compliance/generate_fixtures.R || true
fi

- name: Run bitwise compliance (OMRF configs only)
run: Rscript tests/compliance/test_compliance.R

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
**/.Rhistory
.RData
.Ruserdata
.vscode/
src/*.o
src/*.so
src/*.dll
Expand All @@ -18,4 +19,5 @@ src/sources.mk
docs/*
/doc/
/inst/doc/
dev/plans/
dev/
/paper/
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ Authors@R: c(
)
Maintainer: Maarten Marsman <[email protected]>
Description: Bayesian estimation and variable selection for Markov random field
models of networks of binary, ordinal, and continuous variables. Supports
Gaussian graphical models, multi-group comparison via 'bgmCompare', and
provides simulation, prediction, and missing data imputation.
models of networks of binary, ordinal, continuous, and mixed variables.
Supports ordinal MRFs, Gaussian graphical models, mixed MRFs combining
discrete and continuous variables, multi-group comparison via 'bgmCompare',
and provides simulation, prediction, and missing data imputation.
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://Bayesian-Graphical-Modelling-Lab.github.io/bgms/, https://github.com/Bayesian-Graphical-Modelling-Lab/bgms
Expand All @@ -39,6 +40,7 @@ LinkingTo:
RcppParallel,
dqrng,
BH
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.3
Depends:
R (>= 3.5)
Expand Down
5 changes: 3 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ S3method(coef,bgmCompare)
S3method(coef,bgms)
S3method(extract_arguments,bgmCompare)
S3method(extract_arguments,bgms)
S3method(extract_category_thresholds,bgmCompare)
S3method(extract_category_thresholds,bgms)
S3method(extract_ess,bgmCompare)
S3method(extract_ess,bgms)
S3method(extract_group_params,bgmCompare)
S3method(extract_indicator_priors,bgmCompare)
S3method(extract_indicator_priors,bgms)
S3method(extract_indicators,bgmCompare)
S3method(extract_indicators,bgms)
S3method(extract_main_effects,bgmCompare)
S3method(extract_main_effects,bgms)
S3method(extract_pairwise_interactions,bgmCompare)
S3method(extract_pairwise_interactions,bgms)
S3method(extract_posterior_inclusion_probabilities,bgmCompare)
Expand Down Expand Up @@ -40,6 +40,7 @@ export(extract_ess)
export(extract_group_params)
export(extract_indicator_priors)
export(extract_indicators)
export(extract_main_effects)
export(extract_pairwise_interactions)
export(extract_pairwise_thresholds)
export(extract_posterior_inclusion_probabilities)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## New features

* Mixed MRF models: `bgm()` accepts a per-variable `variable_type` vector that mixes `"ordinal"`, `"blume-capel"`, and `"continuous"` types to estimate networks with both discrete and continuous variables. `simulate.bgms()` and `predict.bgms()` also support mixed models.
* Gaussian graphical models (GGM): `bgm(x, variable_type = "continuous")` fits a GGM with Bayesian edge selection. Pairwise effects are partial correlations from the precision matrix.
* Missing data imputation: `na_action = "impute"` integrates over missing values during MCMC sampling for both ordinal and continuous models.

Expand Down
16 changes: 16 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ compute_conditional_probs <- function(observations, predict_vars, pairwise, main
.Call(`_bgms_compute_conditional_probs`, observations, predict_vars, pairwise, main, num_categories, variable_type, baseline_category)
}

compute_conditional_mixed <- function(x_observations, y_observations, predict_vars, Kxx, Kxy, Kyy, mux, muy, num_categories, variable_type, baseline_category) {
.Call(`_bgms_compute_conditional_mixed`, x_observations, y_observations, predict_vars, Kxx, Kxy, Kyy, mux, muy, num_categories, variable_type, baseline_category)
}

sample_omrf_gibbs <- function(num_states, num_variables, num_categories, pairwise, main, iter, seed) {
.Call(`_bgms_sample_omrf_gibbs`, num_states, num_variables, num_categories, pairwise, main, iter, seed)
}
Expand All @@ -45,10 +49,22 @@ run_ggm_simulation_parallel <- function(pairwise_samples, main_samples, draw_ind
.Call(`_bgms_run_ggm_simulation_parallel`, pairwise_samples, main_samples, draw_indices, num_states, num_variables, means, nThreads, seed, progress_type)
}

sample_mixed_mrf_gibbs <- function(num_states, Kxx_r, Kxy_r, Kyy_r, mux_r, muy_r, num_categories_r, variable_type_r, baseline_category_r, iter, seed) {
.Call(`_bgms_sample_mixed_mrf_gibbs`, num_states, Kxx_r, Kxy_r, Kyy_r, mux_r, muy_r, num_categories_r, variable_type_r, baseline_category_r, iter, seed)
}

run_mixed_simulation_parallel <- function(mux_samples, kxx_samples, muy_samples, kyy_samples, kxy_samples, draw_indices, num_states, p, q, num_categories, variable_type_r, baseline_category, iter, nThreads, seed, progress_type) {
.Call(`_bgms_run_mixed_simulation_parallel`, mux_samples, kxx_samples, muy_samples, kyy_samples, kxy_samples, draw_indices, num_states, p, q, num_categories, variable_type_r, baseline_category, iter, nThreads, seed, progress_type)
}

sample_ggm <- function(inputFromR, prior_inclusion_prob, initial_edge_indicators, no_iter, no_warmup, no_chains, edge_selection, seed, no_threads, progress_type, edge_prior = "Bernoulli", beta_bernoulli_alpha = 1.0, beta_bernoulli_beta = 1.0, beta_bernoulli_alpha_between = 1.0, beta_bernoulli_beta_between = 1.0, dirichlet_alpha = 1.0, lambda = 1.0, na_impute = FALSE, missing_index_nullable = NULL) {
.Call(`_bgms_sample_ggm`, inputFromR, prior_inclusion_prob, initial_edge_indicators, no_iter, no_warmup, no_chains, edge_selection, seed, no_threads, progress_type, edge_prior, beta_bernoulli_alpha, beta_bernoulli_beta, beta_bernoulli_alpha_between, beta_bernoulli_beta_between, dirichlet_alpha, lambda, na_impute, missing_index_nullable)
}

sample_mixed_mrf <- function(inputFromR, prior_inclusion_prob, initial_edge_indicators, no_iter, no_warmup, no_chains, edge_selection, seed, no_threads, progress_type, edge_prior = "Bernoulli", beta_bernoulli_alpha = 1.0, beta_bernoulli_beta = 1.0, beta_bernoulli_alpha_between = 1.0, beta_bernoulli_beta_between = 1.0, dirichlet_alpha = 1.0, lambda = 1.0, sampler_type = "mh", target_acceptance = 0.80, max_tree_depth = 10L, num_leapfrogs = 100L, na_impute = FALSE, missing_index_discrete_nullable = NULL, missing_index_continuous_nullable = NULL) {
.Call(`_bgms_sample_mixed_mrf`, inputFromR, prior_inclusion_prob, initial_edge_indicators, no_iter, no_warmup, no_chains, edge_selection, seed, no_threads, progress_type, edge_prior, beta_bernoulli_alpha, beta_bernoulli_beta, beta_bernoulli_alpha_between, beta_bernoulli_beta_between, dirichlet_alpha, lambda, sampler_type, target_acceptance, max_tree_depth, num_leapfrogs, na_impute, missing_index_discrete_nullable, missing_index_continuous_nullable)
}

sample_omrf <- function(inputFromR, prior_inclusion_prob, initial_edge_indicators, no_iter, no_warmup, no_chains, edge_selection, sampler_type, seed, no_threads, progress_type, edge_prior = "Bernoulli", na_impute = FALSE, missing_index_nullable = NULL, beta_bernoulli_alpha = 1.0, beta_bernoulli_beta = 1.0, beta_bernoulli_alpha_between = 1.0, beta_bernoulli_beta_between = 1.0, dirichlet_alpha = 1.0, lambda = 1.0, target_acceptance = 0.8, max_tree_depth = 10L, num_leapfrogs = 10L, pairwise_scaling_factors_nullable = NULL) {
.Call(`_bgms_sample_omrf`, inputFromR, prior_inclusion_prob, initial_edge_indicators, no_iter, no_warmup, no_chains, edge_selection, sampler_type, seed, no_threads, progress_type, edge_prior, na_impute, missing_index_nullable, beta_bernoulli_alpha, beta_bernoulli_beta, beta_bernoulli_alpha_between, beta_bernoulli_beta_between, dirichlet_alpha, lambda, target_acceptance, max_tree_depth, num_leapfrogs, pairwise_scaling_factors_nullable)
}
Expand Down
62 changes: 47 additions & 15 deletions R/bgm.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#' Bayesian Estimation or Edge Selection for Markov Random Fields
#'
#' @description
#' The \code{bgm} function estimates the pseudoposterior distribution of
#' category thresholds (main effects) and pairwise interaction parameters of a
#' Markov Random Field (MRF) model for binary and/or ordinal variables.
#' Optionally, it performs Bayesian edge selection using spike-and-slab
#' priors to infer the network structure.
#' The \code{bgm} function estimates the pseudoposterior distribution of the
#' parameters of a Markov Random Field (MRF) for binary, ordinal, continuous,
#' or mixed (discrete and continuous) variables. Depending on the variable
#' types, the model is an ordinal MRF, a Gaussian graphical model (GGM), or a
#' mixed MRF. Optionally, it performs Bayesian edge selection using
#' spike-and-slab priors to infer the network structure.
#'
#' @details
#' This function models the joint distribution of binary and ordinal variables
#' using a Markov Random Field, with support for edge selection through Bayesian
#' variable selection. The statistical foundation of the model is described in
#' This function models the joint distribution of binary, ordinal, continuous,
#' or mixed variables using a Markov Random Field, with support for edge
#' selection through Bayesian variable selection. The statistical foundation
#' of the model is described in
#' \insertCite{MarsmanVandenBerghHaslbeck_2025;textual}{bgms}, where the ordinal
#' MRF model and its Bayesian estimation procedure were first introduced. While
#' the implementation in \pkg{bgms} has since been extended and updated (e.g.,
Expand Down Expand Up @@ -172,8 +174,11 @@
#' Blume–Capel variables, all categories are retained.
#'
#' @param variable_type Character or character vector. Specifies the type of
#' each variable in \code{x}. Allowed values: \code{"ordinal"} or
#' \code{"blume-capel"}. Binary variables are automatically treated as
#' each variable in \code{x}. Allowed values: \code{"ordinal"},
#' \code{"blume-capel"}, or \code{"continuous"}. A single string applies
#' to all variables. A per-variable vector that mixes discrete
#' (\code{"ordinal"} / \code{"blume-capel"}) and \code{"continuous"}
#' types fits a mixed MRF. Binary variables are automatically treated as
#' \code{"ordinal"}. Default: \code{"ordinal"}.
#'
#' @param baseline_category Integer or vector. Baseline category used in
Expand Down Expand Up @@ -212,6 +217,21 @@
#' score endpoints \eqn{(-b, m-b)}.
#' Default: \code{FALSE}.
#'
#' @param pseudolikelihood Character. Specifies the pseudo-likelihood
#' approximation used for mixed MRF models (ignored for pure ordinal or
#' pure continuous data). Options:
#' \describe{
#' \item{\code{"conditional"}}{Conditions on the observed continuous
#' variables when computing the discrete full conditionals. Faster
#' because the discrete pseudo-likelihood does not depend on the
#' continuous precision matrix.}
#' \item{\code{"marginal"}}{Integrates out the continuous variables,
#' giving discrete full conditionals that account for induced
#' interactions through the continuous block. More expensive per
#' iteration.}
#' }
#' Default: \code{"conditional"}.
#'
#' @param main_alpha,main_beta Double. Shape parameters of the
#' beta-prime prior for threshold parameters. Must be positive. If equal,
#' the prior is symmetric. Defaults: \code{main_alpha = 0.5} and
Expand Down Expand Up @@ -307,16 +327,26 @@
#' Main components include:
#' \itemize{
#' \item \code{posterior_summary_main}: Data frame with posterior summaries
#' (mean, sd, MCSE, ESS, Rhat) for category threshold parameters.
#' (mean, sd, MCSE, ESS, Rhat) for main-effect parameters.
#' For OMRF models these are category thresholds;
#' for mixed MRF models these are discrete thresholds and
#' continuous means. \code{NULL} for GGM models (no main effects).
#' \item \code{posterior_summary_quadratic}: Data frame with posterior
#' summaries for the precision matrix diagonal. Present for GGM and
#' mixed MRF models; \code{NULL} for OMRF models.
#' \item \code{posterior_summary_pairwise}: Data frame with posterior
#' summaries for pairwise interaction parameters.
#' \item \code{posterior_summary_indicator}: Data frame with posterior
#' summaries for edge inclusion indicators (if \code{edge_selection = TRUE}).
#'
#' \item \code{posterior_mean_main}: Matrix of posterior mean thresholds
#' (rows = variables, cols = categories or parameters).
#' \item \code{posterior_mean_main}: Posterior mean of main-effect
#' parameters. \code{NULL} for GGM models. For OMRF: a matrix
#' (p x max_categories) of category thresholds. For mixed MRF: a list
#' with \code{$discrete} (threshold matrix) and \code{$continuous}
#' (q x 1 matrix of means).
#' \item \code{posterior_mean_pairwise}: Symmetric matrix of posterior mean
#' pairwise interaction strengths.
#' pairwise interaction strengths. For GGM and mixed MRF models the
#' precision matrix diagonal is included on the matrix diagonal.
#' \item \code{posterior_mean_indicator}: Symmetric matrix of posterior mean
#' inclusion probabilities (if edge selection was enabled).
#'
Expand Down Expand Up @@ -409,6 +439,7 @@ bgm = function(
display_progress = c("per-chain", "total", "none"),
seed = NULL,
standardize = FALSE,
pseudolikelihood = c("conditional", "marginal"),
verbose = getOption("bgms.verbose", TRUE),
interaction_scale,
burnin,
Expand Down Expand Up @@ -481,7 +512,8 @@ bgm = function(
cores = cores,
seed = seed,
display_progress = display_progress,
verbose = verbose
verbose = verbose,
pseudolikelihood = pseudolikelihood
)

raw = run_sampler(spec)
Expand Down
Loading
Loading