Estimating VaR and ES for option portfolio
Now you are ready to estimate VaR and ES for the investor in the European call option using the historically simulated losses and gains in hslosses
.
Once again, you will do this by two methods. First, you will apply a non-parametric method using a sample quantile to estimate VaR and calculate the average of values exceeding the same quantile to estimate ES.
Then, you will compare these estimates with the values obtained when you assume that the hslosses
have a normal distribution. Like in the previous exercise, this is a bad assumption and you should compare the two sets of estimates to see which are more conservative.
This exercise is part of the course
Quantitative Risk Management in R
Exercise instructions
- Estimate the 99.5% sample percentile of the distribution of
hslosses
usingquantile()
. - Estimate the 99.5% ES by computing the mean of the
hslosses
that are at least as large as the VaR estimate (this has been done for you). - Use the appropriate functions to estimate the mean and standard deviation of
hslosses
and assign tomu
andsigma
, respectively. - Use
qnorm()
with the calculated mean and standard deviation to compute the 99.5% quantile of a normal distribution. - Use
ESnorm()
with the calculated mean and standard deviation to compute the 99.5% ES of a normal distribution.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Estimate the 99.5% percentile of the distribution
# Estimate the 99.5% ES
mean(hslosses[hslosses >= quantile(hslosses, 0.995)])
# Estimate the mean and standard deviation of hslosses
# Compute the 99.5% quantile of a normal distribution
# Compute the 99.5% ES of a normal distribution