Objective of the Project

The purpose of this project is to price a European-style Down-and-Out Put Option using Monte Carlo simulation methods implemented via the Rcpp package.

Barrier options are unique financial derivatives that depend not only on the price of the underlying asset but also on whether the asset price breaches a certain barrier during the option’s life. This report explores:

  1. The theoretical price of the option, which reflects the fair value under the assumed market conditions.
  2. The relationship between the theoretical price and two major factors:
    • Volatility of the underlying asset’s returns, which represents the uncertainty in market movement.
    • Time to maturity, which affects the probability of the barrier being breached or the option expiring in-the-money.

The goal is to deliver an insightful analysis combining financial modeling with computational techniques to offer a robust understanding of barrier options, accompanied by detailed visualizations.

Assumptions

This study relies on the following assumptions:

Key parameters include:

These parameters reflect realistic market conditions and ensure that the analysis captures critical aspects of barrier options.

Methodology

To price the Down-and-Out Put Option, we used Monte Carlo simulation implemented in C++ via the Rcpp package. The key steps include:

  1. Path Generation: Simulate multiple price paths of the underlying asset using geometric Brownian motion.
  2. Barrier Condition Check: Determine if the price path breaches the barrier at any point during its life.
  3. Payoff Calculation: Compute the payoff for paths where the barrier condition is not violated:

\[ \Phi_t = \max(K - S_T, 0), \text{ if } \min(S_t) \geq b \]

  1. Discounting and Averaging: Discount the payoff to present value and average over all valid paths.

This approach captures the stochastic nature of financial markets while providing flexibility to analyze various parameter configurations.

Implementation

Loading Required Libraries and Code

The Rcpp package enables seamless integration of C++ code with R. The required libraries and source files are loaded as follows:

library(Rcpp)
sourceCpp("/Users/reyhanqurbanova/Desktop/src/main.cpp")

Function to Price the Option

A wrapper function in R simplifies interaction with the underlying C++ code:

priceDownAndOutPut <- function(nInt, strike, spot, vol, r, expiry, nReps, barrier) {
  priceOption(nInt, strike, spot, vol, r, expiry, nReps, "DownAndOutPut", barrier)
}

Calculate Option Price

The theoretical price of the Down-and-Out Put Option is computed with the following parameters:

option_price <- priceDownAndOutPut(
  nInt = 100, 
  strike = 110, 
  spot = 105, 
  vol = 0.21, 
  r = 0.05, 
  expiry = 0.75, 
  nReps = 10000, 
  barrier = 95
)

cat("Theoretical price of the Down-and-Out Put Option: ", round(option_price, 4))
## Theoretical price of the Down-and-Out Put Option:  0.7248

Simulation Results

Sensitivity Analysis: Volatility and Time to Maturity

The impact of volatility and time to maturity on the option price is analyzed by simulating prices across a range of these parameters:

vol_range <- seq(0.1, 0.5, by = 0.05)
time_range <- seq(0.25, 2, by = 0.25)

sensitivity_results <- expand.grid(vol = vol_range, time = time_range)
sensitivity_results$price <- mapply(
  function(vol, time) {
    priceDownAndOutPut(100, 110, 105, vol, 0.05, time, 10000, 95)
  },
  sensitivity_results$vol, sensitivity_results$time
)

library(ggplot2)
ggplot(sensitivity_results, aes(x = vol, y = time, fill = price)) +
  geom_tile() +
  labs(
    title = "Sensitivity of Option Price to Volatility and Time to Maturity",
    x = "Volatility",
    y = "Time to Maturity",
    fill = "Option Price"
  ) +
  theme_minimal()

Additional Visualizations

Price Distribution Across Simulations

This histogram visualizes the variability in simulated option prices:

simulation_prices <- replicate(100, priceDownAndOutPut(100, 110, 105, 0.21, 0.05, 0.75, 10000, 95))

ggplot(data.frame(price = simulation_prices), aes(x = price)) +
  geom_histogram(bins = 30, fill = "blue", alpha = 0.7) +
  labs(
    title = "Distribution of Simulated Option Prices",
    x = "Simulated Price",
    y = "Frequency"
  ) +
  theme_minimal()

Price Evolution Over Time

The price evolution is explored by analyzing how the option price changes as the time to maturity varies:

time_steps <- seq(0.1, 1, by = 0.1)
price_over_time <- sapply(time_steps, function(t) priceDownAndOutPut(100, 110, 105, 0.21, 0.05, t, 10000, 95))

ggplot(data.frame(time = time_steps, price = price_over_time), aes(x = time, y = price)) +
  geom_line(color = "red", size = 1) +
  labs(
    title = "Option Price Evolution Over Time",
    x = "Time to Maturity",
    y = "Option Price"
  ) +
  theme_minimal()
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

Conclusion

The findings from this analysis reveal key insights into the behavior of Down-and-Out Put Options:

  1. Volatility as a Critical Factor:
    • Higher volatility leads to an increased option price. This is due to the greater likelihood of the underlying asset moving significantly, which increases the chances of favorable payoffs before breaching the barrier.
  2. Impact of Time to Maturity:
    • Time to maturity plays a nuanced role. While a longer duration initially increases the option’s value by providing more time for profitable movements, it also raises the likelihood of the barrier being breached, potentially nullifying the option’s value.
  3. Barrier Sensitivity:
    • The barrier level is a defining characteristic of Down-and-Out Options. A carefully chosen barrier ensures that the option retains its utility while offering cost-effective hedging opportunities.
  4. Practical Applications:
    • These options are invaluable in risk management strategies, allowing traders and institutions to hedge against unfavorable market movements with precision.

The combination of financial modeling and computational simulations showcased in this report highlights the dynamic interplay between market factors and option characteristics. This analysis serves as a foundation for further exploration into exotic options and their applications in complex financial markets.

Declaration

In accordance with the Honor Code, I certify that my answers here are my own work, and I did not make my solutions available to anyone else.