next up previous
Next: Monte Carlo Simulation Up: Importance Sampling Previous: Exercise 10.3: Importance sampling

Exercise 10.4: The Metropolis algorithm

Use the Metropolis algorithm to sample points according to a ditribution and estimate the integral

\begin{displaymath}
\int _0^4 {x^2e^{-x}dx},
\end{displaymath}

with $P(x)=x^2e^{-x}$ for $0 \leq x \leq 4$. Plot the number of times the walker is at points $x_0$, $x_1$, $x_2$, ... Is the integrand sampled uniformly? If not, what is the approximate region of $x$ where the integrand is sampled more often?



Adrian E. Feiguin 2009-11-04