Importance sampling plays an important role in particle filters. In many situations, we may be interested in samples from a desired pdf q(x) but we might only have access to samples from a pdf p(x). Importance sampling allows us to approximate sampling Y ~ q(x) by drawing samples X from p(x), then correcting for the difference between the two distributions by assigning weights to the samples X. The desired samples Y are then approximated as:
Y = q(X) / p(X)・X
Experiment with the element above. Observe which combinations of sample and desired distribution work well, and which don't.