The core analysis is contained in main.ipynb, with relevant functions and modules stored in the associated python scripts in this project for clarity (as referenced in main.ipynb).
To use main.ipynb, please create an environment with and install dependencies using:
pip install xgboost scikit-learn matplotlib pandas rich ipykernelor run the first code cell in main.ipynb while having an active Python environment with existing Jupyter support.
A worst-of option is an exotic derivative based on a basket of underlying assets. Its payoff depends on the worst-performing asset in the basket at maturity, thereby making it riskier and more complex than vanilla options.
-
Basket Dependency: Involves two or more underlying assets, typically equities or indices.
-
Payoff Trigger: The option references the minimum normalized return across assets.
-
Payoff Function:
$$\text{Payoff}_{\text{call}} = \max( \min(\bar{S}_1(T), \bar{S}_2(T)) - K, 0)$$ $$\text{Payoff}_{\text{put}} = \max(K - \min(\bar{S}_1(T), \bar{S}_2(T)), 0)$$
Where
Pricing these options is non-trivial due to:
- Dependency on multiple correlated underlyings
- Need to model asset correlations
- Non-linear payoff structure
The lack of an analytical solution makes this especially difficult. This repo implements a Monte Carlo simulation engine, with a novel control variate method to price European-style worst-of options and analyze their behavior under various market scenarios.
In this section, I detail how to generate correlated asset price paths to model a basket of 2 options and ultimately price the worst-of option derived from it. I also go into detail of how to adapt standard control variate techniques to pricing worst-of options, which reduce the variance of monte carlo paths.
To simulate correlated asset terminal values, we can use a direct implementation of the GBM solution with Cholesky decomposition. Starting with uncorrelated standard normal variables
This transformation forces
This approach ensures that the log returns of both assets from initial to terminal time maintain correlation
where:
are the normalized maturity prices. By engineering correlation at the log-return level over the entire time horizon, we capture the fundamental relationship between asset movements in a single step, which is computationally more efficient than simulating the full path while maintaining consistency with financial theory.
For basket options with worst-of payoffs, we can extend the control variate technique using an indicator-based approach that focuses on the asset determining the payoff. Since the option pays based on the worst-performing asset, we apply a selective control variate adjustment with:
where
$I(\bar{S}_T) = 1 \text{ if } \bar{S}_T^{(1)} \leq \bar{S}_T^{(2)}, \text{else } 0$
is an indicator function which is
This approach targets the variance reduction specifically to the asset driving the payoff in each simulation path. The underlying asset correlation structure is implicitly captured through the Monte Carlo paths generated via Cholesky decomposition, without requiring explicit handling in the control variate implementation. This selective adjustment efficiently reduces variance in worst-of option pricing, particularly for options sensitive to the relative performance between the basket assets.
The implementation is contained in worst_of_option.py, which follows a similar structure to monte_carlo.py. The key differences are:
- The
generate_correlated_pathsfunction creates correlated asset paths for multi-asset options - The
monte_carlo_worstof_optionfunction handles:
- Calculating the nonlinear worst-of payoff
- Implementing the custom control variate model
- Computing the final option price
While this method effectively generalizes the approach and experiments confirm variance reduction, there are opportunities for enhancement. The control variate model faces challenges with discontinuities at boundaries where assets have similar performance, and the current formulation of
These limitations occasionally affected the calculation of monte_carlo_worstof_option:
- A
dampening_factorparameter to scale the control variate correction (providing smaller corrections) - A
clip_payoffsargument to ensure non-negative payoffs
These adjustments successfully balance variance reduction with pricing accuracy for most scenarios. Future enhancements could incorporate correlation coefficients
The worst_of flag in generate_option_dataset provides us a synthetic dataset of a basket of two option contracts, with all the relevant parameters we will need to model a worst-of option.