QuantLib Documentation
repository·master·Indexed 27 days ago
https://github.com/lballabio/quantlibAn 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.
What's inside QuantLib
- The QuantLib test suite is built using the Boost unit-test framework. To run the tests, you must have Boost version 1.30.2 or later installed on your system.
Get support and report bugs in QuantLib
masterFor technical questions, use thequantlib-usersmailing list. To report bugs or submit patches, use the GitHub issues page or open a pull request.Access QuantLib documentation and usage guides
masterComprehensive documentation covering the usage and design of the QuantLib library is available on the official website.Download and install QuantLib
masterQuantLib can be downloaded from the official website. Installation instructions for most platforms are provided in the official installation guide.Run the quantlib-benchmark performance tool
masterThequantlib-benchmarkexecutable 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-benchmarkPrice Bermudan Swaptions using QuantLib
masterThe
BermudanSwaptionexample 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).
Use LatentModel as an example for modeling correlated defaults
masterTheLatentModelserves 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.Use the FittedBondCurve example to fit discount curves
masterThe
FittedBondCurveexample 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.
Value convertible bonds with embedded put options
masterThe
ConvertibleBondsexample 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
Value equity options using the EquityOption example
masterThe
EquityOptionexample 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.
Use GlobalOptimizer for global optimization examples
masterThe
GlobalOptimizerexample 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
Use the DiscreteHedging example to study Monte Carlo simulation
masterTheDiscreteHedgingexample 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."