1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>QuantLib: Short-rate modelling framework</title>
<link href='https://fonts.googleapis.com/css?family=Merriweather+Sans:800' rel='stylesheet' type='text/css'>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="quantlibextra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname"><a href="http://quantlib.org">
<img alt="QuantLib" src="QL-title.jpg"></a>
<div id="projectbrief">A free/open-source library for quantitative finance</div>
<div id="projectnumber">Reference manual - version 1.20</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<div class="title">Short-rate modelling framework</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_generalized_hull_white.html">GeneralizedHullWhite</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Generalized Hull-White model class. <a href="class_quant_lib_1_1_generalized_hull_white.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_affine_model.html">AffineModel</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Affine model class. <a href="class_quant_lib_1_1_affine_model.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_term_structure_consistent_model.html">TermStructureConsistentModel</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Term-structure consistent model class. <a href="class_quant_lib_1_1_term_structure_consistent_model.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_short_rate_model.html">ShortRateModel</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Abstract short-rate model class. <a href="class_quant_lib_1_1_short_rate_model.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_one_factor_model.html">OneFactorModel</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Single-factor short-rate model abstract class. <a href="class_quant_lib_1_1_one_factor_model.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_one_factor_affine_model.html">OneFactorAffineModel</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Single-factor affine base class. <a href="class_quant_lib_1_1_one_factor_affine_model.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_black_karasinski.html">BlackKarasinski</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Standard Black-Karasinski model class. <a href="class_quant_lib_1_1_black_karasinski.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_cox_ingersoll_ross.html">CoxIngersollRoss</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Cox-Ingersoll-Ross model class. <a href="class_quant_lib_1_1_cox_ingersoll_ross.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_extended_cox_ingersoll_ross.html">ExtendedCoxIngersollRoss</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Extended Cox-Ingersoll-Ross model class. <a href="class_quant_lib_1_1_extended_cox_ingersoll_ross.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_hull_white.html">HullWhite</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Single-factor Hull-White (extended Vasicek) model class. <a href="class_quant_lib_1_1_hull_white.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_vasicek.html">Vasicek</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Vasicek model class <a href="class_quant_lib_1_1_vasicek.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_two_factor_model.html">TwoFactorModel</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Abstract base-class for two-factor models. <a href="class_quant_lib_1_1_two_factor_model.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_g2.html">G2</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Two-additive-factor gaussian model class. <a href="class_quant_lib_1_1_g2.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>This framework (corresponding to the ql/ShortRateModels directory) implements some single-factor and two-factor short rate models. The models implemented in this library are widely used by practitionners. For the moment, the ShortRateModels::Model class defines the short-rate dynamics with stochastic equations of the type </p><p class="formulaDsp">
\[ dx_i = \mu(t,x_i) dt + \sigma(t,x_i) dW_t \]
</p>
<p> where \( r = f(t,x) \). If the model is affine (i.e. derived from the <a class="el" href="class_quant_lib_1_1_affine_model.html" title="Affine model class.">QuantLib::AffineModel</a> class), analytical formulas for discount bonds and discount bond options are given (useful for calibration).</p>
<h1><a class="anchor" id="singlefactormodels"></a>
Single-factor models</h1>
<dl class="section user"><dt>The Hull & White model</dt><dd><p class="formulaDsp">
\[ dr_t = (\theta(t) - \alpha(t) r_t)dt + \sigma(t) dW_t \]
</p>
When \( \alpha \) and \( \sigma \) are constants, this model has analytical formulas for discount bonds and discount bond options.</dd></dl>
<dl class="section user"><dt>The Black-Karasinski model</dt><dd><p class="formulaDsp">
\[ d\ln{r_t} = (\theta(t) - \alpha \ln{r_t})dt + \sigma dW_t \]
</p>
No analytical tractability here.</dd></dl>
<dl class="section user"><dt>The extended Cox-Ingersoll-Ross model</dt><dd><p class="formulaDsp">
\[ dr_t = (\theta(t) - k r_t)dt + \sigma \sqrt{r_t} dW_t \]
</p>
There are analytical formulas for discount bonds (and soon for discount bond options).</dd></dl>
<h1><a class="anchor" id="calibration"></a>
Calibration</h1>
<p>The class CalibrationHelper is a base class that facilitates the instanciation of market instruments used for calibration. It has a method marketValue() that gives the market price using a Black formula, and a modelValue() method that gives the price according to a model</p>
<p>Derived classed are <a class="el" href="class_quant_lib_1_1_cap_helper.html" title="calibration helper for ATM cap">QuantLib::CapHelper</a> and <a class="el" href="class_quant_lib_1_1_swaption_helper.html" title="calibration helper for ATM swaption">QuantLib::SwaptionHelper</a>.</p>
<p>For the calibration itself, you must choose an optimization method that will find constant parameters such that the value: </p><p class="formulaDsp">
\[ V = \sqrt{\sum_{i=1}^{n} \frac{(T_i - M_i)^2}{M_i}}, \]
</p>
<p> where \( T_i \) is the price given by the model and \( M_i \) is the market price, is minimized. A few optimization methods are available in the ql/Optimization directory.</p>
<h1><a class="anchor" id="twofactormodels"></a>
Two-factor models</h1>
<h1><a class="anchor" id="pricers"></a>
Pricers</h1>
<dl class="section user"><dt>Analytical pricers</dt><dd></dd></dl>
<p>If the model is affine, i.e. discount bond options formulas exist, caps are easily priced since they are a portfolio of discount bond options. Such a pricer is implemented in QuantLib::AnalyticalCapFloor. In the case of single-factor affine models, swaptions can be priced using the Jamshidian decomposition, implemented in QuantLib::JamshidianSwaption.</p>
<dl class="section user"><dt>Using Finite Differences</dt><dd></dd></dl>
<p>(Doesn't work for the moment) For the moment, this is only available for single-factor affine models. If \( x = x(t, r) \) is the state variable and follows this stochastic process: </p><p class="formulaDsp">
\[ dx_t = \mu(t,x)dt + \sigma(t,x)dW_t \]
</p>
<p> any european-style instrument will follow the following PDE:</p>
<p class="formulaDsp">
\[ \frac{\partial P}{\partial t} + \mu \frac{\partial P}{\partial x} + \frac{1}{2} \sigma^2 \frac{\partial^2 P}{\partial x^2} = r(t,x)P \]
</p>
<p>The adequate operator to feed a Finite Difference Model instance is defined in the <a class="el" href="group__findiff.html#gab2342f59174f2223a9889acf4a86496a" title="Interest-rate single factor model differential operator.">QuantLib::OneFactorOperator</a> class.</p>
<dl class="section user"><dt>Using Trees</dt><dd></dd></dl>
<p>Each model derived from the single-factor model class has the ability to return a trinomial tree. For yield-curve consistent models, the fitting parameter can be determined either analytically (when possible) or numerically. When a tree is built, it is then pretty straightforward to implement a pricer for any path-independent derivative. Just implement a class derived from NumericalDerivative (see QuantLib::NumericalSwaption for example) and roll it back until the present time... Just look at QuantLib::TreeCapFloor and QuantLib::TreeSwaption for working pricers. </p>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.9.1-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="http://www.doxygen.org/index.html">Doxygen</a>
1.8.20
</small></address>
</body>
</html>
|