1
$\begingroup$

Estimate $\int^{1}_{0}e^{x} dx$ using importance sampling. Should I use beta distribution as proposal distribution and uniform distribution as target ?

$\endgroup$
1
  • $\begingroup$ please add the self-study tag and explain why using one versus the other is an issue. $\endgroup$
    – Xi'an
    Nov 24, 2019 at 7:54

2 Answers 2

5
$\begingroup$

As the range of the integral is $(0,1)$, it is better to take an importance density restricted to $(0,1)$ like the Uniform $\mathcal U(0,1)$ or a Beta $\mathcal Be(a,b)$, rather than an importance function with a larger support like Exponential or Normal. Intuitively, including a random number of zeroes in the Monte Carlo average is both a waste of computer time and an unnecessary source of randomness! Here is a comparison of the four (for 10³ simulations, replicated 10² times):

enter image description here

that seems to put a black mark on the Beta. However, the choice of a Beta $\mathcal B(2,1)$ is quite poor as $$\frac{\exp(-x)}{x^{2-1}(1-x)^{1-1}}$$ has infinite variance. Using instead a Beta $\mathcal B(1/2,1)$ leads to much better performances:

enter image description here

As a final experiment, restricting the simulations of both Exponential and Normal variates to $(0,1)$ leads to an obvious improvement

enter image description here

with a zero variance in the case of the truncated Exponential importance function, since it uses the probability of being between $0$ and $1$, which is the value of the integral itself.

$\endgroup$
2
$\begingroup$

This integral is easy using direct monte carlo integration, however if you want to use importance sampling, you can choose the target distribution as $f(x)=e^x$, i.e. harder to sample than uniform. And $h(x)=\Pi(x)$, i.e. $1$ within $[0,1]$ and zero otherwise. Choose normal ($g(x)=\frac{1}{\sqrt{2\pi}}e^{-x^2/2})$ or beta if you want, sample from it and take the mean, i.e. $$I\approx \frac{1}{N}\sum_{x \sim g(x)} \frac{f(x)h(x)}{g(x)}$$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.