Examples#

This gallery walks through every public feature of financialkit.interest_rate_models: equilibrium and affine short-rate models, models fitted to today’s curve, bond options, caps, floors and swaptions, and the Heath-Jarrow-Morton framework. Each script illustrates one dated breakthrough from the history page.

See also the narrative tutorial:

Each script in this gallery is self-contained and can be run directly with python examples/interest_rate_models/<section>/<script>.py.

Sections#

  • short_rate – Feynman-Kac bond prices by simulation, Feller’s boundary condition, Merton’s Gaussian rate, Vasicek, Cox-Ingersoll-Ross, Duffie-Kan affine models and the two-factor G2++.

  • curve_fitted – Ho-Lee, Hull-White, the Black-Derman-Toy tree and the futures convexity adjustment.

  • options – Jamshidian’s bond options and swaptions, caps and floors by Black’s formula, and Black swaptions.

  • hjm – the Heath-Jarrow-Morton drift condition.

Curve-fitted models#

Arbitrage-free models that take today’s yield curve as an input: Ho-Lee, Hull-White and the Black-Derman-Toy tree, and the convexity gap between futures and forward rates that they predict.

Ho-Lee: the first arbitrage-free term-structure model

Ho-Lee: the first arbitrage-free term-structure model

Hull-White: extended Vasicek

Hull-White: extended Vasicek

Black-Derman-Toy: a lognormal rate tree

Black-Derman-Toy: a lognormal rate tree

The futures convexity adjustment

The futures convexity adjustment

Heath-Jarrow-Morton#

Modelling the whole forward curve, and the drift condition that absence of arbitrage imposes on it.

Heath-Jarrow-Morton: the drift condition

Heath-Jarrow-Morton: the drift condition

Rate options#

Options on bonds, caps, floors and swaptions: Jamshidian’s closed form and decomposition in Gaussian short-rate models, and Black’s formula in the LIBOR and swap market models.

Jamshidian: an exact bond option formula

Jamshidian: an exact bond option formula

Jamshidian’s decomposition: swaptions in one-factor models

Jamshidian's decomposition: swaptions in one-factor models

Brace-Gatarek-Musiela: caps and floors by Black’s formula

Brace-Gatarek-Musiela: caps and floors by Black's formula

Jamshidian’s swap market model: Black swaptions

Jamshidian's swap market model: Black swaptions

Short-rate models#

Models of the instantaneous short rate that produce their own yield curve: Merton, Vasicek and Cox-Ingersoll-Ross, the affine family that contains them, and the two-factor G2++, all checked against Feynman-Kac Monte Carlo.

Feynman-Kac: bond prices by Monte Carlo

Feynman-Kac: bond prices by Monte Carlo

Feller’s boundary condition

Feller's boundary condition

Merton’s Gaussian short rate

Merton's Gaussian short rate

Vasicek’s mean-reverting short rate

Vasicek's mean-reverting short rate

Cox-Ingersoll-Ross: the square-root short rate

Cox-Ingersoll-Ross: the square-root short rate

Duffie-Kan: affine term structures

Duffie-Kan: affine term structures

Brigo-Mercurio G2++: two Gaussian factors

Brigo-Mercurio G2++: two Gaussian factors

Gallery generated by Sphinx-Gallery