Solve the following problem:
Given the Gumbel distribution, with density f(x) = exp{x - exp(x)} over the real line, we are interested in comparing the variability of regular importance sampling based on a normal importance function with the variability of the corresponding self-normalized version of (3.7).
a. Show that the expectation of exp(X) is well-defined for the Gumbel distribution.
b. Create a matrix x of normal simulations with 100 columns using rnorm(100*10^4) and deduce the importance weights we.
c. Deduce the regular and the self-normalized sequences of estimators of E[exp(X)] by
> nore=apply(we*exp(x), 2,cumsum)/ (1:10ˆ4)
> reno=apply(we*exp(x), 2,cumsum)/ apply(we,2,cumsum)
and plot the ranges of both sequences of estimates using polygon.