The algorithm for this procedure is
- Use the uniform distribution to find the random variable y in the interval [0,1]. The function p(x) is a user provided PDF.
- Evaluate thereafter
I=∫baF(x)dx=∫bap(x)F(x)p(x)dx,
by rewriting
∫bap(x)F(x)p(x)dx=∫˜b˜aF(x(y))p(x(y))dy,
since
dydx=p(x).
- Perform then a Monte Carlo sampling for
∫˜b˜aF(x(y))p(x(y))dy≈1NN∑i=1F(x(yi))p(x(yi)),
with
yi∈[0,1],
- and evaluate the variance as well.