CommencerCommencer gratuitement

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.

Cet exercice fait partie du cours

Quantitative Risk Management in R

Afficher le cours

Instructions

  • Estimate the 99.5% sample percentile of the distribution of hslosses using quantile().
  • 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 to mu and sigma, 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.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de 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
Modifier et exécuter le code