QuantLib Documentation

repository·master·Indexed 27 days ago

https://github.com/lballabio/quantlib

An open-source software framework for quantitative finance used for modeling, trading, and risk management. The library provides tools for pricing equity options, Bermudan swaptions, convertible bonds, and credit-default swaps, as well as frameworks for interest-rate modeling, multicurve bootstrapping, and global optimization. It includes utilities such as quantlib-config for build flags, quantlib-benchmark for performance measurement, and a comprehensive test suite based on the Boost framework.

Tokens
1.6K
Snippets
4
Records
20
Agent score
93%

What's inside QuantLib

  1. Run the quantlib-benchmark performance tool

    master
    The quantlib-benchmark executable is a performance benchmark tool created at compile-time from the QuantLib sources using the Boost test framework. It measures the performance of a preselected set of numerically intensive test cases. The tool outputs an overall QuantLib Benchmark Index, which is the average performance expressed in mflops (millions of floating point operations per second).
    quantlib-benchmark
  2. Price Bermudan Swaptions using QuantLib

    master

    The BermudanSwaption example demonstrates how to use the QuantLib interest-rate model framework to price Bermudan swaptions. It showcases calibrating different models to market swaptions, including:

    • Hull and White model: Using both analytic formulas and numerical methods.
    • Black model.
    • Karasinski model.

    The example demonstrates pricing for various volatility scenarios: at-the-money (ATM), out-of-the-money (OTM), and in-the-money (ITM).

  3. Use LatentModel as an example for modeling correlated defaults

    master
    The LatentModel serves as a practical example within QuantLib demonstrating how to model correlated defaults. It is intended to show users how to leverage QuantLib's core components to implement complex quantitative finance models involving default correlations.
  4. Use the FittedBondCurve example to fit discount curves

    master

    The FittedBondCurve example demonstrates how to use QuantLib to compute bond values by fitting yields to a curve based on a given set of coupons and terms to maturity.

    Supported fitting methods include:

    • Exponential splines
    • Simple polynomials
    • Nelson-Siegel
    • Cubic B-splines

    The example also demonstrates:

    • Shifting the evaluation date into the future to compute implied forward par rates.
    • Computing yields after applying small price shifts.
  5. Value convertible bonds with embedded put options

    master

    The ConvertibleBonds example demonstrates how to use QuantLib to value convertible bonds that include an embedded put option. It supports two equity option types (European and American exercise features) using the Tsiveriotis-Fernandes method.

    Users can choose from several implied tree algorithms for the valuation:

    • Jarrow-Rudd
    • Cox-Ross-Rubinstein
    • Additive equiprobabilities
    • Trigeorgis
    • Tian
    • Leisen-Reimer
  6. Value equity options using the EquityOption example

    master

    The EquityOption example demonstrates how to use QuantLib to value different types of equity options (European, Bermudan, and American) using various valuation algorithms.

    Supported valuation methods include:

    • Black-Scholes: European options only.
    • Barone-Adesi/Whaley: American options only.
    • Bjerksund/Stensland: American options.
    • Integral: European options.
    • Finite differences: Various exercise features.
    • Binomial models: Jarrow-Rudd, Cox-Ross-Rubinstein, Trigeorgis, Tian, and Leisen-Reimer.
    • Monte Carlo: Crude Monte Carlo and Sobol-sequence Monte Carlo (European options only).
    • Additive equiprobabilities.
  7. Use GlobalOptimizer for global optimization examples

    master

    The GlobalOptimizer example demonstrates how to perform global optimization within QuantLib using various algorithms. It serves as a reference for implementing different optimization methods for quantitative finance problems.

    Supported optimization methods illustrated in this example include:

    • Firefly Algorithm
    • Hybrid Simulated Annealing
    • Particle Swarm Optimization
    • Simulated Annealing
    • Differential Evolution
  8. Use the DiscreteHedging example to study Monte Carlo simulation

    master
    The DiscreteHedging example demonstrates how to use the QuantLib Monte Carlo simulation framework. It specifically computes the profit and loss (P&L) of a discrete interval hedging strategy. This example is designed to compare simulation results against the outcomes described in Derman and Kamal's research note, "When You Cannot Hedge Continuously: The Corrections to Black-Scholes."