Importance sampling (IS) is based on the idea of sampling from an alternate distribution and reweighting the samples to be representative of the target distribution (perhaps concentrating sampling in certain regions of the input space that are of greater importance). This often enables efficient evaluations of expectations Ex ∼ p[f(x)] where f(x) is small outside of a small region of the input space. To this end, a sample x is drawn from a proposal distribution q(x) and re-weighted to correct for the discrepancy between the sampling distribution q and the true distribution p. The weight of the sample is computed as
If p is only known up to a constant, i.e., one can only evaluate p̃(x), where
The .ImportanceSampling
class is imported using the following command:
>>> from UQpy.sampling.ImportanceSampling import ImportanceSampling
UQpy.sampling.ImportanceSampling
UQpy.sampling.ImportanceSampling.samples
UQpy.sampling.ImportanceSampling.unnormalized_log_weights
UQpy.sampling.ImportanceSampling.weights
UQpy.sampling.ImportanceSampling.unweighted_samples
Importance Sampling Examples <../auto_examples/sampling/importance_sampling/index>