Probability

Importance Sampling

According to wiki, importance sampling is a Monte Carlo method for evaluating properties of a particular distribution, while only having samples generated from a different distribution than the distribution of interest.

Ep[f(X)]=f(x)p(x)dx=f(x)p(x)q(x)q(x)dx=Eq[p(X)q(X)f(X)]\begin{align*} E_p[f(X)] & = \int{}f(x)p(x)dx \\ & = \int{}f(x)\frac{p(x)}{q(x)}q(x)dx \\ & = E_q[\frac{p(X)}{q(X)}f(X)] \end{align*}

The term p(x)q(x)\frac{p(x)}{q(x)}is a weight factor. The left side of the equation is the expectation of f(X)f(X) under distribution p(x)p(x). Suppose we have samples of XXunder distribution q(x)q(x), we can reconstruct the expectation of f(X)f(X) under distribution p(x)p(x) by weighting the samples (i.e. multiplying f(x)f(x)by p(x)q(x)\frac{p(x)}{q(x)}.

The distribution p(x)p(x)is sometimes called the target distribution and they are often not directly accessible.

Last updated