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. Its introduction in statistics is generally attributed to a paper by Teun Kloek and Herman K. van Dijk in 1978, but its precursors can be found in statistical physics as early as 1949. Importance sampling is also related to umbrella sampling in computational physics. Depending on the application, the term may refer to the process of sampling from this alternative distribution, the process of inference, or both.
Basic theory Let X : Ω → R {\displaystyle X\colon \Omega \to \mathbb {R} } be a random variable in some probability space ( Ω , F , P ) {\displaystyle (\Omega ,{\mathcal {F}},\mathbb {P} )} . We wish to estimate the expected value of X {\displaystyle X} under P {\displaystyle \mathbb {P} } , denoted E P [ X ] {\displaystyle \mathbb {E} _{\mathbb {P} }[X]} . If we have statistically independent random samples X 1 , … , X n {\displaystyle X_{1},\ldots ,X_{n}} , generated according to P {\displaystyle \mathbb {P} } , then an empirical estimate of E P [ X ] {\displaystyle \mathbb {E} _{\mathbb {P} }[X]} is just
E ^ P [ X ] = 1 n ∑ i = 1 n X i w h e r e X i ∼ P ( X ) {\displaystyle {\widehat {\mathbb {E} }}_{\mathbb {P} }[X]={\frac {1}{n}}\sum _{i=1}^{n}X_{i}\quad \mathrm {where} \;X_{i}\sim \mathbb {P} (X)}
and the precision of this estimate depends on the variance of X {\displaystyle X} :
var P [ E ^ P [ X ] ] = var P [ X ] n . {\displaystyle \operatorname {var} _{\mathbb {P} }{\big [}{\widehat {\mathbb {E} }}_{\mathbb {P} }[X]{\big ]}={\frac {\operatorname {var} _{\mathbb {P} }[X]}{n}}.}
The basic idea of importance sampling is to sample from a different distribution to lower the variance of the estimation of E P [ X ] {\displaystyle \mathbb {E} _{\mathbb {P} }[X]} , or when sampling directly from P {\displaystyle \mathbb {P} } is difficult. This is accomplished by first choosing a random variable Y ≥ 0 {\displaystyle Y\geq 0} such that E P [ Y ] = 1 {\displaystyle \mathbb {E} _{\mathbb {P} }[Y]=1} and that P {\displaystyle \mathbb {P} } -almost everywhere Y ( ω ) ≠ 0 {\displaystyle Y(\omega )\neq 0} . With the variable Y {\displaystyle Y} we define a probability Q {\displaystyle \mathbb {Q} } that satisfies
E P [ X ] = E Q [ X Y ] . {\displaystyle \mathbb {E} _{\mathbb {P} }[X]=\mathbb {E} _{\mathbb {Q} }\left[{\frac {X}{Y}}\right].}
… excerpt ends here. Continue reading the full article.
