closely follow the contours of the distribution of \(X^*\) so that chosen sampling distribution is closer to the integrand’s shape, concentrating sampling effort on areas with significant contributions.
Questions
Question 1
Consider a random variable \(X\) with a gamma distribution with parameters \(4.8\) and \(1\) (\(4.8\) is the index parameter and \(1\) is the scale parameter).
We are interested in approximating \(\Pr(X > 9.6)\). Find that with a straight forward Monte Carlo method.
Repeat by using importance sampling with the Esscher transform. Choose the tilting parameter so that the mean of the tilted distribution is \(9.6.\)
Compare your results with the true value you can get from 1−pgamma(9.6, 4.8, 1).
Using the same tilting parameter estimate \(\textrm{E}[\sqrt{X − 9.6} \mid X > 9.6]\).
Question 1.a
We are interested in approximating \(\Pr(X > 9.6)\). Find that with a straight forward Monte Carlo method.
Code
N <-10^3set.seed(123) X <-rgamma(N, 4.8, 1) est <-mean(X >9.6) true <-1-pgamma(9.6, 4.8 , 1)cat("Estimate: ", est, ", Truth: ", true, ", Error: ", abs(est - true))
Choose the tilting parameter so that the mean of the tilted distribution is \(9.6.\)
pdf of Gamma distribution with shape \(\alpha\) and scale \(\theta\): \(f_X(x) = \frac{\lambda^\alpha}{\Gamma(\alpha)} x^{\alpha - 1} \exp\{-x \lambda\}\)
MGF of Gamma distribution with shape \(\alpha\) and scale \(\theta\): \(M_X(t) = (1 - t / \lambda)^{-\alpha}\)
Mean of Gamma distribution with shape \(\alpha\) and scale \(\theta\): \(\alpha / \lambda\)
The loss to an insurer over a limited time can be described by \[
X = \sum_{i = 1}^N Y_i \,,
\] where \(N\) is a Poisson random variable with mean \(10\) and the \(Y_i\)’s are exponentially distributed with parameter \(1\). A stop-loss reinsurance is arranged with a deductible of \(17\). We are interested in expected loss to the reinsurer \(\textrm{E}[(X − 17)_+]\).
Estimate it with a straightforward Monte Carlo method as well as using importance sampling with the Esscher transform. Comment your results.
Question 2
Using importance sampling with Esscher transform, we have
N <-10^5# MC estimator MC_estimator<-function(seed){set.seed(seed) N <-rpois(1, 10) Y <-rexp(N, 1) X <-sum(Y) max(X -17, 0)}## IS estimator IS_estimator <-function(seed, t =1-sqrt(10/17)){set.seed(seed) N <-rpois(1, 10/ (1- t)) Y_s <-rexp(N, 1- t) X_s <-sum(Y_s) exp(10* t / (1- t)) *max(X_s -17, 0) *exp(-t * X_s) }MC_estimates <-vapply(1:N, MC_estimator, 0.0) IS_estimates <-vapply(1:N, IS_estimator, 0.0) means <-c(mean(MC_estimates), mean(IS_estimates)) vars <-c(var(MC_estimates), var(IS_estimates)) / N df <-data.frame(rbind(means, vars)) colnames(df) <-c("MC", "IS") rownames(df) <-c("mean", "var") print(df)
MC IS
mean 2.087753e-01 2.028024e-01
var 1.062372e-05 6.193147e-07
Question 3
Generalizing Question 2, let \[
X = \sum_{i = 1}^N Y_i \,,
\] where \(N\) is a Poisson random variable with mean \(\lambda\) and the \(Y_i\)’s have moment generating function \(M_Y(r)\).
Show that the tilted distribution can be described by \[
X_* = \sum_{i = 1}^{N^*} Y_i^* \,,
\] where \(N^*\) is a Poisson random variable with mean \(\lambda M_Y (t)\) and \(Y_i^*\)’s have moment generating function \(M_Y(r + t)/M_Y(t)\).
Show also that \(\Pr(X > b)\) can be estimated by \[
\Pr(X > b) = M_X(t) \textrm{E}_{g_{X^*}}(\exp\{-tX^*\} \mathbb{1}\{X^* > b\})
\]
Moreover, show that a good choice for \(t\) if \(\Pr(X > b)\) can be estimated is the solution of the equation \(\lambda M_{Y}'(t) = b\).
Question 3.a
As in Question 2, by conditioning on \(N\) and using that \(Y_i\)’s are i.i.d., we get that
\[
\textrm{E}_{f_Y}\left[\exp\left\{t \sum_{i = 1}^N Y_i \right\} {\Bigg \vert} N \right] = \exp \left\{N \log \left(M_Y(t) \right)\right\}
\] and again substituting \(\tilde{t} = \log \left(M_Y(t) \right)\) and using that \(M_N(t) = \exp\{ \lambda (\exp\{t\} - 1)\}\), we get \[
\begin{aligned}
M_X(t) &= \textrm{E}_{f_X}(\exp\{tX\}) \\
&= \textrm{E}_{f_N}\left(\textrm{E}_{f_Y}\left[ \exp\{t \sum_{i = 1}^N Y_i\} {\huge \vert} N \right]\right) \\
&= \textrm{E}_{f_N}\left(\exp \left\{N \log \left(M_Y(t) \right)\right\} \right) \\
&= \exp\{ \lambda (M_Y(t) - 1) \}
\end{aligned}
\]
Question 3.a
We have already established in Question 2 that \(M_{X^*}(r) =M_X(r + t) / M_X(t)\) so that
Apply the results of Question 3 to the following problem. The number of trades a day trader performs on a single day is Poisson with mean \(16\). Each trade results to a profit or loss that is normally distributed with mean \(0\) and variance \(1\). Approximate the probability that at the end of a given day, her profit is more than \(8\).
Tilted distribution
\(N^* \sim \textrm{Pois}(\lambda M_Y(t))\)
\(Y_i^*\)’s have MGF \({M_Y(t + r)} / {M_Y(t)}\)
\(M_X(t) = \exp\{\lambda (M_Y(t) - 1)\}\) MGF of normal distribution: \(M_Y(t) = \exp\{\mu t (\sigma^2 t^2) / 2 \}\)