-
update_method = "hamiltonian-mc"has been removed. Useupdate_method = "nuts"instead. NUTS dynamically adapts trajectory length and is more reliable, especially with edge selection on GGM models. -
The
hmc_num_leapfrogsargument has been removed along with pure HMC. -
Pairwise interaction parameters for ordinal MRFs are now stored on association scale (half the sigma scale used in 0.1.6.3). Code that interprets raw pairwise posterior samples or sets
pairwise_scaleexplicitly will need adjustment. -
Default
pairwise_scalechanged from 2.5 to 1 to match the association-scale reparameterization. -
extract_category_thresholds()is deprecated in favor ofextract_main_effects(), which covers category thresholds, continuous means, and precision diagonal entries.
- Gaussian graphical models (GGM):
bgm(x, variable_type = "continuous")fits a GGM with Bayesian edge selection. Sampling uses the RATTLE constrained HMC algorithm to maintain positive-definiteness of the precision matrix. - Mixed MRF models:
bgm()accepts a per-variablevariable_typevector that mixes"ordinal","blume-capel", and"continuous"types to estimate networks with both discrete and continuous variables.simulate.bgms()andpredict.bgms()also support mixed models. - Missing data imputation:
na_action = "impute"integrates over missing values during MCMC sampling for ordinal, continuous, and mixed models. extract_precision(): extract posterior precision matrix samples from GGM and mixed models.extract_partial_correlations(): extract posterior partial correlation samples from GGM and mixed models.extract_log_odds(): extract log-odds for discrete pairwise interactions.extract_main_effects(): extract main effect samples (category thresholds, continuous means, and precision diagonal).- NUTS diagnostics now include the per-iteration mean Metropolis acceptance probability (
fit$nuts_diag$accept_prob, paralleling Stan'saccept_stat__) and a per-chainmean_accept_probsummary.
- Fitted objects from
bgm()andbgmCompare()are now S7 class objects (new dependency:S7). All existing$,[[, andnames()access patterns continue to work. When an incompatibleeasybgmversion is loaded, bgms returns plain S3 lists for backwards compatibility; this shim will be removed in a future release. - Refactored the C++ backend: unified model hierarchy (
BaseModel→GGMModel/OMRFModel/MixedMRFModel), shared NUTS/HMC infrastructure, and fused log-posterior and gradient computation. - NUTS now uses Stan's multinomial candidate weighting (log-sum-exp of
H0 - hper leaf, biased progressive sampling at the top level) in place of the Hoffman-Gelman slice variable. The two schemes target the same posterior; the multinomial variant produces lower-variance candidate selection and has been Stan's default since 2017. User-facing output is unchanged apart from the newaccept_probdiagnostic. - NUTS Stage-2 warmup windowing now matches Stan's
windowed_adaptation::compute_next_window: when the window after the next would overshoot the Stage-3a boundary, the current next window is stretched to absorb the remaining Stage-2 budget instead of emitting a small trailing window. This eliminates a disruptive mass-matrix update + step-size reinit at the end of warmup and improves dual-averaging convergence. - Dropped
codafrom Imports; ESS and R-hat are now computed in C++ with on-demand (lazy) evaluation, replacing the eager R-based computation from 0.1.6.3. $and[[accessors on fitted objects trigger lazy computation of MCMC diagnostics on first access.
- Fixed compilation failure on Alpine/musl:
mrf_simulation.cpprelied on a transitive include for<tbb/global_control.h>that is not available on all platforms. - Fixed stale gradient cache after missing data imputation caused NUTS to use outdated cached values for leapfrog integration.
- Fixed stale observation transpose after missing data imputation caused the pairwise gradient to use stale data.
- Fixed NUTS acceptance probability: target_accept now correctly passed to lower-level NUTS functions.
- Fixed NUTS acceptance probability accumulation: the top-level trajectory loop overwrote the Metropolis contribution with the last subtree's value instead of summing across the full trajectory, biasing the signal used by dual-averaging step-size adaptation.
extract_rhat(): extract R-hat convergence diagnostics from fitted objectsextract_ess(): extract effective sample size estimates from fitted objectsverboseargument: control informational messages; setoptions(bgms.verbose = FALSE)to suppress globallysimulate_mrf(): standalone MRF simulation with user-specified parameterssimulate.bgms(): generate observations from fitted models (supports parallel processing)predict.bgms(): compute conditional probabilities P(X_j | X_{-j})main_difference_selectionargument inbgmCompare(): control threshold difference selectionstandardizeargument: scale Cauchy prior by response score rangebaseline_categorynow stored in fitted object for Blume-Capel simulation/prediction
- fixed matrix indexing for
posterior_mean_indicator: now correctly maps C++ row-major order to R matrices (#77) - fixed mass matrix adaptation: now correctly uses variance instead of precision
- fixed step size heuristic: re-runs after mass matrix updates, resamples momentum each iteration
- fixed E-BFMI diagnostic: now uses actual accepted trajectory momentum
- fixed Blume-Capel interaction: uses centered scores
(c - ref)in pseudolikelihood denominator
- NUTS: implemented generalized U-turn criterion following Betancourt (2017) and STAN
- NUTS: fused log-posterior and gradient computation eliminates redundant probability evaluations
- bgmCompare: BLAS-vectorized gradient computation for improved performance
- expanded test suite: input validation, extractor functions, S3 methods, simulation, and numerical sanity tests
- improved warmup schedule: fixed buffers (75/25/50) with proportional fallback for short warmup
- edge selection warmup now within user budget: 85%/10%/5% split for stages 1-3a/3b/3c
- streamlined user messages: concise warnings, consolidated NUTS diagnostics
- E-BFMI threshold adjusted to 0.2 (standard)
mrfSampler()→ usesimulate_mrf()
- added option to separately specify beta priors for the within- and between-cluster probabilities for the SBM prior.
- reparameterized the Blume-capel model to use (score-baseline) instead of score.
- implemented a new way to compute the denominators and probabilities. This made their computation both faster and more stable.
- refactored c++ code for better maintainability.
- removed the prepared_data field from bgm objects.
- fixed numerical problems with Blume-Capel variables using HMC and NUTS.
- fixed a reporting bug where category thresholds for ordinal variables with a single category were incorrectly expanded to two parameters, resulting in spurious NA values.
- added extractor function for joint SBM output
- cleaned up documentation, and c++ files
- changed length of warmup phase I in warmup scheduler HMC / NUTS (15% → 7.5%)
- fixed a problem with warmup scheduling for adaptive-metropolis in bgmCompare()
- fixed stability problems with parallel sampling for bgm()
- fixed spurious output errors printing to console after user interrupt.
- added NUTS and HMC options for sampling
bgm()andbgmCompare()models - added support for running multiple chains in parallel
- added user interrupt handling for parallel sampling
- added Markov chain diagnostics (effective sample size and R-hat) for sampled parameters
- added
summary(),print(), andcoef()methods for fitted objects - MCMC sampling in
bgm()andbgmCompare()is now reproducible when aseedargument is specified
- improved progress bar for parallel sampling
summary()now integrates the functionality of the oldsummary_SBM()- removed options for modeling main differences; main differences are now always estimated or selected, equivalent to the previous
main_difference_model = "collapse"setting
- fixed an out-of-bounds error in
bgmCompare()when handling missing data - fixed a bug in the SBM prior computation
-
In
bgm(), the following arguments are deprecated:interaction_scale→ usepairwise_scaleburnin→ usewarmupsave→ no longer needed (all outputs are returned by default)threshold_alpha,threshold_beta→ usemain_alpha,main_beta
-
In
bgmCompare(), arguments related to difference models are deprecated:main_difference_model(removed without replacement)reference_category→ usebaseline_categorypairwise_difference_*,main_difference_*→ use unifieddifference_*argumentspairwise_beta_bernoulli_*,main_beta_bernoulli_*→ use unifiedbeta_bernoulli_*argumentsinteraction_scale→ usepairwise_scalethreshold_alpha,threshold_beta→ usemain_alpha,main_betaburnin→ usewarmupsave→ no longer needed
-
Deprecated extractor functions:
extract_edge_indicators()→ useextract_indicators()extract_pairwise_thresholds()→ useextract_category_thresholds()
-
Deprecated object fields:
$gamma(pre-0.1.4) and$indicator(0.1.4–0.1.5) → replaced by$raw_samples$indicator$main_effects(pre-0.1.4) and$posterior_mean_main(0.1.4–0.1.5) → replaced by$raw_samples$main(raw samples) and$posterior_summary_main(summaries)
- 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.
- 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.
- 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.
- fixed a bug with adjusting the variance of the proposal distributions
- fixed a bug with recoding data under the "collapse" condition
- when
selection = TRUE, the burnin phase now runs2 * burniniterations instead of1 * burnin. This ensures the chain starts with well-calibrated parameter values - changed the maximum standard deviation of the adaptive proposal from 20 back to 2
This is a minor release that adds some documentation and output bug fixes.
- Comparing the category threshold and pairwise interaction parameters in two independent samples with bgmCompare().
- The Stochastic Block model is a new prior option for the network structure in bgm().
- Exported extractor functions to extract results from bgm objects in a safe way.
- Changed the maximum standard deviation of the adaptive proposal from 2 to 20.
- Some small bug fixes.
- Added support for Bayesian estimation without edge selection to bgm().
- Added support for simulating data from a (mixed) binary, ordinal, and Blume-Capel MRF to mrfSampler()
- Added support for analyzing (mixed) binary, ordinal, and Blume-Capel variables to bgm()
- Removed support of optimization based functions, mple(), mppe(), and bgm.em()
- Removed support for the Unit-Information prior from bgm()
- Removed support to do non-adaptive Metropolis from bgm()
- Reduced file size when saving raw MCMC samples
This is a minor release that adds some bug fixes.
This is a minor release adding some new features and fixing some minor bugs.
- Missing data imputation for the bgm function. See the
na.actionoption. - Prior distributions for the network structure in the bgm function. See the
edge_prioroption. - Adaptive Metropolis as an alternative to the current random walk Metropolis algorithm in the bgm function. See the
adaptiveoption.
- Changed the default specification of the interaction prior from UnitInfo to Cauchy. See the
interaction_prioroption. - Changed the default threshold hyperparameter specification from 1.0 to 0.5. See the
threshold_alphaandthreshold_betaoptions. - Analysis output now uses the column names of the data.