Learned harmonic mean estimation of the Bayesian evidence with normalizing flows

Alicja Polanska,Matthew A. Price,Davide Piras,Alessio Spurio Mancini,Jason D. McEwen
2024-05-10
Abstract:We present the learned harmonic mean estimator with normalizing flows - a robust, scalable and flexible estimator of the Bayesian evidence for model comparison. Since the estimator is agnostic to sampling strategy and simply requires posterior samples, it can be applied to compute the evidence using any Markov chain Monte Carlo (MCMC) sampling technique, including saved down MCMC chains, or any variational inference approach. The learned harmonic mean estimator was recently introduced, where machine learning techniques were developed to learn a suitable internal importance sampling target distribution to solve the issue of exploding variance of the original harmonic mean estimator. In this article we present the use of normalizing flows as the internal machine learning technique within the learned harmonic mean estimator. Normalizing flows can be elegantly coupled with the learned harmonic mean to provide an approach that is more robust, flexible and scalable than the machine learning models considered previously. We perform a series of numerical experiments, applying our method to benchmark problems and to a cosmological example in up to 21 dimensions. We find the learned harmonic mean estimator is in agreement with ground truth values and nested sampling estimates. The open-source harmonic Python package implementing the learned harmonic mean, now with normalizing flows included, is publicly available.
Instrumentation and Methods for Astrophysics,Cosmology and Nongalactic Astrophysics,Methodology
What problem does this paper attempt to address?
The main focus of this paper is on the problem of estimating Bayesian evidence in scientific computing, which is an important tool in model comparison. The traditional harmonic mean estimator tends to have large variances, resulting in inaccurate estimates. To address this issue, the paper proposes a learning harmonic mean estimator using normalizing flows. This approach utilizes machine learning techniques, specifically normalizing flows as the target distribution for importance sampling, to improve the robustness, flexibility, and scalability of the estimates. Normalizing flows are machine learning models that can learn and transform simple distributions into complex distributions, effectively handling high-dimensional problems. The paper validates the effectiveness of this method through numerical experiments, applying it to benchmark problems and a cosmological example with dimensionality up to 21. The results are consistent with the ground truth values and nested sampling estimates. The authors also developed an open-source Python package to implement this learning harmonic mean estimator, which includes the functionality of normalizing flows. This method has important practical applications for dealing with complex problems that require model selection, such as the nature of dark energy.