Get startedGet started for free

Historical simulation of losses for option portfolio

Suppose that an investor has invested one unit of wealth in a single European call option on the S&P 500 index. The function lossop() computes the loss or gain incurred by the investor over a one-day time horizon due to changes in the log stock price or changes in the log volatility. As before, this function has been written specially for the particular portfolio in this exercise:

lossop(xseries, S, sigma)

The first argument contains the log returns corresponding to the stock price and volatility risk factors, either in a series or in form c(stock_risk, volatility_risk), S is the current stock price, and sigma is the current volatility.

Changes in the interest rate over the time horizon will be neglected as being of lesser importance.

In this exercise, you will form the historically simulated losses for the option portfolio and examine their properties before estimating VaR and ES in the next exercise. The interest rate, strike price, and maturity have been set to r = 0.01, K = 100 and T = 1, respectively. The returns object is also in your workspace.

This exercise is part of the course

Quantitative Risk Management in R

View Course

Exercise instructions

  • Use lossop() to calculate the loss resulting from a log-return of -0.1 for both risk factors, assuming the current stock price is 80 and volatility is 0.2.
  • Use lossop() to calculate the loss resulting from a log-return of -0.1 for the stock and 0.1 for the volatility, assuming the current stock price is 100 and volatility is 0.2.
  • Create the object hslosses by applying lossop() to returns, assuming S = 100 and sigma = 0.2, and then plot hslosses.
  • Form a Q-Q plot of hslosses against the normal distribution.
  • Plot the sample acf of hslosses and of the corresponding absolute values.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Calculate the first loss
lossop(c(___,___), S = ___, sigma = ___)

# Calculate the second loss


# Create and plot hslosses



# Form a Q-Q plot of hslosses against normal


# Plot the sample acf of raw data and absolute values in hslosses

Edit and Run Code