Implicitly adaptive importance sampling

Topi Paananen, Juho Piironen, Paul-Christian Bürkner, Aki VehtariStat. Comput 2021

TL;DR

This paper introduces "Importance Weighted Moment Matching" (IWMM), a novel method for implicitly adapting proposal distributions in importance sampling. IWMM efficiently improves Monte Carlo integration accuracy for complex, non-parametric distributions, particularly excelling in Bayesian leave-one-out cross-validation (LOO-CV) tasks where traditional methods struggle.

What Problem Does This Paper Address?

Estimating expectations over complex probability distributions is a cornerstone of Bayesian inference and other scientific fields. Importance sampling (IS) is a powerful technique for this, but its accuracy heavily relies on choosing a good "proposal distribution" from which to draw samples. When the target distribution is complex, multimodal, or not available in closed form, finding an effective proposal is challenging. Existing adaptive IS methods often require parametric forms for proposals or extensive tuning, limiting their applicability. This paper tackles the problem of improving IS accuracy for such difficult distributions, especially in the context of Bayesian model assessment using LOO-CV, where accurate estimation of tail probabilities is crucial.

Methods

The core contribution is the Importance Weighted Moment Matching (IWMM) method. Instead of explicitly defining and adapting a parametric proposal distribution, IWMM implicitly modifies the proposal by transforming existing Monte Carlo draws. This is achieved by iteratively matching the moments of the current sample to their importance-weighted moments.

Key aspects of the method include:

  • Implicit Adaptation: IWMM transforms existing draws rather than resampling or fitting new distributions. This makes it suitable for distributions where a closed-form proposal is not feasible.
  • Moment Matching: The method iteratively adjusts the draws to match theoretical optimal proposal distributions, which are derived from the target distribution and the function being integrated.
  • Double Adaptation (for SNIS): For self-normalized importance sampling (SNIS), a novel "double adaptation" scheme is proposed. This involves separate adaptations for the numerator and denominator of the SNIS estimator, combined using a "split proposal density." This is crucial for handling cases where the function being integrated has large values in the tails.
  • Affine Transformations: Simple affine transformations (linear mapping + translation) are used to modify the draws. The paper explores three levels of complexity for these transformations, starting with mean matching and progressing to covariance matching.
  • Pareto Diagnostic: The Pareto k diagnostic is used to assess the quality of importance weights and to guide the adaptation process, acting as a stopping criterion and a measure of whether a transformation has improved the proposal.

Datasets

The paper uses several datasets for evaluation, primarily in the context of Bayesian leave-one-out cross-validation (LOO-CV):

  • Ovarian Cancer Data: A real-world dataset with a high-dimensional logistic regression model (3075 parameters) and a regularized horseshoe prior, known for its multimodal posterior.
  • Roach Data: A real dataset used for Poisson regression with potential outliers.
  • Simulated Linear Regression Data: Data with correlated predictor variables.
  • Simulated Gaussian Data: Used to demonstrate the method's performance with outliers and misspecified models.

The paper does not introduce new benchmark datasets but rather applies its method to established datasets and models to evaluate its performance against existing techniques.

Key Insights and Ideas

  • Implicit adaptation is powerful: By transforming existing samples rather than fitting new distributions, IWMM bypasses the need for parametric proposal forms and complex tuning, making it highly flexible.
  • Double adaptation is critical for SNIS: For self-normalized importance sampling, especially when dealing with tail probabilities (common in LOO-CV), a simple adaptation is insufficient. The proposed double adaptation scheme significantly improves accuracy.
  • The Pareto diagnostic is a reliable guide: The Pareto k diagnostic effectively signals poor finite-sample convergence and is crucial for determining when to stop adaptation, preventing excessive computation and ensuring reliable results.
  • The "split proposal" is a clever approximation: For SNIS, approximating the optimal proposal with a sum of terms related to the target and the function being integrated offers a practical and effective way to improve sampling.
  • LOO-CV is a challenging but important application: The paper highlights how IWMM excels in LOO-CV, a critical task for model assessment, where traditional methods often fail due to insufficient tail accuracy.

Key Results

  • Improved Accuracy in LOO-CV: IWMM consistently achieved more accurate LOO-CV estimates compared to standard importance sampling and several parametric adaptive importance sampling methods, often aligning closely with analytical solutions.
  • Computational Efficiency: IWMM is computationally inexpensive because it avoids resampling and recomputing proposal densities during adaptation. It significantly outperforms methods like AMIS in terms of computation time, especially for complex models.
  • Handling Difficult Distributions: The method demonstrated strong performance on high-dimensional, multimodal, and outlier-prone distributions where other adaptive methods struggled.
  • Pareto k Diagnostic Effectiveness: The Pareto k diagnostic accurately identified convergence issues for various methods, and IWMM consistently reduced k values below the threshold of 0.7, indicating practically useful finite-sample accuracy.
  • Outperforming Existing Methods: In experiments, IWMM (especially with double adaptation) showed superior performance to generic adaptive importance sampling methods (e.g., using Gaussian or Student-t proposals) and even adaptive multiple importance sampling (AMIS) in certain challenging scenarios. For instance, in the Ovarian cancer data experiment, IWMM reduced the number of LOO folds with k > 0.7 significantly, while parametric methods failed to do so.

Limitations and Future Work

  • Affine Transformation Limitations: The paper acknowledges that simple affine transformations might not be sufficient for all complex target distributions. For highly intricate posteriors, more elaborate transformations might be necessary.
  • Future Work: The authors suggest exploring more complex transformations and investigating IWMM's applicability to other areas beyond LOO-CV. They also mention the potential for bias if resampling is omitted in certain adaptive multiple importance sampling contexts, leaving this as a direction for future research.

Summary updated

BibTeX
@inproceedings{paananen2021implicitly,
  author = {Topi Paananen and Juho Piironen and Paul-Christian Bürkner and Aki Vehtari},
  title = {{Implicitly adaptive importance sampling}},
  booktitle = {Stat. Comput},
  year = {2021},
  url = {https://openreview.net/forum?id=GYXMOGTvin},
}
Figure