regimelib

Models: mathematics and Python

  • Models: mathematics and Python
    • The common formula
    • The helpers
    • Adding jumps
      • Vasicek
      • Vasicek with jumps
      • Cox–Ingersoll–Ross
      • Hull–White
      • G2++
      • Intensity basket
      • Black–Scholes
      • Merton jump diffusion
      • Variance gamma
      • Heston
      • Bates
      • Equity with stochastic rates
      • CEV
      • Heston with a switching volatility of variance
      • Options on bonds, swaptions and caps
      • Other instruments
      • Observed and inferred regimes

Getting started

  • Getting started
    • Installation
    • Importing
    • Three lines of pricing

Reference

  • Basics
    • Regime chains
      • rl.RegimeChain()
      • rl.RegimeChain.twoState()
    • Per-regime parameters
    • Maturities and dates
    • Instruments, engines and results
      • instrument.setPricingEngine()
      • instrument.NPV()
      • instrument.delta()
    • Regimes and the starting regime
    • Warnings and diagnostics
      • rl.ExpansionWarning
  • Instruments
    • Bonds
      • rl.ZeroCouponBond()
      • rl.CouponBond()
    • Options
      • rl.VanillaOption()
      • VanillaOption.impliedVolatility()
      • rl.BarrierOption()
      • rl.ContinuousGeometricAsianOption()
    • Interest-rate options
      • rl.ZeroCouponBondOption()
      • rl.CouponBondOption()
      • rl.Swaption()
      • rl.CapFloor()
    • Credit
      • rl.CreditDefaultSwap()
      • rl.FirstToDefaultSwap()
  • Pricing engines
    • The expansion
      • rl.FastSwitchingEngine()
    • The numerical solution
      • rl.NumericalSwitchingEngine()
    • Monte Carlo
      • rl.MonteCarloSwitchingEngine()
    • Finite differences
      • rl.SwitchingFDEngine()
    • The first-order tier
      • rl.FirstOrderFDEngine()
      • rl.SwitchingFDReferee()
  • Pricing models
    • Mathematics
    • Short-rate models
      • rl.SwitchingVasicek()
      • rl.SwitchingVasicekJumps()
      • rl.SwitchingCoxIngersollRoss()
      • rl.SwitchingHullWhite()
      • rl.SwitchingG2()
      • rl.SwitchingIntensityBasket()
    • Equity models
      • rl.SwitchingBlackScholesProcess()
      • rl.SwitchingHestonModel()
      • rl.SwitchingHestonVolOfVol()
      • rl.SwitchingMerton76Process()
      • rl.SwitchingBatesModel()
      • rl.SwitchingVarianceGammaProcess()
      • rl.SwitchingCEVProcess()
    • Hybrid models
      • rl.SwitchingEquityRates()
  • Helpers and calibration
    • rl.VolatilityHelper()
    • rl.calibrate()
  • Symbolic
    • Two regimes, second order
      • rl.symbolic.VasicekTwoStateBond
    • Any chain, first order
      • rl.symbolic.VasicekBondFirstOrder
      • rl.symbolic.CIRBondFirstOrder
      • rl.symbolic.VasicekJumpsBondFirstOrder
    • Greeks in the model’s parameters
      • parameterGreek()
    • Two regimes, constant forcing
      • rl.symbolic.TwoStateConstantForcing

Background

  • The expansion
  • Certificates

Examples

  • Examples
    • A smile from a regime
    • Which order to trust
    • Default correlation from a common regime
    • A greek as a formula
regimelib
  • Search


© Copyright 2026, Peter Cotton.

Built with Sphinx using a theme provided by Read the Docs.