arXiv:2610.12702stat.MEOct 2026

Manuscript Offprint

arXiv:2610.12702

Product Monte Carlo: Expectation Under a Product of Densities

Pietro Carlotti, Sifan Liu, Yuling Yao

Abstract

Aggregating independently computed sub-sample inferences is a well-known challenge in large-scale Bayesian computation, federated learning, and opinion pooling. The core problem is to approximate a distribution whose density is proportional to a product of individual densities. We propose Product Monte Carlo (PMC), an algorithm for computing arbitrary expectations under a product of densities using only Monte Carlo draws from individual densities. We turn the intractable product expectation into a regression problem by expressing it through a family of computable conditional expectations. Besides the point estimate, our fully Bayesian regression formulation provides coherent uncertainty quantification and principled diagnostics. We establish theoretical guarantees on consistency and characterize convergence rates for the PMC estimator. Across simulated and real-data experiments varying the number, dimensionality, and heterogeneity of the component distributions, PMC achieves higher estimation accuracy, better-calibrated uncertainty coverage, and improved scalability at a lower computational cost than existing methods. In addition, PMC requires no density evaluation, making it applicable to simulation-based inference, as we demonstrate in an application with protein images.

Keywords: distributed learning, Monte Carlo method, product distribution, simulation-based inference, uncertainty quantification

1. Introduction

Many statistical problems involve computing expectations under the product of densities. For illustration, we begin with an example from Bayesian subsampling: the data D\mathcal{D} are conditionally i.i.d. given a parameter θ∈Rp\theta \in \mathbb{R}^p and can be partitioned into K≥2K \geq 2 disjoint subsets D1,…,DK\mathcal{D}_1, \ldots, \mathcal{D}_K. If we denote the prior distribution ρ0(θ)\rho_0(\theta) and the likelihood function π(D∣θ)\pi(\mathcal{D} \mid \theta), the full posterior distribution of θ\theta given the data D\mathcal{D} is

π(θ∣D)∝ρ0(θ)∏k=1Kπ(Dk∣θ).\pi(\theta\mid\mathcal{D})\propto\rho_{0}(\theta)\prod_{k=1}^{K}\pi(\mathcal{D}_{k}\mid\theta).

The subposterior is the inference based on subset data:

ρk(θ)∝ρ0(θ)1Kπ(Dk∣θ)k=1,…,K,\rho_{k}(\theta)\propto\rho_{0}(\theta)^{\frac{1}{K}}\pi(\mathcal{D}_{k}\mid\theta)\quad k=1,\ldots,K,

where the prior is scaled to reflect the partition. We can then obtain SS samples from each subposterior, which often is easier than the full sampling:

θk(s)∼ρks=1,…,S,k=1,…,K.\theta_{k}^{(s)}\sim\rho_{k}\quad s=1,\ldots,S,\quad k=1,\ldots,K.

∗^{*}University of Texas at Austin, Department of Statistics and Data Sciences

†^{\dagger}Duke University, Department of Statistical Science

We thank Jinlin Lai for help with our SBI experiment. Code and reproducibility materials are available at https://github.com/PietroCarlotti/product-monte-carlo.

However, even if the subsamples are readily available, computing quantities under the full-data posterior remains nontrivial. The full posterior density is proportional to the product of subposteriors:

π(θ∣D)∝∏k=1Kρk(θ).\pi(\theta\mid\mathcal{D})\propto\prod_{k=1}^{K}\rho_{k}(\theta).

To solve this aggregation task, this paper develops Product Monte Carlo (PMC), a framework for estimating expectations under a product density, formally:

Definition 1 (Product Distribution). Let π1,…,πK\pi_1, \ldots, \pi_K be densities of distributions on Rp\mathbb{R}^p, where K≥2K \geq 2. The product density π∗\pi_* is defined as follows:

π∗(x)=1Z∏k=1Kπk(x)∝∏k=1Kπk(x)∀x∈Rp,\pi_{*}(x)=\frac{1}{Z}\prod_{k=1}^{K}\pi_{k}(x)\propto\prod_{k=1}^{K}\pi_{k}(x)\qquad\forall x\in\mathbb{R}^{p},

with an unknown normalizing constant

Z=∫Rp∏k=1Kπk(x)dx,0<Z<∞.Z=\int_{\mathbb{R}^{p}}\prod_{k=1}^{K}\pi_{k}(x)\mathrm{d}x,\qquad0<Z<\infty.

Throughout this paper, “product” refers to the pointwise product of component densities on Rp\mathbb{R}^p, and should not be confused with a product measure on (Rp)K(\mathbb{R}^p)^K.

As in other Monte Carlo methods, our goal is to compute the expectation of any integrable function h:Rp→Rrh : \mathbb{R}^p \to \mathbb{R}^r, with r≥1r \geq 1, under the product density:

