Importance Sampling
Contents
Importance Sampling#
Importance sampling helps construct a complex distribution sampler from primary samplers such as quadrature samplers Sampler.QuadratureSampler()
.
Suppose we have a primary sampler for the distribution \(g(\mathbf{u})\) generating \(N\) samples \(\mathbf{u}_{g,i}\), weights \(w_{g,i}\), and likelihoods \(g(\mathbf{u}_{g,i})\) such that
in which \(\phi\) is an arbitrary function of \(\mathbf{u}\). Our target is to generate samples \(\mathbf{u}_{f,i}\) and weights \(w_{f,i}\) for a more complex distribution \(f(\mathbf{u})\) such that
Importance sampling helps us achieve this target utilizing the following observation
Comparing the previous equation to equation (2), we conclude that
The above equation gives the weights \(w_{f,i}\) and samples \(\mathbf{u}_{f,i}\) for the distribution \(f(\mathbf{u})\) obtained by importance sampling.
Self-Normalized Importance Sampling#
Suppose we again have a primary sampler for the distribution \(g(\mathbf{u})\) generating \(N\) samples \(\mathbf{u}_{g,i}\), weights \(w_{g,i}\) such that
in which \(\phi\) is an arbitrary function of \(\mathbf{u}\). But we only know the likelihoods upto a constant multiplier \(c_0\). Specifically, we partially known the likelihood \(g(\mathbf{u}_{g,i}) = c_0 g_0(\mathbf{u}_{g,i})\) with \(g_0\) known but \(c_0\) not.
Our target is to generate samples \(\mathbf{u}_{f,i}\) and weights \(w_{f,i}\) for a more complex distribution \(f(\mathbf{u}) = c_1 f_0(\mathbf{u})\) with \(f_0\) known but \(c_1\) not. Specifically, we aims to achieve
Self-Normalized importance sampling helps us achieve this target utilizing the following observation
Comparing the previous equation to equation (6), we conclude that
The above equation gives the weights \(w_{f,i}\) and samples \(\mathbf{u}_{f,i}\) for the distribution \(f(\mathbf{u})\) obtained by importance sampling.