Bermudan Option
Bermudan Option Pricing Module This module provides functionality for pricing Bermudan options using a binomial tree model.
- torchquantlib.core.asset_pricing.option.bermudan_option.bermudan_option(option_type: str, spot: Tensor, strike: Tensor, expiry: Tensor, volatility: Tensor, rate: Tensor, steps: int, exercise_dates: Tensor) Tensor[source]
Price a Bermudan option using a binomial tree model.
This function implements a binomial tree approach to price Bermudan options, which are options that can be exercised on specific dates before expiration.
- Parameters:
option_type (str) – Type of option - either ‘call’ or ‘put’.
spot (Tensor) – Current price of the underlying asset.
strike (Tensor) – Strike price of the option.
expiry (Tensor) – Time to expiration in years.
volatility (Tensor) – Volatility of the underlying asset.
rate (Tensor) – Risk-free interest rate (annualized).
steps (int) – Number of time steps in the binomial tree.
exercise_dates (Tensor) – Tensor of indices representing the steps at which the option can be exercised.
- Returns:
The price of the Bermudan option.
- Return type:
Tensor
Note
This implementation combines features of European and American options. It allows for early exercise, but only on specified dates.
Overview
The Bermudan Option module provides functionality for pricing Bermudan-style options using a binomial tree model. Bermudan options are a type of exotic option that can be exercised on specific dates before expiration, combining features of both American and European options.
Key Features
Pricing of Bermudan call and put options
Implementation using a binomial tree model
Support for multiple exercise dates
Functions
- torchquantlib.core.asset_pricing.option.bermudan_option.bermudan_option(option_type: str, spot: Tensor, strike: Tensor, expiry: Tensor, volatility: Tensor, rate: Tensor, steps: int, exercise_dates: Tensor) Tensor[source]
Price a Bermudan option using a binomial tree model.
This function implements a binomial tree approach to price Bermudan options, which are options that can be exercised on specific dates before expiration.
- Parameters:
option_type (str) – Type of option - either ‘call’ or ‘put’.
spot (Tensor) – Current price of the underlying asset.
strike (Tensor) – Strike price of the option.
expiry (Tensor) – Time to expiration in years.
volatility (Tensor) – Volatility of the underlying asset.
rate (Tensor) – Risk-free interest rate (annualized).
steps (int) – Number of time steps in the binomial tree.
exercise_dates (Tensor) – Tensor of indices representing the steps at which the option can be exercised.
- Returns:
The price of the Bermudan option.
- Return type:
Tensor
Note
This implementation combines features of European and American options. It allows for early exercise, but only on specified dates.
Price a Bermudan option using a binomial tree model.
- Parameters:
option_type (str) – Type of option - either ‘call’ or ‘put’
spot (Tensor) – Current price of the underlying asset
strike (Tensor) – Strike price of the option
expiry (Tensor) – Time to expiration in years
volatility (Tensor) – Volatility of the underlying asset
rate (Tensor) – Risk-free interest rate (annualized)
steps (int) – Number of time steps in the binomial tree
exercise_dates (Tensor) – Tensor of indices representing the steps at which the option can be exercised
- Returns:
The price of the Bermudan option
- Return type:
Tensor
Examples
Here’s a basic example of how to use the bermudan_option function:
import torch
from torchquantlib.core.asset_pricing.option.bermudan_option import bermudan_option
# Set option parameters
option_type = 'call'
spot = torch.tensor(100.0)
strike = torch.tensor(95.0)
expiry = torch.tensor(1.0)
volatility = torch.tensor(0.2)
rate = torch.tensor(0.05)
steps = 100
exercise_dates = torch.tensor([25, 50, 75]) # Exercise allowed at 1/4, 1/2, and 3/4 of the option's life
# Price the Bermudan option
price = bermudan_option(option_type, spot, strike, expiry, volatility, rate, steps, exercise_dates)
print(f"Bermudan {option_type} option price: {price:.4f}")