μh=Eπ∗[h]=∫Rph(x)π∗(x)dx.\mu_{h}=\mathbb{E}_{\pi_{*}}\left[h\right]=\int_{\mathbb{R}^{p}}h(x)\pi_{*}(x)\mathrm{d}x.

In the subsampling example, the components πk\pi_k are the subposterior densities, and their product, after normalization, is the full-data posterior. Taking h(θ)=θh(\theta) = \theta or h(θ)=θθ⊤h(\theta) = \theta\theta^\top yields the first or second moment under the full posterior.

Heuristic of PMC. First draw S samples from each component density, independently across components:

xk(s)∼πks=1,…,S,k=1,…,K.x_{k}^{(s)}\sim\pi_{k}\quad s=1,\ldots,S,\quad k=1,\ldots,K.

PMC aggregates individual samples via a regression to estimate any expectation Eπ∗[h]\mathbb{E}_{\pi_{*}}[h] under the product distribution. See Figure 1 for the workflow.

To build intuition for how PMC works, consider two independent random variables in Rp\mathbb{R}^p: x1∼π1x_1 \sim \pi_1, and x2∼π2x_2 \sim \pi_2. Define their scaled sum and difference by

C=x1+x22,D=x1−x22.C=\frac{x_{1}+x_{2}}{2},\quad D=\frac{x_{1}-x_{2}}{2}.

The conditional distribution of C given D=0pD = \mathbf{0}_p is exactly the target product distribution:

C∣D=0p∼π∗∝π1π2.C\mid D=\mathbf{0}_{p}\sim\pi_{*}\propto\pi_{1}\pi_{2}.

Intuitively, the product distribution is the slice of the joint distribution along the diagonal of the product space. Figure 2 illustrates a Gaussian example.

Figure

Figure 1: PMC aggregates samples from individual components to estimate any expectation under the product distribution. No density evaluation of πk\pi_{k} is needed.

The above identity belongs to a broader family of conditional representations, which we develop in the rest of the paper, where C captures consensus among the component variables and D measures their discrepancy. This lets us express expectations under the product distribution as conditional expectations:

Eπ∗[h]=E[h(C)∣D=0].\mathbb{E}_{\pi_{*}}[h]=\mathbb{E}[h(C)\mid D=\mathbf{0}].

Although the event {D=0}\{D = \mathbf{0}\} has zero probability, we can estimate the conditional expectation through regression. PMC develops a general recipe for these representations and their fully Bayesian estimation.

As we will show through theoretical analysis and empirical evaluation in the subsequent sections, the salient features of PMC include the following:

• Distribution-free: Without parametric restrictions, PMC allows arbitrary component densities πk\pi_{k}.

• Evaluation-free: PMC requires only samples from the component distributions, not evaluations of their densities or product. This makes it suitable for simulation-based and likelihood-free inference.

• Scalable: PMC allows parallel sampling across components without coordination and reduces intractable product sampling to regression, which scales better with dimension and sample size.

• Calibrated: Our fully Bayesian formulation in PMC provides coherent uncertainty quantification and credible intervals, accounting for both the Monte Carlo and epistemic errors.

• Diagnosable: PMC turns a computing task into a modeling problem, which incorporates the established Bayesian workflow and supports model diagnostics, checks, and iterative model improvement.

Applications. Beyond its interest as a general problem, computing expectations under products of densities is useful in several practical settings.

As in our motivating example of large-scale inference, partitioning a large dataset and sampling from subposteriors substantially reduces the cost: each subposterior requires a fraction of the likelihood and gradient evaluation cost; subposteriors can be sampled in parallel (Neiswanger et al., 2014; Scott et al., 2016); and amortized methods such as neural posterior estimation (e.g., Papamakarios and Murray, 2016) can make repeated inference inexpensive after training. The remaining task is then to aggregate them into the product. This product form arises naturally under conditional independence, as multiplication combines information sources (Bernardo and Smith, 1994).

In federated learning (e.g., Al-Shedivat et al., 2021; Liu et al., 2024; Jonker et al., 2024) or privacy-sensitive applications, data cannot be centralized for storage and processing. Inference

Figure

Figure 2: For π1=N(1,1)\pi_1 = \mathcal{N}(1,1) and π2=N(2,1)\pi_2 = \mathcal{N}(2,1), the product distribution π∗=N(1.5,0.5)∝π1π2\pi_* = \mathcal{N}(1.5,0.5) \propto \pi_1 \pi_2 matches the conditional distribution on the diagonal slice.

must use data held locally across different sites, and then multiply individual densities.

Products also arise in ensemble prediction, where product-of-experts and logarithmic pooling combine predictive densities multiplicatively (Genest and Zidek, 1986; Hinton, 2002). An open challenge is then to evaluate the combined predictive distribution.

In many of these applications, individual component densities πk\pi_{k} cannot be evaluated: local densities in privacy settings can leak data information; posterior predictive densities in expert pooling require additional integration; and generative-model-based samplers and simulation-based inference (SBI) methods provide samples without tractable density evaluations.

References (27)