Date: Sat, 26 Nov. 2022 08:49:47 +00:00
Mime-Version: 1.0 (Produced by Tiki)
Content-Type: application/x-tikiwiki;
pagename=Sampling;
flags="";
author=david.legrady;
version=3;
lastmodified=1329561896;
author_id=188.142.216.4;
summary="";
hits=2719;
description="";
charset=utf-8
Content-Transfer-Encoding: binary
The most programming languages offer a (pseudo)random number generator that gives samples of a uniform distribution in the range of (0,1).
A common MC sampling technique is the inverse cumulative method that using the uniformly sampled ''r'' random number produces a sample of the pdf:
{EQUATION(size="70")}$ x_{i}=\left [\int_{-\infty}^{ X}\wp \left ( x \right )dx \right ]^{-1}\left ( r \right ) {EQUATION}
We will see an example to this in the next section.
A lot simpler, but a lot less effective method is when we chose a pdf {EQUATION(size="70")}$ q {EQUATION} that we can easily be sampled (it can simply be the uniform distribution and ''r'' is automatically a sample of it). Now let us write the integral like this:
{EQUATION(size="70")}$ R=\int q\left ( P \right ) \frac{\wp\left ( P \right )}{q\left ( P \right )} D\left ( P \right )dP {EQUATION}
let us choose P{SUB()}i{SUB} from q our estimate should be:
{EQUATION(size="70")}$ R\approx \frac{1}{N}\sum_{i=1}^{N}\frac{\wp\left ( P_{i} \right )}{q\left ( P_{i} \right )}D\left (P_{i} \right ) {EQUATION}
The new quantity arising is {EQUATION(size="70")}$ w_{i} = \frac{\wp\left ( P_{i} \right )}{q\left ( P_{i} \right )} {EQUATION} the weight of the particle.
The next section shows the sampling of the free flight distance.