Quant Finance: Black–Derman–Toy Model in Python

 The Black–Derman–Toy (BDT) model is a one-factor interest rate model used in quantitative finance for pricing interest rate derivatives. It models the evolution of the short rate 


r(t)r(t) under a recombining binomial tree, where the rate follows:

r(t+1)=r(t)eσzr(t+1) = r(t) \cdot e^{\sigma \cdot z}

Here:

  • r(t)r(t) is the short rate at time tt,
  • σ\sigma is the volatility of interest rates,
  • zz is a random variable with values ±1\pm 1.

The BDT model calibrates to market data (e.g., zero-coupon bond prices) to ensure no arbitrage. Here's a Python implementation:

This script consists of two main functions:

  1. bdt_model: Constructs the binomial tree for short rates using the given initial rate, volatility, and number of periods.
  2. bond_price: Uses backward induction to calculate the price of a bond by discounting cash flows through the tree.

Example Output:

For an initial short rate of 5%, 20% volatility, and a 3-period tree, the short rate tree and bond price will be printed.

You can extend this implementation to calibrate the tree to observed bond prices or other interest rate derivatives. Let me know if you want to explore enhancements like calibration or derivative pricing!