importance sampling: Nonlinear Function
Created: July 05, 2022
Modified: July 05, 2022

importance sampling

This page is from my personal notes, and has not been specifically reviewed for public consumption. It might be incomplete, wrong, outdated, or stupid. Caveat lector.

Importance sampling allows us to compute expectations under a distribution pp using samples from a different distribution qq, by weighting the samples by the ratio of their probabilities:

F~(x)=1Ni=1Np(xi)q(xi)f(xi);xiq\tilde{F}(x) = \frac{1}{N}\sum_{i=1}^N \frac{p(x_i)}{q(x_i)} f(x_i); \qquad x_i\sim q

so that F~\tilde{F} is an unbiased estimate of f(x)f(x),

Exq[F~(x)]=Exp[f(x)].\mathbb{E}_{x\sim q}[\tilde{F}(x)] = \mathbb{E}_{x\sim p}[f(x)].

The ratios wi=p(xi)q(xi)w_i = \frac{p(x_i)}{q(x_i)} are sometimes called the importance weights.