QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
pages
fixedincome.docs
Go to the documentation of this file.
1
2
/*
3
Copyright (C) 2000-2003 Sadruddin Rejeb
4
5
This file is part of QuantLib, a free-software/open-source library
6
for financial quantitative analysts and developers - http://quantlib.org/
7
8
QuantLib is free software: you can redistribute it and/or modify it
9
under the terms of the QuantLib license. You should have received a
10
copy of the license along with this program; if not, please email
11
<quantlib-dev@lists.sf.net>. The license is also available online at
12
<http://quantlib.org/license.shtml>.
13
14
This program is distributed in the hope that it will be useful, but WITHOUT
15
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16
FOR A PARTICULAR PURPOSE. See the license for more details.
17
*/
18
19
/*! \defgroup shortrate Short-rate modelling framework
20
21
This framework (corresponding to the ql/models/shortrate directory)
22
implements some single-factor and two-factor short rate models. The models
23
implemented in this library are widely used by practitioners. For the
24
moment, the ShortRateModel class defines the short-rate dynamics
25
with stochastic equations of the type
26
\f[
27
dx_i = \mu(t,x_i) dt + \sigma(t,x_i) dW_t
28
\f]
29
where \f$ r = f(t,x) \f$. If the model is affine (i.e. derived from the
30
QuantLib::AffineModel class), analytical formulas
31
for discount bonds and discount bond options are given (useful for
32
calibration).
33
34
\section singlefactormodels Single-factor models
35
36
\par The Hull & White model
37
\f[
38
dr_t = (\theta(t) - \alpha(t) r_t)dt + \sigma(t) dW_t
39
\f]
40
When \f$ \alpha \f$ and \f$ \sigma \f$ are constants, this model
41
has analytical formulas for discount bonds and discount bond options.
42
43
\par The Black-Karasinski model
44
\f[
45
d\ln{r_t} = (\theta(t) - \alpha \ln{r_t})dt + \sigma dW_t
46
\f]
47
No analytical tractability here.
48
49
\par The extended Cox-Ingersoll-Ross model
50
\f[
51
dr_t = (\theta(t) - k r_t)dt + \sigma \sqrt{r_t} dW_t
52
\f]
53
There are analytical formulas for discount bonds (and soon for discount
54
bond options).
55
56
\section calibration Calibration
57
58
The class CalibrationHelper is a base class that facilitates the
59
instantiation of market instruments used for calibration. It has
60
a method marketValue() that gives the market price using a Black
61
formula, and a modelValue() method that gives the price according to
62
a model
63
64
Derived classed are
65
QuantLib::CapHelper and
66
QuantLib::SwaptionHelper.
67
68
For the calibration itself, you must choose an optimization method that
69
will find constant parameters such that the value:
70
\f[
71
V = \sqrt{\sum_{i=1}^{n} \frac{(T_i - M_i)^2}{M_i}},
72
\f]
73
where \f$ T_i \f$ is the price given by the model and \f$ M_i \f$ is the
74
market price, is minimized. A few optimization methods are available in
75
the ql/Optimization directory.
76
77
\section twofactormodels Two-factor models
78
79
\section pricers Pricers
80
81
\par Analytical pricers
82
83
If the model is affine, i.e. discount bond options formulas exist, caps are
84
easily priced since they are a portfolio of discount bond options. Such a
85
pricer is implemented in QuantLib::AnalyticalCapFloor.
86
In the case of single-factor affine models, swaptions can be priced using
87
the Jamshidian decomposition, implemented in
88
QuantLib::JamshidianSwaption.
89
90
\par Using Trees
91
92
Each model derived from the single-factor model class has the ability to
93
return a trinomial tree. For yield-curve consistent models, the fitting
94
parameter can be determined either analytically (when possible) or
95
numerically. When a tree is built, it is then pretty straightforward to
96
implement a pricer for any path-independent derivative. Just implement
97
a class derived from NumericalDerivative (see
98
QuantLib::NumericalSwaption for example) and roll it back until
99
the present time...
100
Just look at QuantLib::TreeCapFloor and
101
QuantLib::TreeSwaption for working pricers.
102
103
*/
Generated by
Doxygen
1.9.5