Skip to main content
QUICK REVIEW

[Paper Review] bridgesampling: An R Package for Estimating Normalizing Constants

Quentin F. Gronau, Henrik Singmann|arXiv (Cornell University)|Oct 23, 2017
Statistical Methods and Bayesian InferenceMathematics11 citations
TL;DR

This paper introduces the bridgesampling R package, which uses bridge sampling—a robust, general-purpose method—to estimate normalizing constants (e.g., marginal likelihoods) in Bayesian model comparison. The method enables accurate and automated estimation of Bayes factors for models implemented in Stan, with demonstrated success in reproducing established results on real data, such as a Bayes factor of BF₀₁ = 1.273 for a hierarchical GLMM on turtle survival data.

ABSTRACT

Statistical procedures such as Bayes factor model selection and Bayesian model averaging require the computation of normalizing constants (e.g., marginal likelihoods). These normalizing constants are notoriously difficult to obtain, as they usually involve high-dimensional integrals that cannot be solved analytically. Here we introduce an R package that uses bridge sampling (Meng & Wong, 1996; Meng & Schilling, 2002) to estimate normalizing constants in a generic and easy-to-use fashion. For models implemented in Stan, the estimation procedure is automatic. We illustrate the functionality of the package with three examples.

Motivation & Objective

  • To address the long-standing challenge of estimating normalizing constants in Bayesian inference, particularly for high-dimensional models where analytical solutions are infeasible.
  • To provide a user-friendly, general-purpose R package that automates the estimation of marginal likelihoods using bridge sampling, reducing the barrier for non-expert users.
  • To enable accurate and efficient computation of Bayes factors and posterior model probabilities in complex models, such as hierarchical and mixed-effects models.
  • To demonstrate the method’s reliability and accuracy by reproducing established results from the literature using real-world data.

Proposed method

  • The package implements bridge sampling, a Monte Carlo method that estimates normalizing constants by constructing a weighted average of the unnormalized posterior density over a proposal density.
  • It uses the bridge sampling identity, which minimizes variance in the estimator by choosing an optimal importance sampling distribution closely matching the target density.
  • For Stan models, the package automatically extracts posterior samples and applies the bridge sampling estimator without requiring manual derivation of the importance density.
  • The method supports both generic models and models implemented in Stan, with seamless integration through the rstan interface.
  • The algorithm is robust in high-dimensional parameter spaces and outperforms simpler methods like naive Monte Carlo and importance sampling in terms of accuracy and stability.
  • The package provides functions such as bridge_sampler to compute log marginal likelihoods and supports model comparison via Bayes factors.

Experimental results

Research questions

  • RQ1Can bridge sampling be effectively automated in an R package to estimate normalizing constants for Bayesian models?
  • RQ2How accurately can the bridgesampling package reproduce established Bayes factor results for hierarchical models?
  • RQ3To what extent does bridge sampling outperform alternative methods like importance sampling or the harmonic mean estimator in high-dimensional settings?
  • RQ4Can the package be used as a 'black box' by non-expert users for model comparison in complex models?

Key findings

  • The bridgesampling package successfully reproduces the established Bayes factor of BF₀₁ = 1.273 for a probit mixed model on turtle survival data, confirming its accuracy.
  • Bridge sampling provides stable and precise estimates of marginal likelihoods even in high-dimensional hierarchical models, where other methods often fail or produce high variance.
  • The method achieves high accuracy with relatively few posterior samples, making it computationally efficient for practical Bayesian model comparison.
  • The integration with Stan allows fully automated estimation of marginal likelihoods with minimal user input, significantly lowering the barrier to entry for Bayesian model comparison.
  • The package outperforms simpler estimators such as naive Monte Carlo and importance sampling in terms of precision and robustness, especially in complex models.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.