# importance sampling

(45 minutes to learn)

## Summary

Importance sampling is a way of estimating expectations under an intractable distribution p by sampling from a tractable distribution q and reweighting the samples according to the ratio of the probabilities. While importance sampling has unreasonably large variance when applied naively, it forms the basis for some very effective Monte Carlo estimators.

## Context

This concept has the prerequisites:

- Monte Carlo estimation
- conditional distributions (Importance sampling is commonly used to estimate conditional expectations.)

## Core resources (read/watch one of the following)

## -Free-

→ Information Theory, Inference, and Learning Algorithms

A graudate-level textbook on machine learning and information theory.

Additional dependencies:

- multivariate Gaussian distribution

## -Paid-

→ Probabilistic Graphical Models: Principles and Techniques

A very comprehensive textbook for a graduate-level course on probabilistic AI.

Location:
Sections 12.2-12.2.2, pages 494-498

## Supplemental resources (the following are optional, but you may find them useful)

## -Free-

→ Machine learning summer school: Markov chain Monte Carlo (2009)

## -Paid-

→ Machine Learning: a Probabilistic Perspective

A very comprehensive graudate-level machine learning textbook.

Location:
Sections 23.4-23.4.3

Additional dependencies:

- Bayesian networks

→ Pattern Recognition and Machine Learning

A textbook for a graduate machine learning course, with a focus on Bayesian methods.

Location:
Section 11.1.4, pages 532-534

## See also

- The variance of the importance weights depends on a Renyi divergence between the two distributions.
- Importance sampling is ineffective except in simple situations. More sophisticated versions include: