QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
pages
examples.docs
Go to the documentation of this file.
1
2
/*
3
Copyright (C) 2000-2003 StatPro Italia srl
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
/*!
20
21
\example BasketLosses.cpp
22
This example shows how to model losses across correlated assets.
23
24
\example BermudanSwaption.cpp
25
This example prices a bermudan swaption using different models
26
calibrated to market swaptions. The calibration examples include
27
Hull and White's using both an analytic formula as well as
28
numerically, and Black and Karasinski's model. Using these three
29
calibrations, Bermudan swaptions are priced for at-the-money,
30
out-of-the-money and in-the-money volatilities.
31
32
\example Bonds.cpp
33
This example shows how to set up a term structure and then price
34
some simple bonds. The last part is dedicated to peripherical
35
computations such as yield-to-price or price-to-yield.
36
37
\example CallableBonds.cpp
38
This example prices a number of callable bonds and compares the
39
results to known good data.
40
41
\example CDS.cpp
42
This example bootstraps a default-probability curve over a number
43
of CDS and reprices them.
44
45
\example ConvertibleBonds.cpp
46
For a given set of option parameters, this example computes the
47
value of a convertible bond with an embedded put option for two
48
different equity options types (with european and american
49
exercise features) using the Tsiveriotis-Fernandes method with
50
different implied tree algorithms. The tree types are
51
Jarrow-Rudd, Cox-Ross-Rubinstein, Additive equiprobabilities,
52
Trigeorgis, Tian and Leisen-Reimer.
53
54
\example CVAIRS.cpp
55
This example shows how to calculate credit value adjustment for an
56
interest rate swap.
57
58
\example DiscreteHedging.cpp
59
This example computes profit and loss of a discrete interval
60
hedging strategy and compares with the outcome with the results of
61
Derman and Kamal's Goldman Sachs Equity Derivatives Research Note
62
"When You Cannot Hedge Continuously: The Corrections to
63
Black-Scholes". It shows the use of the Monte Carlo framework.
64
65
\example EquityOption.cpp
66
For a given set of option parameters, this example computes the
67
value of three different equity options types (with european,
68
bermudan and american exercise features) using different valuation
69
algorithms. The calculation methods are Black-Scholes (for
70
european options only), Barone-Adesi/Whaley (american-only),
71
Bjerksund/Stensland (american), Integral (european), finite
72
differences, binomial trees, crude Monte Carlo (european-only) and
73
Sobol-sequence Monte Carlo (european-only).
74
75
\example FittedBondCurve.cpp
76
For a given set of coupons and terms to maturity, this example
77
computes the value of a bond by fitting the yields to a curve
78
using different methods. The fitting methods are exponential
79
splines, simple polynomials, Nelson-Siegel, and cubic B-splines.
80
It then shifts the evaluation date into the future to compute
81
implied forward par rates. It also computes yields after small
82
price shifts.
83
84
\example FRA.cpp
85
This example values a forward-rate agreement (FRA) at different
86
forward dates under two yield curve assumptions. It thereby
87
illustrates how set up a term structure, and to use it to price a
88
simple forward-rate agreement.
89
90
\example Gaussian1dModels.cpp
91
This example shows the use of Gaussian short rate model for
92
interest rate derivatives.
93
94
\example GlobalOptimizer.cpp
95
This example shows the use of several different optimizers:
96
firefly algorithm, hybrid simulated annealing, particle swarm
97
optimization, simulated annealing, and differential evolution.
98
99
\example LatentModel.cpp
100
This example shows the calculation of correlated defaults.
101
102
\example MarketModels.cpp
103
This example shows the use of interest-rate market models.
104
105
\example MulticurveBootstrapping.cpp
106
This example prices an interest rate swap over a term structure
107
and calculates its fair fixed rate and floating spread.
108
109
\example MultidimIntegral.cpp
110
This example shows multi-dimensional numerical integration.
111
112
\example Replication.cpp
113
This example uses the CompositeInstrument class to statically
114
replicate a down-and-out barrier options.
115
116
\example Repo.cpp
117
This example values a fixed-coupon bond repurchase (repo). The
118
repurchase agreement example is set up to use the repo rate to do
119
all discounting (including the underlying bond income). Forward
120
delivery price is also obtained using this repo rate. All this is
121
done by supplying the FixedCouponBondForward constructor with a
122
flat repo YieldTermStructure.
123
124
*/
125
Generated by
Doxygen
1.9.5