Nothing Special   »   [go: up one dir, main page]

QuantLib-docs-0 3 6

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1047

QuantLib

An open source library for quantitative finance


Version 0.3.6

Generated by Doxygen 1.3.6

15 Apr 2004
Contents

I User Manual 1

1 An introduction to QuantLib 3
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Project overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Where to get QuantLib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.4 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.5 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.6 Version history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.7 Additional resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.8 The QuantLib Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.9 QuantLib License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

2 QuantLib components 33
2.1 Core classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.2 Date and time calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.3 Lattice methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.4 The finite differences framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.5 The Monte Carlo framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.6 The short-rate modelling framework . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.7 Currencies and FX rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.8 Instruments and pricers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.9 Math tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.10 Design patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.11 Term structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
2.12 Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

3 Examples 59
ii CONTENTS

II Reference Manual 61

4 QuantLib Module Index 63


4.1 QuantLib Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

5 QuantLib Hierarchical Index 65


5.1 QuantLib Class Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

6 QuantLib Class Index 77


6.1 QuantLib Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

7 QuantLib File Index 87


7.1 QuantLib File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

8 QuantLib Module Documentation 95


8.1 Global QuantLib macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
8.2 Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
8.3 Numeric limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
8.4 Time functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
8.5 String functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
8.6 Character functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
8.7 Input/output functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
8.8 Min and max functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
8.9 Template capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
8.10 Iterator support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

9 QuantLib Class Documentation 107


9.1 Actual360 Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
9.2 Actual365 Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
9.3 ActualActual Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
9.4 AcyclicVisitor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
9.5 AdditiveEQPBinomialTree Class Reference . . . . . . . . . . . . . . . . . . . . . . 111
9.6 AffineModel Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
9.7 AffineTermStructure Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 113
9.8 AmericanCondition Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 115
9.9 AmericanExercise Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
9.10 AmericanPayoffAtExpiry Class Reference . . . . . . . . . . . . . . . . . . . . . . 117
9.11 AmericanPayoffAtHit Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 118
9.12 AnalyticalCapFloor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 119

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


CONTENTS iii

9.13 AnalyticBarrierEngine Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 120


9.14 AnalyticDigitalAmericanEngine Class Reference . . . . . . . . . . . . . . . . . . 121
9.15 AnalyticDiscreteAveragingAsianEngine Class Reference . . . . . . . . . . . . . . 122
9.16 AnalyticEuropeanEngine Class Reference . . . . . . . . . . . . . . . . . . . . . . . 123
9.17 Arguments Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
9.18 ArmijoLineSearch Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
9.19 Array Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
9.20 ArrayFormatter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
9.21 AssertionFailedError Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 129
9.22 AssetOrNothingPayoff Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 130
9.23 AUDLibor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
9.24 Average Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
9.25 BaroneAdesiWhaleyApproximationEngine Class Reference . . . . . . . . . . . . 133
9.26 Barrier Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
9.27 BarrierEngine Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
9.28 BarrierOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
9.29 BarrierOption::arguments Class Reference . . . . . . . . . . . . . . . . . . . . . . 138
9.30 BasketEngine Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
9.31 BasketOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
9.32 BasketOption::arguments Class Reference . . . . . . . . . . . . . . . . . . . . . . 142
9.33 BermudanExercise Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 143
9.34 BicubicSpline Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
9.35 BicubicSpline::Impl Class Template Reference . . . . . . . . . . . . . . . . . . . . 145
9.36 BilinearInterpolation Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 146
9.37 BilinearInterpolation::Impl Class Template Reference . . . . . . . . . . . . . . . . 147
9.38 BinomialDistribution Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 148
9.39 BinomialTree Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
9.40 BinomialVanillaEngine Class Template Reference . . . . . . . . . . . . . . . . . . 150
9.41 Bisection Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
9.42 BivariateCumulativeNormalDistribution Class Reference . . . . . . . . . . . . . 152
9.43 BjerksundStenslandApproximationEngine Class Reference . . . . . . . . . . . . 153
9.44 BlackCapFloor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
9.45 BlackConstantVol Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
9.46 BlackKarasinski Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
9.47 BlackKarasinski::Dynamics Class Reference . . . . . . . . . . . . . . . . . . . . . 158
9.48 BlackModel Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


iv CONTENTS

9.49 BlackScholesLattice Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 161


9.50 BlackScholesProcess Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 162
9.51 BlackSwaption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
9.52 BlackVarianceCurve Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 164
9.53 BlackVarianceSurface Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 166
9.54 BlackVarianceTermStructure Class Reference . . . . . . . . . . . . . . . . . . . . . 168
9.55 BlackVolatilityTermStructure Class Reference . . . . . . . . . . . . . . . . . . . . 169
9.56 BlackVolTermStructure Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 170
9.57 BoundaryCondition Class Template Reference . . . . . . . . . . . . . . . . . . . . 172
9.58 BoundaryConstraint Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 174
9.59 BoxMullerGaussianRng Class Template Reference . . . . . . . . . . . . . . . . . . 175
9.60 BPSBasketCalculator Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 176
9.61 BPSCalculator Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
9.62 Brent Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
9.63 Bridge Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
9.64 BrownianBridge Class Template Reference . . . . . . . . . . . . . . . . . . . . . . 180
9.65 BSMOperator Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
9.66 Budapest Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
9.67 CADLibor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
9.68 Calendar Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
9.69 Calendar::WesternImpl Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 187
9.70 CalendarImpl Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
9.71 CalibrationHelper Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
9.72 CalibrationSet Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
9.73 Cap Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
9.74 CapFlatVolatilityStructure Class Reference . . . . . . . . . . . . . . . . . . . . . . 193
9.75 CapFlatVolatilityVector Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 194
9.76 CapFloor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
9.77 CapFloor::arguments Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 197
9.78 CapFloor::results Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
9.79 CapletForwardVolatilityStructure Class Reference . . . . . . . . . . . . . . . . . . 199
9.80 CashFlow Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
9.81 CashOrNothingPayoff Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 201
9.82 CHFLibor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
9.83 CLGaussianRng Class Template Reference . . . . . . . . . . . . . . . . . . . . . . 203
9.84 CliquetEngine Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


CONTENTS v

9.85 CliquetOption::arguments Class Reference . . . . . . . . . . . . . . . . . . . . . . 205


9.86 CliquetOptionPricer Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 206
9.87 Collar Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
9.88 combining_iterator Class Template Reference . . . . . . . . . . . . . . . . . . . . 208
9.89 Composite Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . . . 210
9.90 CompositeConstraint Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 211
9.91 CompositeQuote Class Template Reference . . . . . . . . . . . . . . . . . . . . . . 212
9.92 ConjugateGradient Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 213
9.93 ConstantParameter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 214
9.94 Constraint Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
9.95 ConstraintImpl Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
9.96 ContinuousGeometricAPO Class Reference . . . . . . . . . . . . . . . . . . . . . 217
9.97 Copenhagen Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
9.98 CostFunction Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
9.99 coupling_iterator Class Template Reference . . . . . . . . . . . . . . . . . . . . . 220
9.100 Coupon Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
9.101 CoxIngersollRoss Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
9.102 CoxIngersollRoss::Dynamics Class Reference . . . . . . . . . . . . . . . . . . . . 226
9.103 CoxRossRubinstein Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 227
9.104 CrankNicolson Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . 228
9.105 Cubic Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
9.106 CubicSpline Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
9.107 CumulativeBinomialDistribution Class Reference . . . . . . . . . . . . . . . . . . 232
9.108 CumulativeNormalDistribution Class Reference . . . . . . . . . . . . . . . . . . . 233
9.109 CumulativePoissonDistribution Class Reference . . . . . . . . . . . . . . . . . . . 234
9.110 CuriouslyRecurringTemplate Class Template Reference . . . . . . . . . . . . . . 235
9.111 CurrencyFormatter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 236
9.112 Date Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
9.113 DateFormatter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
9.114 DayCounter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
9.115 DayCounterImpl Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
9.116 DepositRateHelper Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 243
9.117 DerivedQuote Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . 245
9.118 DiffusionProcess Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
9.119 DirichletBC Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
9.120 DiscountCurve Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


vi CONTENTS

9.121 DiscountStructure Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 251


9.122 DiscrepancyStatistics Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 253
9.123 DiscreteAveragingAsianEngine Class Reference . . . . . . . . . . . . . . . . . . . 254
9.124 DiscreteAveragingAsianOption Class Reference . . . . . . . . . . . . . . . . . . . 255
9.125 DiscreteAveragingAsianOption::arguments Class Reference . . . . . . . . . . . . 257
9.126 DiscreteGeometricAPO Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 258
9.127 DiscreteGeometricASO Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 259
9.128 DiscretizedAsset Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
9.129 DiscretizedDiscountBond Class Reference . . . . . . . . . . . . . . . . . . . . . . 262
9.130 DiscretizedOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
9.131 Disposable Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . . . 264
9.132 DMinus Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
9.133 DoubleFormatter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
9.134 DPlus Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
9.135 DPlusDMinus Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
9.136 DriftTermStructure Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 269
9.137 DZero Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
9.138 EarlyExercise Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
9.139 EndCriteria Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
9.140 EqualJumpsBinomialTree Class Reference . . . . . . . . . . . . . . . . . . . . . . 275
9.141 EqualProbabilitiesBinomialTree Class Reference . . . . . . . . . . . . . . . . . . . 276
9.142 Error Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
9.143 ErrorFunction Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
9.144 Euribor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
9.145 EuroFormatter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
9.146 EuropeanExercise Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
9.147 EuropeanOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
9.148 Exercise Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
9.149 ExplicitEuler Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . . 284
9.150 ExtendedCoxIngersollRoss Class Reference . . . . . . . . . . . . . . . . . . . . . 285
9.151 ExtendedCoxIngersollRoss::Dynamics Class Reference . . . . . . . . . . . . . . . 286
9.152 ExtendedCoxIngersollRoss::FittingParameter Class Reference . . . . . . . . . . . 287
9.153 ExtendedDiscountCurve Class Reference . . . . . . . . . . . . . . . . . . . . . . . 288
9.154 Factorial Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
9.155 FalsePosition Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
9.156 FdAmericanOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 292

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


CONTENTS vii

9.157 FdBermudanOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 293


9.158 FdBsmOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
9.159 FdDividendAmericanOption Class Reference . . . . . . . . . . . . . . . . . . . . 296
9.160 FdDividendEuropeanOption Class Reference . . . . . . . . . . . . . . . . . . . . 297
9.161 FdDividendShoutOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . 298
9.162 FdEuropean Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
9.163 FdStepConditionOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . 300
9.164 filtering_iterator Class Template Reference . . . . . . . . . . . . . . . . . . . . . . 301
9.165 FiniteDifferenceModel Class Template Reference . . . . . . . . . . . . . . . . . . 302
9.166 FixedRateCoupon Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
9.167 FloatingRateCoupon Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 305
9.168 Floor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
9.169 ForwardEngine Class Template Reference . . . . . . . . . . . . . . . . . . . . . . 308
9.170 ForwardOptionArguments Class Template Reference . . . . . . . . . . . . . . . . 309
9.171 ForwardPerformanceEngine Class Template Reference . . . . . . . . . . . . . . . 310
9.172 ForwardRateStructure Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 311
9.173 ForwardSpreadedTermStructure Class Reference . . . . . . . . . . . . . . . . . . 313
9.174 ForwardVanillaOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 315
9.175 Frankfurt Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
9.176 FraRateHelper Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
9.177 FuturesRateHelper Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 320
9.178 G2 Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
9.179 G2::FittingParameter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 323
9.180 GammaFunction Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
9.181 GapPayoff Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
9.182 GaussianStatistics Class Template Reference . . . . . . . . . . . . . . . . . . . . . 326
9.183 GBPLibor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
9.184 GeneralStatistics Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
9.185 GenericEngine Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . 332
9.186 GenericModelEngine Class Template Reference . . . . . . . . . . . . . . . . . . . 333
9.187 GenericRiskStatistics Class Template Reference . . . . . . . . . . . . . . . . . . . 334
9.188 Greeks Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
9.189 HaltonRsg Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
9.190 Handle Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
9.191 Helsinki Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
9.192 History Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


viii CONTENTS

9.193 History::const_iterator Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 345


9.194 History::Entry Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
9.195 HullWhite Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
9.196 HullWhite::Dynamics Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 348
9.197 HullWhite::FittingParameter Class Reference . . . . . . . . . . . . . . . . . . . . 349
9.198 ICGaussianRng Class Template Reference . . . . . . . . . . . . . . . . . . . . . . 350
9.199 ICGaussianRsg Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . 351
9.200 IllegalArgumentError Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 352
9.201 IllegalResultError Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
9.202 ImplicitEuler Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . . 354
9.203 ImpliedTermStructure Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 355
9.204 ImpliedVolTermStructure Class Reference . . . . . . . . . . . . . . . . . . . . . . 357
9.205 InArrearIndexedCoupon Class Reference . . . . . . . . . . . . . . . . . . . . . . . 359
9.206 IncrementalStatistics Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 360
9.207 Index Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
9.208 IndexedCoupon Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
9.209 IndexError Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
9.210 Instrument Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
9.211 IntegerFormatter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
9.212 IntegralEngine Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
9.213 Interpolation Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
9.214 Interpolation2D Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
9.215 Interpolation2D::templateImpl Class Template Reference . . . . . . . . . . . . . . 374
9.216 Interpolation2DImpl Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 375
9.217 Interpolation::templateImpl Class Template Reference . . . . . . . . . . . . . . . 376
9.218 InterpolationImpl Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
9.219 InverseCumulativeNormal Class Reference . . . . . . . . . . . . . . . . . . . . . 378
9.220 JamshidianSwaption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 379
9.221 JarrowRudd Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
9.222 Johannesburg Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
9.223 JointCalendar Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
9.224 JPYLibor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
9.225 KnuthUniformRng Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 384
9.226 KronrodIntegral Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
9.227 Lattice Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
9.228 Lattice2D Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


CONTENTS ix

9.229 LatticeShortRateModelEngine Class Template Reference . . . . . . . . . . . . . . 389


9.230 LazyObject Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
9.231 LeastSquareFunction Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 394
9.232 LeastSquareProblem Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 395
9.233 LecuyerUniformRng Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 396
9.234 LeisenReimer Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
9.235 LexicographicalView Class Template Reference . . . . . . . . . . . . . . . . . . . 398
9.236 Linear Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
9.237 LinearInterpolation Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 401
9.238 LineSearch Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
9.239 Link Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
9.240 LocalConstantVol Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
9.241 LocalVolCurve Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
9.242 LocalVolSurface Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
9.243 LocalVolTermStructure Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 412
9.244 LogLinear Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
9.245 LogLinearInterpolation Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 414
9.246 London Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
9.247 lowest_category_iterator Struct Template Reference . . . . . . . . . . . . . . . . . 416
9.248 MakeSchedule Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
9.249 Matrix Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
9.250 MCAmericanBasketEngine Class Reference . . . . . . . . . . . . . . . . . . . . . 422
9.251 MCBarrierEngine Class Template Reference . . . . . . . . . . . . . . . . . . . . . 423
9.252 McBasket Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
9.253 MCBasketEngine Class Template Reference . . . . . . . . . . . . . . . . . . . . . 426
9.254 McCliquetOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
9.255 MCDigitalEngine Class Template Reference . . . . . . . . . . . . . . . . . . . . . 429
9.256 McDiscreteArithmeticAPO Class Reference . . . . . . . . . . . . . . . . . . . . . 430
9.257 McDiscreteArithmeticASO Class Reference . . . . . . . . . . . . . . . . . . . . . . 431
9.258 MCEuropeanEngine Class Template Reference . . . . . . . . . . . . . . . . . . . . 432
9.259 McEverest Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
9.260 McHimalaya Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
9.261 McMaxBasket Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
9.262 McPagoda Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
9.263 McPerformanceOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 437
9.264 McPricer Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 438

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


x CONTENTS

9.265 McSimulation Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . 439


9.266 MCVanillaEngine Class Template Reference . . . . . . . . . . . . . . . . . . . . . 441
9.267 MersenneTwisterUniformRng Class Reference . . . . . . . . . . . . . . . . . . . . 443
9.268 Milan Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
9.269 MixedScheme Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . 445
9.270 MonotonicCubicSpline Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 447
9.271 MonteCarloModel Class Template Reference . . . . . . . . . . . . . . . . . . . . . 448
9.272 MoreGreeks Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
9.273 MoroInverseCumulativeNormal Class Reference . . . . . . . . . . . . . . . . . . 450
9.274 MultiAssetOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
9.275 MultiAssetOption::arguments Class Reference . . . . . . . . . . . . . . . . . . . . 453
9.276 MultiAssetOption::results Class Reference . . . . . . . . . . . . . . . . . . . . . . 454
9.277 MultiPath Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
9.278 MultiPathGenerator Class Template Reference . . . . . . . . . . . . . . . . . . . . 456
9.279 MultiPathGenerator_old Class Template Reference . . . . . . . . . . . . . . . . . 457
9.280 NaturalCubicSpline Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 458
9.281 NaturalMonotonicCubicSpline Class Reference . . . . . . . . . . . . . . . . . . . 459
9.282 NeumannBC Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
9.283 Newton Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
9.284 NewtonSafe Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
9.285 NewYork Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
9.286 NoConstraint Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
9.287 NonLinearLeastSquare Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 465
9.288 NormalDistribution Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 466
9.289 Null Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
9.290 NullCalendar Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
9.291 NullParameter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
9.292 NumericalMethod Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 470
9.293 Observable Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
9.294 Observer Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
9.295 OneAssetOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
9.296 OneAssetOption::arguments Class Reference . . . . . . . . . . . . . . . . . . . . . 479
9.297 OneAssetOption::results Class Reference . . . . . . . . . . . . . . . . . . . . . . . 480
9.298 OneAssetStrikedOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . 481
9.299 OneFactorAffineModel Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 483
9.300 OneFactorModel Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 484

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


CONTENTS xi

9.301 OneFactorModel::ShortRateDynamics Class Reference . . . . . . . . . . . . . . . 485


9.302 OneFactorModel::ShortRateTree Class Reference . . . . . . . . . . . . . . . . . . 486
9.303 OneFactorOperator Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 487
9.304 OptimizationMethod Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 488
9.305 Option Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
9.306 Option::arguments Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 491
9.307 OptionTypeFormatter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 492
9.308 OrnsteinUhlenbeckProcess Class Reference . . . . . . . . . . . . . . . . . . . . . . 493
9.309 Oslo Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
9.310 OutOfMemoryError Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 496
9.311 Parameter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
9.312 ParameterImpl Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
9.313 ParCoupon Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
9.314 Path Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
9.315 PathGenerator Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . 502
9.316 PathGenerator_old Class Template Reference . . . . . . . . . . . . . . . . . . . . 503
9.317 PathPricer Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . . . 504
9.318 PathPricer_old Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . 505
9.319 Payoff Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
9.320 PercentageStrikePayoff Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 507
9.321 PerformanceOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 508
9.322 Period Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
9.323 PiecewiseConstantParameter Class Reference . . . . . . . . . . . . . . . . . . . . 510
9.324 PiecewiseFlatForward Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 511
9.325 PlainVanillaPayoff Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
9.326 PoissonDistribution Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 514
9.327 PositiveConstraint Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 515
9.328 PostconditionNotSatisfiedError Class Reference . . . . . . . . . . . . . . . . . . . 516
9.329 PreconditionNotSatisfiedError Class Reference . . . . . . . . . . . . . . . . . . . 517
9.330 PricingEngine Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
9.331 PrimeNumbers Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
9.332 Problem Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
9.333 processing_iterator Class Template Reference . . . . . . . . . . . . . . . . . . . . 521
9.334 QuantoEngine Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . 523
9.335 QuantoForwardVanillaOption Class Reference . . . . . . . . . . . . . . . . . . . . 524
9.336 QuantoOptionArguments Class Template Reference . . . . . . . . . . . . . . . . 526

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


xii CONTENTS

9.337 QuantoOptionResults Class Template Reference . . . . . . . . . . . . . . . . . . . 527


9.338 QuantoTermStructure Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 528
9.339 QuantoVanillaOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 530
9.340 Quote Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
9.341 RandomArrayGenerator Class Template Reference . . . . . . . . . . . . . . . . . 533
9.342 RandomSequenceGenerator Class Template Reference . . . . . . . . . . . . . . . 534
9.343 RateFormatter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
9.344 RateHelper Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
9.345 RelinkableHandle Class Template Reference . . . . . . . . . . . . . . . . . . . . . 538
9.346 Results Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
9.347 Ridder Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
9.348 SalvagingAlgorithm Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . 541
9.349 Sample Struct Template Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
9.350 Schedule Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
9.351 Secant Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
9.352 SegmentIntegral Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
9.353 SequenceStatistics Class Template Reference . . . . . . . . . . . . . . . . . . . . . 546
9.354 Short Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
9.355 ShortFloatingRateCoupon Class Reference . . . . . . . . . . . . . . . . . . . . . . 549
9.356 ShortRateModel Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
9.357 ShoutCondition Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
9.358 SimpleCashFlow Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
9.359 SimpleDayCounter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 554
9.360 SimpleQuote Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
9.361 SimpleSwap Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
9.362 SimpleSwap::arguments Class Reference . . . . . . . . . . . . . . . . . . . . . . . 558
9.363 SimpleSwap::results Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 559
9.364 Simplex Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
9.365 SimpsonIntegral Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
9.366 SingleAssetOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 562
9.367 SobolRsg Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
9.368 Solver1D Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 565
9.369 SquareRootProcess Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 567
9.370 StatsHolder Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
9.371 SteepestDescent Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
9.372 StepCondition Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . 570

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


CONTENTS xiii

9.373 stepping_iterator Class Template Reference . . . . . . . . . . . . . . . . . . . . . 571


9.374 StochasticProcess Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
9.375 Stock Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
9.376 Stockholm Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
9.377 StrikedTypePayoff Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
9.378 StringFormatter Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
9.379 StulzEngine Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
9.380 SuperSharePayoff Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
9.381 SVD Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
9.382 Swap Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
9.383 SwapRateHelper Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
9.384 Swaption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
9.385 Swaption::arguments Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 587
9.386 Swaption::results Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
9.387 SwaptionVolatilityMatrix Class Reference . . . . . . . . . . . . . . . . . . . . . . 589
9.388 SwaptionVolatilityStructure Class Reference . . . . . . . . . . . . . . . . . . . . . 590
9.389 Sydney Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
9.390 SymmetricSchurDecomposition Class Reference . . . . . . . . . . . . . . . . . . . 592
9.391 TARGET Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
9.392 TermStructure Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
9.393 TermStructureConsistentModel Class Reference . . . . . . . . . . . . . . . . . . . 596
9.394 TermStructureFittingParameter Class Reference . . . . . . . . . . . . . . . . . . . 597
9.395 Thirty360 Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
9.396 Tian Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
9.397 TimeBasket Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
9.398 TimeGrid Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
9.399 Tokyo Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
9.400 Toronto Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
9.401 TrapezoidIntegral Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
9.402 Tree Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
9.403 TreeCapFloor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
9.404 TreeSwaption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
9.405 TridiagonalOperator Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 610
9.406 TridiagonalOperator::TimeSetter Class Reference . . . . . . . . . . . . . . . . . . 612
9.407 Trigeorgis Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
9.408 TrinomialBranching Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 614

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


xiv CONTENTS

9.409 TrinomialTree Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615


9.410 TwoFactorModel Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
9.411 TwoFactorModel::ShortRateDynamics Class Reference . . . . . . . . . . . . . . . 617
9.412 TwoFactorModel::ShortRateTree Class Reference . . . . . . . . . . . . . . . . . . 618
9.413 TypePayoff Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
9.414 UpFrontIndexedCoupon Class Reference . . . . . . . . . . . . . . . . . . . . . . . 620
9.415 USDLibor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
9.416 Value Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
9.417 VanillaEngine Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
9.418 VanillaOption Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
9.419 Vasicek Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
9.420 Vasicek::Dynamics Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 627
9.421 Visitor Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
9.422 Warsaw Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
9.423 Wellington Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
9.424 Xibor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
9.425 XiborManager Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
9.426 ZARLibor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
9.427 ZeroCurve Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
9.428 ZeroSpreadedTermStructure Class Reference . . . . . . . . . . . . . . . . . . . . . 636
9.429 ZeroYieldStructure Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 638
9.430 Zurich Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640

10 QuantLib File Documentation 641


10.1 ql/argsandresults.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 641
10.2 ql/calendar.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
10.3 ql/Calendars/budapest.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 643
10.4 ql/Calendars/copenhagen.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 644
10.5 ql/Calendars/frankfurt.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 645
10.6 ql/Calendars/helsinki.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 646
10.7 ql/Calendars/johannesburg.hpp File Reference . . . . . . . . . . . . . . . . . . . . 647
10.8 ql/Calendars/jointcalendar.hpp File Reference . . . . . . . . . . . . . . . . . . . . 648
10.9 ql/Calendars/london.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 649
10.10 ql/Calendars/milan.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 650
10.11 ql/Calendars/newyork.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 651
10.12 ql/Calendars/nullcalendar.hpp File Reference . . . . . . . . . . . . . . . . . . . . 652
10.13 ql/Calendars/oslo.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 653

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


CONTENTS xv

10.14 ql/Calendars/stockholm.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 654


10.15 ql/Calendars/sydney.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 655
10.16 ql/Calendars/target.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 656
10.17 ql/Calendars/tokyo.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 657
10.18 ql/Calendars/toronto.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 658
10.19 ql/Calendars/warsaw.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 659
10.20 ql/Calendars/wellington.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 660
10.21 ql/Calendars/zurich.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 661
10.22 ql/capvolstructures.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 662
10.23 ql/cashflow.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
10.24 ql/CashFlows/basispointsensitivity.hpp File Reference . . . . . . . . . . . . . . . 664
10.25 ql/CashFlows/cashflowvectors.hpp File Reference . . . . . . . . . . . . . . . . . . 665
10.26 ql/CashFlows/coupon.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 666
10.27 ql/CashFlows/fixedratecoupon.hpp File Reference . . . . . . . . . . . . . . . . . . 667
10.28 ql/CashFlows/floatingratecoupon.hpp File Reference . . . . . . . . . . . . . . . . 668
10.29 ql/CashFlows/inarrearindexedcoupon.hpp File Reference . . . . . . . . . . . . . 669
10.30 ql/CashFlows/indexcashflowvectors.hpp File Reference . . . . . . . . . . . . . . 670
10.31 ql/CashFlows/indexedcoupon.hpp File Reference . . . . . . . . . . . . . . . . . . 671
10.32 ql/CashFlows/parcoupon.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 672
10.33 ql/CashFlows/shortfloatingcoupon.hpp File Reference . . . . . . . . . . . . . . . 673
10.34 ql/CashFlows/shortindexedcoupon.hpp File Reference . . . . . . . . . . . . . . . 674
10.35 ql/CashFlows/simplecashflow.hpp File Reference . . . . . . . . . . . . . . . . . . 675
10.36 ql/CashFlows/timebasket.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 676
10.37 ql/CashFlows/upfrontindexedcoupon.hpp File Reference . . . . . . . . . . . . . . 677
10.38 ql/currency.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
10.39 ql/dataformatters.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 679
10.40 ql/dataparsers.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
10.41 ql/date.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
10.42 ql/daycounter.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
10.43 ql/DayCounters/actual360.hpp File Reference . . . . . . . . . . . . . . . . . . . . 683
10.44 ql/DayCounters/actual365.hpp File Reference . . . . . . . . . . . . . . . . . . . . 684
10.45 ql/DayCounters/actualactual.hpp File Reference . . . . . . . . . . . . . . . . . . . 685
10.46 ql/DayCounters/simpledaycounter.hpp File Reference . . . . . . . . . . . . . . . 686
10.47 ql/DayCounters/thirty360.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 687
10.48 ql/diffusionprocess.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 688
10.49 ql/discretizedasset.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 689

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


xvi CONTENTS

10.50 ql/disposable.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690


10.51 ql/errors.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
10.52 ql/exercise.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
10.53 ql/FiniteDifferences/americancondition.hpp File Reference . . . . . . . . . . . . . 694
10.54 ql/FiniteDifferences/boundarycondition.hpp File Reference . . . . . . . . . . . . 695
10.55 ql/FiniteDifferences/bsmoperator.hpp File Reference . . . . . . . . . . . . . . . . 696
10.56 ql/FiniteDifferences/cranknicolson.hpp File Reference . . . . . . . . . . . . . . . . 697
10.57 ql/FiniteDifferences/dminus.hpp File Reference . . . . . . . . . . . . . . . . . . . 698
10.58 ql/FiniteDifferences/dplus.hpp File Reference . . . . . . . . . . . . . . . . . . . . 699
10.59 ql/FiniteDifferences/dplusdminus.hpp File Reference . . . . . . . . . . . . . . . . 700
10.60 ql/FiniteDifferences/dzero.hpp File Reference . . . . . . . . . . . . . . . . . . . . 701
10.61 ql/FiniteDifferences/expliciteuler.hpp File Reference . . . . . . . . . . . . . . . . . 702
10.62 ql/FiniteDifferences/fdtypedefs.hpp File Reference . . . . . . . . . . . . . . . . . 703
10.63 ql/FiniteDifferences/finitedifferencemodel.hpp File Reference . . . . . . . . . . . 704
10.64 ql/FiniteDifferences/impliciteuler.hpp File Reference . . . . . . . . . . . . . . . . 705
10.65 ql/FiniteDifferences/mixedscheme.hpp File Reference . . . . . . . . . . . . . . . . 706
10.66 ql/FiniteDifferences/onefactoroperator.hpp File Reference . . . . . . . . . . . . . 707
10.67 ql/FiniteDifferences/shoutcondition.hpp File Reference . . . . . . . . . . . . . . . 708
10.68 ql/FiniteDifferences/stepcondition.hpp File Reference . . . . . . . . . . . . . . . . 709
10.69 ql/FiniteDifferences/tridiagonaloperator.hpp File Reference . . . . . . . . . . . . 710
10.70 ql/FiniteDifferences/valueatcenter.hpp File Reference . . . . . . . . . . . . . . . . 711
10.71 ql/functions/daycounters.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 712
10.72 ql/functions/mathf.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 713
10.73 ql/functions/vols.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 714
10.74 ql/grid.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
10.75 ql/handle.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
10.76 ql/history.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
10.77 ql/index.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
10.78 ql/Indexes/audlibor.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 719
10.79 ql/Indexes/cadlibor.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 720
10.80 ql/Indexes/chflibor.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 721
10.81 ql/Indexes/euribor.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 722
10.82 ql/Indexes/gbplibor.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 723
10.83 ql/Indexes/jpylibor.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 724
10.84 ql/Indexes/usdlibor.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 725
10.85 ql/Indexes/xibor.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 726

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


CONTENTS xvii

10.86 ql/Indexes/xibormanager.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 727


10.87 ql/Indexes/zarlibor.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 728
10.88 ql/instrument.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
10.89 ql/Instruments/asianoption.hpp File Reference . . . . . . . . . . . . . . . . . . . . 730
10.90 ql/Instruments/barrieroption.hpp File Reference . . . . . . . . . . . . . . . . . . . 731
10.91 ql/Instruments/basketoption.hpp File Reference . . . . . . . . . . . . . . . . . . . 732
10.92 ql/Instruments/capfloor.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 733
10.93 ql/Instruments/cliquetoption.hpp File Reference . . . . . . . . . . . . . . . . . . . 734
10.94 ql/Pricers/cliquetoption.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 735
10.95 ql/Instruments/forwardvanillaoption.hpp File Reference . . . . . . . . . . . . . . 736
10.96 ql/Instruments/multiassetoption.hpp File Reference . . . . . . . . . . . . . . . . . 737
10.97 ql/Instruments/oneassetoption.hpp File Reference . . . . . . . . . . . . . . . . . . 738
10.98 ql/Instruments/oneassetstrikedoption.hpp File Reference . . . . . . . . . . . . . . 739
10.99 ql/Instruments/payoffs.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 740
10.100 ql/Instruments/quantoforwardvanillaoption.hpp File Reference . . . . . . . . . . 741
10.101 ql/Instruments/quantovanillaoption.hpp File Reference . . . . . . . . . . . . . . . 742
10.102 ql/Instruments/simpleswap.hpp File Reference . . . . . . . . . . . . . . . . . . . . 743
10.103 ql/Instruments/stock.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 744
10.104 ql/Instruments/swap.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 745
10.105 ql/Instruments/swaption.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 746
10.106 ql/Instruments/vanillaoption.hpp File Reference . . . . . . . . . . . . . . . . . . . 747
10.107 ql/Lattices/binomialtree.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 748
10.108 ql/Lattices/bsmlattice.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 749
10.109 ql/Lattices/lattice.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 750
10.110 ql/Lattices/lattice2d.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 751
10.111 ql/Lattices/tree.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 752
10.112 ql/Lattices/trinomialtree.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 753
10.113 ql/marketelement.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 754
10.114 ql/Math/array.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755
10.115 ql/Math/beta.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 756
10.116 ql/Math/bicubicsplineinterpolation.hpp File Reference . . . . . . . . . . . . . . . 757
10.117 ql/Math/bilinearinterpolation.hpp File Reference . . . . . . . . . . . . . . . . . . 758
10.118 ql/Math/binomialdistribution.hpp File Reference . . . . . . . . . . . . . . . . . . 759
10.119 ql/Math/bivariatenormaldistribution.hpp File Reference . . . . . . . . . . . . . . 760
10.120 ql/Math/chisquaredistribution.hpp File Reference . . . . . . . . . . . . . . . . . . 761
10.121 ql/Math/choleskydecomposition.hpp File Reference . . . . . . . . . . . . . . . . . 762

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


xviii CONTENTS

10.122 ql/Math/comparison.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 763


10.123 ql/Math/cubicspline.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 764
10.124 ql/Math/discrepancystatistics.hpp File Reference . . . . . . . . . . . . . . . . . . . 765
10.125 ql/Math/errorfunction.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 766
10.126 ql/Math/factorial.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 767
10.127 ql/Math/functional.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 768
10.128 ql/Math/gammadistribution.hpp File Reference . . . . . . . . . . . . . . . . . . . 769
10.129 ql/Math/gaussianstatistics.hpp File Reference . . . . . . . . . . . . . . . . . . . . 770
10.130 ql/Math/generalstatistics.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 771
10.131 ql/Math/incompletegamma.hpp File Reference . . . . . . . . . . . . . . . . . . . . 772
10.132 ql/Math/incrementalstatistics.hpp File Reference . . . . . . . . . . . . . . . . . . . 773
10.133 ql/Math/interpolation.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 774
10.134 ql/Math/interpolation2D.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 775
10.135 ql/Math/interpolationtraits.hpp File Reference . . . . . . . . . . . . . . . . . . . . 776
10.136 ql/Math/kronrodintegral.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 777
10.137 ql/Math/lexicographicalview.hpp File Reference . . . . . . . . . . . . . . . . . . . 778
10.138 ql/Math/linearinterpolation.hpp File Reference . . . . . . . . . . . . . . . . . . . . 779
10.139 ql/Math/loglinearinterpolation.hpp File Reference . . . . . . . . . . . . . . . . . . 780
10.140 ql/Math/matrix.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
10.141 ql/Math/normaldistribution.hpp File Reference . . . . . . . . . . . . . . . . . . . 782
10.142 ql/Math/poissondistribution.hpp File Reference . . . . . . . . . . . . . . . . . . . 783
10.143 ql/Math/primenumbers.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 784
10.144 ql/Math/pseudosqrt.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 785
10.145 ql/Math/riskstatistics.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 786
10.146 ql/Math/segmentintegral.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 787
10.147 ql/Math/sequencestatistics.hpp File Reference . . . . . . . . . . . . . . . . . . . . 788
10.148 ql/Math/simpsonintegral.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 790
10.149 ql/Math/statistics.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 791
10.150 ql/Math/svd.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
10.151 ql/Math/symmetriceigenvalues.hpp File Reference . . . . . . . . . . . . . . . . . 793
10.152 ql/Math/symmetricschurdecomposition.hpp File Reference . . . . . . . . . . . . 794
10.153 ql/Math/trapezoidintegral.hpp File Reference . . . . . . . . . . . . . . . . . . . . 795
10.154 ql/MonteCarlo/brownianbridge.hpp File Reference . . . . . . . . . . . . . . . . . 796
10.155 ql/MonteCarlo/getcovariance.hpp File Reference . . . . . . . . . . . . . . . . . . . 797
10.156 ql/MonteCarlo/mctraits.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 798
10.157 ql/MonteCarlo/mctypedefs.hpp File Reference . . . . . . . . . . . . . . . . . . . . 799

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


CONTENTS xix

10.158 ql/MonteCarlo/montecarlomodel.hpp File Reference . . . . . . . . . . . . . . . . 800


10.159 ql/MonteCarlo/multipath.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 801
10.160 ql/MonteCarlo/multipathgenerator.hpp File Reference . . . . . . . . . . . . . . . 802
10.161 ql/MonteCarlo/path.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 803
10.162 ql/MonteCarlo/pathgenerator.hpp File Reference . . . . . . . . . . . . . . . . . . 804
10.163 ql/MonteCarlo/pathpricer.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 805
10.164 ql/MonteCarlo/sample.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 806
10.165 ql/null.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807
10.166 ql/numericalmethod.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 808
10.167 ql/Optimization/armijo.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 809
10.168 ql/Optimization/conjugategradient.hpp File Reference . . . . . . . . . . . . . . . 810
10.169 ql/Optimization/constraint.hpp File Reference . . . . . . . . . . . . . . . . . . . . 811
10.170 ql/Optimization/costfunction.hpp File Reference . . . . . . . . . . . . . . . . . . . 812
10.171 ql/Optimization/criteria.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 813
10.172 ql/Optimization/leastsquare.hpp File Reference . . . . . . . . . . . . . . . . . . . 814
10.173 ql/Optimization/linesearch.hpp File Reference . . . . . . . . . . . . . . . . . . . . 815
10.174 ql/Optimization/method.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 816
10.175 ql/Optimization/problem.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 817
10.176 ql/Optimization/simplex.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 818
10.177 ql/Optimization/steepestdescent.hpp File Reference . . . . . . . . . . . . . . . . . 819
10.178 ql/option.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 820
10.179 ql/Patterns/bridge.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 821
10.180 ql/Patterns/composite.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 822
10.181 ql/Patterns/curiouslyrecurring.hpp File Reference . . . . . . . . . . . . . . . . . . 823
10.182 ql/Patterns/lazyobject.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 824
10.183 ql/Patterns/observable.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 825
10.184 ql/Patterns/visitor.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 826
10.185 ql/payoff.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 827
10.186 ql/Pricers/continuousgeometricapo.hpp File Reference . . . . . . . . . . . . . . . 828
10.187 ql/Pricers/discretegeometricapo.hpp File Reference . . . . . . . . . . . . . . . . . 829
10.188 ql/Pricers/discretegeometricaso.hpp File Reference . . . . . . . . . . . . . . . . . 830
10.189 ql/Pricers/europeanoption.hpp File Reference . . . . . . . . . . . . . . . . . . . . 831
10.190 ql/Pricers/fdamericanoption.hpp File Reference . . . . . . . . . . . . . . . . . . . 832
10.191 ql/Pricers/fdbermudanoption.hpp File Reference . . . . . . . . . . . . . . . . . . 833
10.192 ql/Pricers/fdbsmoption.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 834
10.193 ql/Pricers/fddividendamericanoption.hpp File Reference . . . . . . . . . . . . . . 835

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


xx CONTENTS

10.194 ql/Pricers/fddividendeuropeanoption.hpp File Reference . . . . . . . . . . . . . . 836


10.195 ql/Pricers/fddividendoption.hpp File Reference . . . . . . . . . . . . . . . . . . . 837
10.196 ql/Pricers/fddividendshoutoption.hpp File Reference . . . . . . . . . . . . . . . . 838
10.197 ql/Pricers/fdeuropean.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 839
10.198 ql/Pricers/fdmultiperiodoption.hpp File Reference . . . . . . . . . . . . . . . . . . 840
10.199 ql/Pricers/fdshoutoption.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 841
10.200 ql/Pricers/fdstepconditionoption.hpp File Reference . . . . . . . . . . . . . . . . . 842
10.201 ql/Pricers/mcbasket.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 843
10.202 ql/Pricers/mccliquetoption.hpp File Reference . . . . . . . . . . . . . . . . . . . . 844
10.203 ql/Pricers/mcdiscretearithmeticapo.hpp File Reference . . . . . . . . . . . . . . . 845
10.204 ql/Pricers/mcdiscretearithmeticaso.hpp File Reference . . . . . . . . . . . . . . . 846
10.205 ql/Pricers/mceverest.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 847
10.206 ql/Pricers/mchimalaya.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 848
10.207 ql/Pricers/mcmaxbasket.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 849
10.208 ql/Pricers/mcpagoda.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 850
10.209 ql/Pricers/mcperformanceoption.hpp File Reference . . . . . . . . . . . . . . . . . 851
10.210 ql/Pricers/mcpricer.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 852
10.211 ql/Pricers/performanceoption.hpp File Reference . . . . . . . . . . . . . . . . . . 853
10.212 ql/Pricers/singleassetoption.hpp File Reference . . . . . . . . . . . . . . . . . . . . 854
10.213 ql/pricingengine.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 855
10.214 ql/PricingEngines/americanpayoffatexpiry.hpp File Reference . . . . . . . . . . . 856
10.215 ql/PricingEngines/americanpayoffathit.hpp File Reference . . . . . . . . . . . . . 857
10.216 ql/PricingEngines/Asian/analyticasianengine.hpp File Reference . . . . . . . . . 858
10.217 ql/PricingEngines/Barrier/analyticbarrierengine.hpp File Reference . . . . . . . . 859
10.218 ql/PricingEngines/Barrier/mcbarrierengine.hpp File Reference . . . . . . . . . . . 860
10.219 ql/PricingEngines/Basket/mcamericanbasketengine.hpp File Reference . . . . . . 861
10.220 ql/PricingEngines/Basket/mcbasketengine.hpp File Reference . . . . . . . . . . . 862
10.221 ql/PricingEngines/Basket/stulzengine.hpp File Reference . . . . . . . . . . . . . . 863
10.222 ql/PricingEngines/blackformula.hpp File Reference . . . . . . . . . . . . . . . . . 864
10.223 ql/PricingEngines/blackmodel.hpp File Reference . . . . . . . . . . . . . . . . . . 865
10.224 ql/PricingEngines/CapFloor/analyticalcapfloor.hpp File Reference . . . . . . . . 866
10.225 ql/PricingEngines/CapFloor/blackcapfloor.hpp File Reference . . . . . . . . . . . 867
10.226 ql/PricingEngines/CapFloor/capfloorpricer.hpp File Reference . . . . . . . . . . . 868
10.227 ql/PricingEngines/CapFloor/treecapfloor.hpp File Reference . . . . . . . . . . . . 869
10.228 ql/PricingEngines/Forward/forwardengine.hpp File Reference . . . . . . . . . . . 870
10.229 ql/PricingEngines/Forward/forwardperformanceengine.hpp File Reference . . . 871

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


CONTENTS xxi

10.230 ql/PricingEngines/genericmodelengine.hpp File Reference . . . . . . . . . . . . . 872


10.231 ql/PricingEngines/latticeshortratemodelengine.hpp File Reference . . . . . . . . 873
10.232 ql/PricingEngines/mcsimulation.hpp File Reference . . . . . . . . . . . . . . . . . 874
10.233 ql/PricingEngines/Quanto/quantoengine.hpp File Reference . . . . . . . . . . . . 875
10.234 ql/PricingEngines/Swaption/blackswaption.hpp File Reference . . . . . . . . . . 876
10.235 ql/PricingEngines/Swaption/jamshidianswaption.hpp File Reference . . . . . . . 877
10.236 ql/PricingEngines/Swaption/swaptionpricer.hpp File Reference . . . . . . . . . . 878
10.237 ql/PricingEngines/Swaption/treeswaption.hpp File Reference . . . . . . . . . . . 879
10.238 ql/PricingEngines/Vanilla/analyticdigitalamericanengine.hpp File Reference . . 880
10.239 ql/PricingEngines/Vanilla/analyticeuropeanengine.hpp File Reference . . . . . . 881
10.240 ql/PricingEngines/Vanilla/baroneadesiwhaleyengine.hpp File Reference . . . . . 882
10.241 ql/PricingEngines/Vanilla/binomialengine.hpp File Reference . . . . . . . . . . . 883
10.242 ql/PricingEngines/Vanilla/bjerksundstenslandengine.hpp File Reference . . . . . 884
10.243 ql/PricingEngines/Vanilla/discretizedvanillaoption.hpp File Reference . . . . . . 885
10.244 ql/PricingEngines/Vanilla/integralengine.hpp File Reference . . . . . . . . . . . . 886
10.245 ql/PricingEngines/Vanilla/jumpdiffusionengine.hpp File Reference . . . . . . . . 887
10.246 ql/PricingEngines/Vanilla/mcdigitalengine.hpp File Reference . . . . . . . . . . . 888
10.247 ql/PricingEngines/Vanilla/mceuropeanengine.hpp File Reference . . . . . . . . . 889
10.248 ql/PricingEngines/Vanilla/mcvanillaengine.hpp File Reference . . . . . . . . . . . 890
10.249 ql/qldefines.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891
10.250 ql/RandomNumbers/boxmullergaussianrng.hpp File Reference . . . . . . . . . . 893
10.251 ql/RandomNumbers/centrallimitgaussianrng.hpp File Reference . . . . . . . . . 894
10.252 ql/RandomNumbers/haltonrsg.hpp File Reference . . . . . . . . . . . . . . . . . . 895
10.253 ql/RandomNumbers/inversecumgaussianrng.hpp File Reference . . . . . . . . . 896
10.254 ql/RandomNumbers/inversecumgaussianrsg.hpp File Reference . . . . . . . . . 897
10.255 ql/RandomNumbers/knuthuniformrng.hpp File Reference . . . . . . . . . . . . . 898
10.256 ql/RandomNumbers/lecuyeruniformrng.hpp File Reference . . . . . . . . . . . . 899
10.257 ql/RandomNumbers/mt19937uniformrng.hpp File Reference . . . . . . . . . . . 900
10.258 ql/RandomNumbers/randomarraygenerator.hpp File Reference . . . . . . . . . . 901
10.259 ql/RandomNumbers/randomsequencegenerator.hpp File Reference . . . . . . . 902
10.260 ql/RandomNumbers/rngtraits.hpp File Reference . . . . . . . . . . . . . . . . . . 903
10.261 ql/RandomNumbers/rngtypedefs.hpp File Reference . . . . . . . . . . . . . . . . 904
10.262 ql/RandomNumbers/sobolrsg.hpp File Reference . . . . . . . . . . . . . . . . . . 905
10.263 ql/relinkablehandle.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 906
10.264 ql/scheduler.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
10.265 ql/ShortRateModels/calibrationhelper.hpp File Reference . . . . . . . . . . . . . . 908

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


xxii CONTENTS

10.266 ql/ShortRateModels/CalibrationHelpers/caphelper.hpp File Reference . . . . . . 909


10.267 ql/ShortRateModels/CalibrationHelpers/swaptionhelper.hpp File Reference . . . 910
10.268 ql/ShortRateModels/model.hpp File Reference . . . . . . . . . . . . . . . . . . . . 911
10.269 ql/ShortRateModels/onefactormodel.hpp File Reference . . . . . . . . . . . . . . 912
10.270 ql/ShortRateModels/OneFactorModels/blackkarasinski.hpp File Reference . . . 913
10.271 ql/ShortRateModels/OneFactorModels/coxingersollross.hpp File Reference . . . 914
10.272 ql/ShortRateModels/OneFactorModels/extendedcoxingersollross.hpp File Ref-
erence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 915
10.273 ql/ShortRateModels/OneFactorModels/hullwhite.hpp File Reference . . . . . . . 916
10.274 ql/ShortRateModels/OneFactorModels/vasicek.hpp File Reference . . . . . . . . 917
10.275 ql/ShortRateModels/parameter.hpp File Reference . . . . . . . . . . . . . . . . . . 918
10.276 ql/ShortRateModels/twofactormodel.hpp File Reference . . . . . . . . . . . . . . 919
10.277 ql/ShortRateModels/TwoFactorModels/g2.hpp File Reference . . . . . . . . . . . 920
10.278 ql/solver1d.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 921
10.279 ql/Solvers1D/bisection.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 922
10.280 ql/Solvers1D/brent.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 923
10.281 ql/Solvers1D/falseposition.hpp File Reference . . . . . . . . . . . . . . . . . . . . 924
10.282 ql/Solvers1D/newton.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . 925
10.283 ql/Solvers1D/newtonsafe.hpp File Reference . . . . . . . . . . . . . . . . . . . . . 926
10.284 ql/Solvers1D/ridder.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 927
10.285 ql/Solvers1D/secant.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 928
10.286 ql/stochasticprocess.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 929
10.287 ql/swaptionvolstructure.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . 930
10.288 ql/termstructure.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 931
10.289 ql/TermStructures/affinetermstructure.hpp File Reference . . . . . . . . . . . . . 932
10.290 ql/TermStructures/compoundforward.hpp File Reference . . . . . . . . . . . . . . 933
10.291 ql/TermStructures/discountcurve.hpp File Reference . . . . . . . . . . . . . . . . 934
10.292 ql/TermStructures/drifttermstructure.hpp File Reference . . . . . . . . . . . . . . 935
10.293 ql/TermStructures/extendeddiscountcurve.hpp File Reference . . . . . . . . . . . 936
10.294 ql/TermStructures/flatforward.hpp File Reference . . . . . . . . . . . . . . . . . . 937
10.295 ql/TermStructures/forwardspreadedtermstructure.hpp File Reference . . . . . . 938
10.296 ql/TermStructures/impliedtermstructure.hpp File Reference . . . . . . . . . . . . 939
10.297 ql/TermStructures/piecewiseflatforward.hpp File Reference . . . . . . . . . . . . 940
10.298 ql/TermStructures/quantotermstructure.hpp File Reference . . . . . . . . . . . . . 941
10.299 ql/TermStructures/ratehelpers.hpp File Reference . . . . . . . . . . . . . . . . . . 942
10.300 ql/TermStructures/zerocurve.hpp File Reference . . . . . . . . . . . . . . . . . . . 943
10.301 ql/TermStructures/zerospreadedtermstructure.hpp File Reference . . . . . . . . . 944

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


CONTENTS xxiii

10.302 ql/types.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 945


10.303 ql/Utilities/combiningiterator.hpp File Reference . . . . . . . . . . . . . . . . . . . 946
10.304 ql/Utilities/couplingiterator.hpp File Reference . . . . . . . . . . . . . . . . . . . . 947
10.305 ql/Utilities/filteringiterator.hpp File Reference . . . . . . . . . . . . . . . . . . . . 948
10.306 ql/Utilities/iteratorcategories.hpp File Reference . . . . . . . . . . . . . . . . . . . 949
10.307 ql/Utilities/processingiterator.hpp File Reference . . . . . . . . . . . . . . . . . . . 950
10.308 ql/Utilities/steppingiterator.hpp File Reference . . . . . . . . . . . . . . . . . . . . 951
10.309 ql/Volatilities/blackconstantvol.hpp File Reference . . . . . . . . . . . . . . . . . . 952
10.310 ql/Volatilities/blackvariancecurve.hpp File Reference . . . . . . . . . . . . . . . . 953
10.311 ql/Volatilities/blackvariancesurface.hpp File Reference . . . . . . . . . . . . . . . 954
10.312 ql/Volatilities/capflatvolvector.hpp File Reference . . . . . . . . . . . . . . . . . . 955
10.313 ql/Volatilities/impliedvoltermstructure.hpp File Reference . . . . . . . . . . . . . 956
10.314 ql/Volatilities/localconstantvol.hpp File Reference . . . . . . . . . . . . . . . . . . 957
10.315 ql/Volatilities/localvolcurve.hpp File Reference . . . . . . . . . . . . . . . . . . . . 958
10.316 ql/Volatilities/localvolsurface.hpp File Reference . . . . . . . . . . . . . . . . . . . 959
10.317 ql/Volatilities/swaptionvolmatrix.hpp File Reference . . . . . . . . . . . . . . . . 960
10.318 ql/voltermstructure.hpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . 961

11 QuantLib Example Documentation 963


11.1 AmericanOption.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 963
11.2 BermudanSwaption.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 968
11.3 DiscreteHedging.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973
11.4 EuropeanOption.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 978
11.5 history_iterators.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 986
11.6 swapvaluation.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 987

12 Todo List 999

13 Deprecated List 1003

14 Bug List 1005

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


Part I

User Manual
Chapter 1

An introduction to QuantLib

1.1 Introduction
QuantLib (http://quantlib.org/) is a C++ library for financial quantitative analysts and devel-
opers.
QuantLib is Non-Copylefted Free Software released under the modified BSD License. It is also
OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source
Initiative.
QuantLib is free software and you are allowed to use, copy, modify, merge, publish, distribute,
and/or sell copies of it under the conditions stated in the QuantLib QuantLib License(p. 32).
QuantLib and its documentation are distributed in the hope that they will be useful, but WITH-
OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the QuantLib License(p. 32) for more details.

1.1.1 Disclaimer

At this time, this documentation is widely incomplete and must be regarded as a work in progress.
Contributions are welcome.
4 An introduction to QuantLib

1.2 Project overview


The QuantLib project is at this time in beta status.
The following list is an overview of the existing code base.
The QuantLib-users mailing list is the preferred forum for proposals, suggestions and contribu-
tions regarding the future development of the library.
Date, calendars, and day count conventions

• Date class.

• Weekday, month, frequency, time unit enumerations.

• Period class (eg. 1y, 30d, 2m, etc.)

• Calendars: Budapest, Copenhagen, Frankfurt, Helsinki, Johannesburg, London, Milan,


New York, Oslo, Stockholm, Sydney, TARGET, Tokyo, Toronto, Warsaw, Wellington, Zurich.

• NullCalendar (no holidays) for theoretical calculations.

• Joint calendars made up as holiday union of base calendars.

• Rolling conventions: Preceding, ModifiedPreceding, Following, ModifiedFollowing,


MonthEndReference.

• Schedule class for date stream generation.

• Day count conventions: Actual360, Actual365, ActualActual (Bond, ISDA, AFB), 30/360
(US, European, Italian).

To do:

• Differentiate calendars depending on city+exchange, instead of city alone.

Math

• Linear, log-linear, and cubic spline interpolation.

• Primitive, first and second derivative functions of cubic and linear interpolators.

• Cubic spline end conditions: first derivative value, second derivative value, not-a-knot.

• Monotone cubic spline with Hyman non-restrictive filter.

• Bicubic spline and bilinear interpolations.

• Normal and cumulative normal distributions.

• Inverse cumulative normal distribution: Moro and Acklam approximations.

• Bivariate cumulative normal distribution.

• Binomial coefficients, binomial distribution, cumulative binomial distribution, and Peizer-


Pratt inversion (method 2.)

• Chi square and non-central chi square distributions.

• Beta functions.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1.2 Project overview 5

• Poisson and cumulative Poisson distributions.


• Incomplete gamma functions.
• Gamma distribution.
• Factorials.
• Integration algorithms: Gauss-Kronrod, Simpson, trapezoid.
• Error function.
• General 1-D statistics: mean, variance, standard deviation, skewness, kurtosis, error esti-
mation, min, max.
• Multi-dimensional (sequence) statistics: all the 1-D methods plus covariance, correlation,
L2-discrepancy calculation, etc.
• Risk measures for Gaussian and empirical distributions: semi-variance, regret, percentile,
top percentile, value-at-risk, upside potential, shorfall, average shorfall, expected shortfall.
• Array and matrix classes for algebra.
• Singular value decomposition.
• Eigenvalues, eigenvectors for symmetric matrices.
• Cholesky decomposition.
• Schur decomposition.
• Spectral rank-reduced square root, spectral pseudo-square root.

To do:

• Periodic and Lagrange end conditions for cubic spline.


• Implement convexity-preserving filter for cubic spline.
• Log-linear interpolator primitive, first and second derivative functions.
• Revise end conditions for bicubic spline.
• Trivariate and multi-variate distribution, see Genz, A. (1992) ‘Numerical Computation of
the Multivariate Normal Probabilities’, J. Comput. Graph. Stat. 1, pp. 141-150.
• Hypersphere decomposition, Higham algorithm for pseudo-square root.
• interface with GALib (genetic algorithm)
• Add COOOL algorithms
• Histogram class

1-dimensional solvers

• Bisection, false position, Newton, bounded Newton, Ridder, secant, Brent.

To do:

• Clean up the interface so that it is clear whether the accuracy is specified for x or f(x).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


6 An introduction to QuantLib

Optimization

• Conjugate gradient, simplex, steepest descent, line search, Armijo line search, least squares.
• Constrained (positive, boundary, etc.) and unconstrained optimization

Random-number generation

• Uniform pseudo-random sequences: Knuth, L’Ecuyer, Mersenne twister.


• Uniform quasi-random (low-discrepancy) sequences: Halton, Sobol up to dimension 21,200
(8,129,334 if you really want) with unit and Jäckel initialization numbers.
• Randomized quasi-random sequences (in progress)
• Primitive polynomials modulo 2 up to dimension 18 (available up to dimension 27.)
• Gaussian random numbers from uniform random numbers using different algorithms:
central limit theorem, Box-Muller, inverse cumulative (Moro and Acklam algorithms)

To do:

• Add Faure low-discrepancy sequence.


• Randomized low-discrepancy sequences.

Patterns

• Bridge, composite, lazy object, observer/observable, strategy, visitor.

Finite differences

• Mixed theta, implicit, explicit, and Crank-Nicolson 1-dimensional schemes.


• Differential operators: D0 , D+ , D− , D+ D− .
• Shout, Bermudan and American exercises.

To do:

• Richardson extrapolation
• Introduce variable theta schemes.
• Introduce multi time-level schemes.
• Enable different solvers (SOR, etc.)
• Extend to time-dependant parameters.
• Extend to local volatility.
• Two-dimension schemes.
• Improve boundary conditions.
• Adapt to the new pricing engine framework.
• Use DiscretisedAsset instead of array?

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1.2 Project overview 7

• Use TimeGrid

• Use assetGrid

• Handle barrier specification

• Handle variable asset step size

• Check (and improve) vega, rho, dividendRho greeks, solving their own equations

Lattices

• Binomial trees: Cox-Ross-Rubinstein, Jarrow-Rudd, additive equiprobabilities, Trigeorgis,


Tian, Leisen-Reimer.

• Trinomial (interest-rate) tree.

• Discretized asset.

• Richardson extrapolation

To do:

• Merge finite differences with the lattice framework. Use same rollback scheme.

• Evaluate proposed templatization

• Trinomial trees

• Implied trinomial trees

• Calculate binomial tree greeks

Monte Carlo

• One-factor and multi-factor path classes.

• Path-generator classes: incremental and Brownian-bridge one-factor path generation, in-


cremental multi-factor path generation.

• General-purpose Monte Carlo model based on traits for path samples.

• Antithetic variance-reduction technique.

• Control variate technique.

To do:

• Use StochasticProcess class instead of DiffusionProcess.

• Greeks calculation.

• Allow easier selection between Incremental/BrownianBridge path generation.

• Review Monte Carlo engine for american options.

• Review multi-factor Monte Carlo simulation.

• Predictor-corrector scheme.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


8 An introduction to QuantLib

• Add Milstein scheme.

• Add Martingale control variate.

• Batch samples as N=n_batches∗batch_size, and exploit it for randomized low discrepancy


sequences (RQMC)

Pricing engines

• Analytic Black formula (plus greeks) for different payoffs.

• Analytic formula for American options with payoff at expiry.

• Analytic formula for American options with payoff at hit.

• Monte Carlo simulation base engine.

• Lattice short rate model base engine.

• Engines for options described by "vanilla" set of parameters: analytic digital American,
analytic European, Barone-Adesi and Whaley approximation for American, binomial (Cox-
Ross-Rubinstein, Jarrow-Rudd, additive equiprobabilities, Trigeorgis, Tian, Leisen-Reimer),
Bjerksund and Stensland approximation for American, integral European, Merton 76 jump-
diffusion, Monte Carlo digital, Monte Carlo European.

• Engines for options described by "barrier" set of parameters: analytic down/up in/out,
Monte Carlo down/up in/out

• Engines for options described by "discrete Asian" set of parameters: analytic discrete geo-
metric average price

• Forward and forward-performance compound engines.

• Quanto compound engine.

• Basket engine: analytic Stulz engine for max/min on two assets, Monte Carlo engine (in
progress).

• Black model base class for vanilla interest rate derivatives

• Cap/floor pricing engines: analytic Black model, analytic affine models, tree based engine.

• Swaption pricing engines: analytic Black model, analytic affine models (Jamshidian), tree
based engine.

To do:

• More vanilla engines: Roll-Geske-Whaley American Call, Geske-Johnson American Put,


finite differences, Edgeworth expansion binomial tree, etc.

• Merge NesQuant SJD engine (http://www.nielses.dk/quantlib/nesquant/)

• Continous geometric average-strike.

• Ensure all path dependant options allow for evaluation with collected past observations.

• Define dividendRho for discrete dividends.

• Improve and test compound engines: quanto, forward, etc.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1.2 Project overview 9

Pricers

• Cliquet option

• Analytic continuous geometric average-price option (European exercise).

• Analytic discrete geometric average-price option (European exercise).

• Analytic discrete geometric average-strike option (European exercise).

• Finite difference American option.

• Bermudan option.

• Finite difference American option with discrete dividends (buggy).

• Finite difference European option with discrete dividends.

• Finite difference Shout option with discrete dividends (buggy).

• Finite difference European option (Black-Scholes).

• Monte Carlo basket option.

• Monte Carlo cliquet option.

• Monte Carlo discrete arithmetic average-price option.

• Monte Carlo discrete arithmetic average-strike option.

• Monte Carlo Everest option.

• Monte Carlo Himalaya option.

• Monte Carlo max basket option.

• Monte Carlo pagoda option.

• Monte Carlo forward performance option.

• Analytic forward performance option.

To do:

• Fix finite difference in presence of dividends

• All pricers should be moved to the pricing engine framework.

Financial Instruments

• Instrument base class: npv(), isExpired(), etc.

• Interest-rate swap: simple, normal.

• Swaption.

• Cap/floor.

• Stock.

• One-asset option base class.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10 An introduction to QuantLib

• Asian option.

• Barrier option.

• Cliquet option.

• Forward vanilla option.

• Quanto vanilla option.

• Quanto-forward vanilla option.

• Vanilla option.

• Multi-asset option base class.

• Basket option.

To do:

• Forward (stock) and FRA (forward-rate agreement).

• Bond.

Yield term structures

• Term structure common interface.

• Term structure classes based on discount, zero, or forward underlying description.

• Term structure based on linear interpolation of zero yields.

• Term structure based on log-linear interpolation of discounts.

• Term structure based on constant flat forward.

• Term structure based on piecewise-constant flat forwards with libor-futures-swap boot-


strapping algorithm.

• Spreaded term structures.

• Forward-date implied term structure.

To do:

• Future convexity adjustment

• End of year effect

• Do not require today’s date, only the settlement date (when discount==1.0) is necessary

• Assume no zero/forward implicit convention on input, specify them for output

Volatility

• Interface for cap/floor Black volatility term structures (unstable).

• Interface for swaption Black volatility term structures (unstable).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1.2 Project overview 11

• Interface for equity Black volatility term structures based on volatility or variance underlying
description: constant, time-dependant curve, time-strike surface, forward date implied term
structure.

• Interface for equity local volatility term structures: constant, time-dependant curve, time-
asset level surface (Gatheral’s formula).

To do:

• Fix implementation of Gatheral’s formula for local volatility.

Short rate models

• Single factor models: Hull-White, Black-Karasinski, Vasichek (untested), CIR (untested),


Extended CIR (untested).

• Two factor models: G2 (untested).

Credit derivatives
To do:

• Introduce BET and double BET.

• Valuation of credit default swap.

• Bootstrapping of default probability from bond, CDS, etc.

Test suite
More than 100 automated tests covering:

• American options.

• Asian options.

• Barrier options.

• Basket options (Stulz two-assets, etc.)

• Calendars.

• Caps/floors (implied volatility, etc.)

• Covariance matrices.

• Dates.

• Day counters.

• Digital options (Monte Carlo American cash-at-hit, etc.)

• Distributions.

• European options (implied volatility, etc.)

• Factorials, gamma, Poisson distribution.

• Integration algorithms.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


12 An introduction to QuantLib

• Cubic spline interpolations.


• Jump-diffusion engine.
• Low-discrepancy sequences.
• Quotes.
• Matrices (eigenvalues, eigenvectors, pseudo-square root, singular value decompostion).
• Mersenne-twister random-number generator.
• Finite-difference operators.
• Piecewise flat-forward term structure.
• Risk statistics.
• 1-dimensional solvers.
• Statistics.
• Swaps.
• Swaptions.
• Term structures.
• A number of old-style (to be deprecated) pricers.

To do:

• Add tests for quanto and forward engines.


• Add covariance/correlation test for SequenceStatistics
• Add single factor calibration and bermudan pricing tests
• Increase coverage.
• Move from cppUnit to boost unit-test framework.

Miscellanea

• Index classes for handling of fixed-income libor indexes (fixings, forecasting, etc.): AUD,
CAD, CHF, EUR, GBP, JPY, USD, ZAR, generic.
• Cash-flow class.
• Currency enumeration.
• Output data formatters: long integers, Ordinal numerals, power of two, exponential, fixed
digit, sequences, dates, etc.
• Input data parsers.
• Error classes and error handling.
• Exercise classes: European, Bermudan, American
• Payoff classes: plain, gap, asset-or-nothing, cash-or-nothing
• Grid classes for handling of equally and unequally spaced grids.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1.2 Project overview 13

• History class for handling of historical data.


• Quote class for mutable data.
• Null types.

To do:

• IRR, duration, convexity, etc. for a sequence of cash flows


• Currency as class with methods returning related info
• Implement currency as per OMG definition
• Implement round as per OMG enumeration/definition

Documentation

• Documentation automatically generated with Doxygen (html, PDF, ps, WinHelp, man
pages)

To do:

• Add a "Getting started" page to the site

• Enable forums?
• Create a FAQ

Distribution

• Windows installer generated with NSIS.


• Included in the Debian distribution.

• RPMs available.

To do:

• Fink package

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


14 An introduction to QuantLib

1.3 Where to get QuantLib

1.3.1 QuantLib releases

Source code, documentation, modules, etc. of current and previous QuantLib releases can be
downloaded from http://quantlib.org/download.html

1.3.2 Current CVS snapshot

Instructions for anonymous CVS access are available at http://quantlib.org/cvs.html


Access to the CVS repository is intended mainly for developers and is not recommended to end
users which should download the latest stable release instead.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1.4 Installation 15

1.4 Installation

1.4.1 Linux/Unix/Mac OS X/Cygwin

A tarball of the source distribution is available from


http://quantlib.org/download.html
After uncompressing the sources:

1. ‘cd’ to the QuantLib directory and type ‘./configure’ to configure the package for your
system. Before doing this, you might want to type ‘./configure –help’ to obtain information
on additional features you can enable.
2. Type ‘make’ to compile the package.
3. Type ‘make install’ to install the library. This might require administrative privileges.

The file INSTALL.txt in the QuantLib source distribution contains more detailed instructions.

1.4.2 Win32

An installer for the source distribution is available at


http://quantlib.org/download.html
Visual C++ 6.0 projects files and Borland C++ makefiles are supplied for building the library. You
are strongly suggested to also download and build cppUnit (http://cppunit.sourceforge.net)
in order to build and run the QuantLib test-suite.
Before compiling the library, you might want to edit the file "ql/userconfig.hpp" and enable
additional features by uncommenting the relevant lines.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


16 An introduction to QuantLib

1.5 Usage
To use QuantLib classes in your own code just add

#include <ql/quantlib.hpp>

at the beginning of your source/header files. Depending on the number of your files in your
project, this could cause a large increase in compilation time. If this were not acceptable, collective
headers are also available for smaller parts of the library; in particular, each subdirectory of the ql
directory contains a file all.hpp which makes available all classes and function in the respective
subdirectory.
Under the Examples folder you can find examples of QuantLib usage, including makefiles for gcc,
the Borland free compiler, and Microsoft Visual C++. For the latter project files are also available.

1.5.1 Microsoft Visual C++

A few suggestions for Visual C++ users wanting to use QuantLib into their own application:

1. you won’t have to explicitly link your application to the QuantLib library. This is done
automatically by compiler directives embedded in the sources.
2. Your project must be compiled with the same options that were used in compiling the Quant-
Lib library, in particular with regard to the settings under project settings, "C/C++" tab,
"Code Generation". You’ll have to check the "Use RTTI" option under the "C++ Language"
category, too. Finally, you have to define the NOMINMAX macro.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1.6 Version history 17

1.6 Version history


Release 0.3.6 - April 15th, 2004
Bug-fix release for QuantLib 0.3.5. A bug was removed where calls to impliedVolatility() would
break the state of the option and of all options sharing the same stochastic process.
Release 0.3.5 - March 31st, 2004
BOOST SUPPORT

• When available, QuantLib 0.3.5 now uses parts of the Boost library. The presence of Boost is
detected automatically under Unix/Linux systems; on Windows systems, it must be enabled
by uncommenting the relevant line in ql/userconfig.hpp.

• In the next QuantLib release, the presence of the Boost library will be mandatory.

MONTE CARLO FRAMEWORK

• Modified MultiPath interface to remove drifts. They are now in the stochastic processes.
• Preliminary implementation of Longstaff-Schwartz least-squares
• Monte Carlo pricer for European basket options
• Brownian-bridge bugs fixed
• StochasticProcess base class and derived classes (diffusion, jump-diffusion, etc.) have been
created.

PRICING ENGINES FRAMEWORK

• Pricing engines now use Payoff and Exercise classes.


• American basket options.
• Binary barrier option replaced by vanilla option with digital payoff.
• Stulz engine for max and min basket calls and puts on two assets.
• American binary option added (a.k.a. one-touch, american digital, americal barrier, etc.)
with different payoffs (cash/asset at hit/expiry, etc.)
• Added engine for Merton 1976 jump-diffusion process.
• Added Bjerksund and Stensland approximation for American option (still unstable.)
• Added Barone-Adesi and Whaley approximation for American option.
• Improved Black formula engine with more greeks added.
• Discrete geometric asian option.
• Added Leisen-Reimer binomial tree.

SHORT RATE MODELS

• Model renamed to ShortRateModel. A typedef is provided for backward compatibility–it


will be removed in subsequent releases.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


18 An introduction to QuantLib

VOLATILITY FRAMEWORK

• bug fix for short time (0<=t<=Tmin) interpolation

OPTIMIZATION FRAMEWORK

• Method renamed to OptimizationMethod. A typedef is provided for backward


compatibility–it will be removed in subsequent releases.

PATTERNS

• Composite pattern

MATH

• Improved cubic spline interpolation. It now handles end conditions such as first derivative
value, second derivative value, not-a-knot. Hyman filter for monotonically constrained
interpolation has been implemented. Primitive calculation has been enabled in addition to
derivative and second derivative.
• Primitive, first derivative, and second derivative functions are available for linear interpo-
lator.
• Singular value decomposition improved.
• Added bivariate cumulative normal distribution.
• Added binomial coefficient calculation, binomial distribution, cumulative binomial distri-
bution, and Peizer-Pratt inversion (method 2.)
• Added beta functions.
• Added Poisson distribution and cumulative distribution.
• Added incomplete gamma functions.
• Added factorial calculation.
• Added rank-reduced square root and improved pseudo-square root of square symmetric
matrices.
• Added Cholesky decomposition.

TEST SUITE

• Added test for cubic spline interpolation.


• Added test for singular value decomposition.
• Added test for two-asset baskets using the Stulz pricing engine.
• Added test for Monte Carlo American cash-at-hit options.
• Added test for jump-diffusion engine.
• Added test for American and European digital options.

MISCELLANEA

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1.6 Version history 19

• Inner namespaces have been deprecated.

• Added frequency enumeration, including ’once’.

• MarketElement renamed to Quote.

• Handling strike=0.0 where possible.

• More Payoff classes have been introduced: gap, asset-or-nothing, cash-or-nothing. Payoff
is now extensively used.

• Exercise class is now polymorphic. More derived classes have been introduced, and they
are now extensively used.

• Introduced QL_FAIL macro.

• Added calendar for Copenhagen

• 14 April 2004 (election day) added to Johannesburg calendar as a one-off holiday.

• Documentation generated with Doxygen 1.3.6.

• Win32 installer generated with NSIS 2.0.

Release 0.3.4 - November 21th, 2003


MONTE CARLO FRAMEWORK

• MC European in one step with strike-independent vol curve (hopefully)

• Path pricer for Binary options. It should cover both European and American style options.
Also known as: Digital, Binary, Cash-At-Hit, Cash-At-Expiry.

• Path pricers for barrier options

PRICING ENGINES FRAMEWORK

• More options moved to the new pricing engine framework: binary, barrier

• Changed setupEngine() into setupArguments(args)

• Moved pricing-engine machinery up to Instrument class

FIXED INCOME

• New basis-point sensitivity functions

• Added Swap::startDate() and maturity()

• Cap/floor fixing days taken into account

SHORT RATE MODELS

• An additional constraint can now be passed to the calibration

VOLATILITY FRAMEWORK

• Visitable volatility term structures

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


20 An introduction to QuantLib

OPTIMIZATION FRAMEWORK

• Added composite constraint

PATTERNS

• Visitor, Alexandrescu-style (saves some code duplication)

MATH

• Added more integration algorithms contributed by Roman Gitlin


• Relaxed constaints on interval boundaries for integration algorithms
• Interpolation traits

TEST SUITE

• Added implied cap/floor term volatility test


• Added test for binary options in PricingEngine Framework.
• Added tests for Barrier options in PricingEngine Framework. Some Monte Carlo tests, but
not comprehensive.

MISCELLANEA

• Conditionally allowed negative yields (disabled by default)


• Null calendar and simple day counter for reproducing theoretical calculations
• Fixed for VC++.Net compilation
• Added spec file for RPMs
• Added global flag for early/late payments
• Enabled test suite for Borland
• Removed OnTheEdge VC++ configurations
• Added VC++ configurations for static and dynamic Multithread libraries
• Upgraded to use Doxygen 1.3.4

Release 0.3.3 - September 3rd, 2003


MONTE CARLO FRAMEWORK

• Re-templatized Monte Carlo model based on traits.


• New path generator based on DiffusionProcess, TimeGrid, and externally initialized random
number generator.
• Added Halton low discrepancy sequence.
• Added sequence generators: random sequence generator creates a sequence generator out
of a random number generator. InvCumGaussianRsg creates a gaussian sequence generator
out of a uniform (random or low discrepancy) sequence generator.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1.6 Version history 21

• RNG as constructor input constructor( long seed) deprecated.


• Mersenne Twister random number generator added
• Old PathPricers, PathGenerators, etc are available with a trailing _old
• Added Jäckel’s Brownian Bridge (not used yet.)
• Sobol Random Sequence Generator. Unit and Jäckel.
• Added randomized Halton sequences.

FINITE DIFFERENCE FRAMEWORK

• Old class Grid no longer exists, use CenteredGrid to obtain the same result.

LATTICE FRAMEWORK

• Abstracted discretized option.


• Additive binomial trees. All binomial trees now use DiffusionProcess.
• Added Tian binomial tree.

PRICING ENGINES FRAMEWORK

• Partially implemented.
• Quanto forward compounded engines.
• Integral (european) pricing engine.

YIELD TERM STRUCTURE

• ZeroCurve: a term structure based on linear interpolation of zero yields.

FIXED INCOME

• Up-front and in-arrear indexed coupon.


• Specific implementation of compound forward rate from zero yield.
• Added compound forward and zero coupon implementations.
• Added Futures rate helper with specified maturity date.
• Added bucketed bps calculation.
• Added swap constructor using specified maturity date as well as added functionality in
Scheduler.
• Added date-bucketed basis point sensitivity based on 1st derivative of zero coupon rate.

OPTIMIZATION FRAMEWORK

• Solvers now take any function. ObjectiveFunction disappeared.

PATTERNS

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


22 An introduction to QuantLib

• Abstracted lazy object.


• Abstracted the curiously recurring template pattern.

DATE AND CALENDARS

• Added joint calendars.


• Tokyo, Stockholm, Johannesburg calendar improved.
• "MonthEndReference" business day rolling convention. Similar to "ModifiedFollowing",
unless where original date is last business day of month all resulting dates will also be last
business day of month.
• Added basic date generation starting from the end.

MATH

• Added Gauss-Kronrod integration algorithm.


• Added primitive polynomial modulo 2 up to dimension 18 (available up to dimension 27.)
• Added BicubicSplineInterpolation.
• Numerical Recipes algorithm is back since there is a problem with Nicolas’ code: it is unable
to fit a straight line, it waves around the line.
• Prime number generation.
• Acklam’s approximation for inverse cumulative normal distribution function (replaced
Moro’s algorithm as default.)
• Added error function.
• Improved Cumulative Normal Distribution function using the error function.
• Matrix pseudo square algorithm using salvaging algorithm(s).
• Added SequenceStatistics.
• Major Statistic reworking.
• Added DiscrepancyStatistic that inherits from SequenceStatistic and extends it with the
calculation of L2-discrepancy.
• HStatistics.
• Added first and second derivative ot cubic splines.

RISK MEASURES

• Introduced semiVariance and regret.


• Redefinition of average shorfall (normalization factor now is cumulative(target) instead of
1.0)

MISCELLANEA

• QuEP 9 "generic disposable objects" implemented.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1.6 Version history 23

• Added test suite.

• Dataformatters extended to format long integers, Ordinal numerals, power of two format-
ting.

• Exercise class adopted.

• Added user configuration section.

• Inhibited automatic conversion of Handle<T> to RelinkableHandle<T>.

• Diffusion process extended.

• Added strikeSensitivity to the Greeks.

• BS does handle t==0.0 and sigma==0.0.

• TimeGrid has been reworked.

• Added payoff file for Payoff classes. Added Cash-Or-Nothing and Asset-Or-Nothing payoff
classes.

• Upgraded to use Doxygen 1.3.

Release 0.3.1 - February 4th, 2003


FINITE DIFFERENCE FRAMEWORK

• partially implemented QuEP 2 (http://quantlib.org/quep.html)

VOLATILITY FRAMEWORK

• added Black and local volatility interface

PRICING ENGINES FRAMEWORK

• partially implemented QuEP 5 (http://quantlib.org/quep.html)

YIELD TERM STRUCTURE

• interface revisited

• added discrete time forward methods

• added DiscountCurve (loglinear interpolated) and CompoundForward term structures

• ForwardSpreadedTermStructure moved under QuantLib::TermStructures namespace

FIXED INCOME

• Modified coupons so that the payment date can be after the end of the accrual period

MISCELLANEA

• added/verified holidays of many calendars

• added new calendars

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


24 An introduction to QuantLib

• added new currencies

• more date formatters

• added Period(std::string&)

• it is now possible to advance a calandar using a Period

• added LogLinear Interpolation

• the allowExtrapolation boolean in interpolation classes has been removed from constructors
and added to the operator()

• Renamed Solver1D::lowBound and hiBound

• bug fixes

BUILD PROCESS

• More autoconfiscated time functions and types

• Migrated to latest autotools

• added patches for Darwin and Solaris

Release 0.3.0 - May 6th, 2002


MONTE CARLO FRAMEWORK

• Path and MultiPath are time-aware

• McPricer: extended interface, improved convergency algorithm

FINITE DIFFERENCE FRAMEWORK

• added mixed (implicit/explicit) scheme, from which Crank-Nicolson, ImplicitEuler, and


ExplicitEuler are now derived

• Finite Difference exercise conditions are now in the FiniteDifferences folder/namespace

• Finite Difference pricers now start with ’Fd’ letters

• BSMNumericalOption became BsmFdOption

LATTICE FRAMEWORK

• introduced first version of the framework

• CRR and JR binomial trees

VOLATILITY FRAMEWORK

• early works on reorganization of vol structures

YIELD TERM STRUCTURE

• new TermStructure class based on affine model

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1.6 Version history 25

• yield curves can be spreaded in term of zeros (ZeroSpreadedTermStructure) and forwards


(ForwardSpreadedTermStructure)

• Added dates() and times() to PiecewiseFlatForward

• discount factor accuracy in the yield curve bootstrapping is an input

• added single factor short-rate models (Hull-White, Black-Karasinski)

• added two factor short-rate models framework

• cap/floor and swaption calibration helpers

• added bermudan swaption pricing example (including BK and HW calibrations)

FIXED INCOME

• cap/floor and swaption tree pricer

• cap/floor analytical pricer

• vanilla swaption Jamshidian pricer

• Added accruedAmount() to coupons

• Made cash flow vector builders into functions

OPTIMIZATION FRAMEWORK

• added conjugate gradient, simplex

PATTERNS

• implemented QuEP 8 and 10

MISCELLANEA

• added allowExtrapolation parameter to interpolaton classes

• added 2D bilinear interpolation

• better spline interpolation algorithm

• Added non-central chi-square distribution function.

• Improved Inverse Cumulative Normal Distribution using Moro’s algorithm

• Introduced class representing stochastic processes

• added isExpired() to Instrument interface

• added functions folder and namespace for QuantLibXL and any other function-like interface
to QuantLib

• Handle is now castable to an Handle of a compatible type

• added downsideVariance to the Statistics class

• kustosis() and skewness() now handles the case of stddev == 0 and/or variance == 0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


26 An introduction to QuantLib

• added Correlation Matrix to MultiVariateAccumulator

• enforced MS VC compilation settings

• added "-debug" to the QL_VERSION version string ifdef QL_DEBUG

• "make check" runs the example programs under Borland C++

• fixed compilation with "g++ -pedantic"

• Spread as market element

• new calendars introduced

• new Xibor Indexes introduced

• Added optional day count to libor indexes

• Shortened file names within 31 char limit to support HFS

Release 0.2.1 - December 3rd, 2001


MONTE CARLO FRAMEWORK

• Path and MultiPath are now classes on their own

• PathPricer now handles both Path and MultiPath

• MonteCarloModel now handles both single factor and multi factors simulations.

• McPricer now handles both single factor and multi factors pricing. New pricing interface

• antithetic variance-reduction technique made possible in Monte Carlo for both single factor
and multi factors

• Control Variate specific class removed: control variation technique is now handled by the
general MC model

• average price and average strike asian option refactored

• Sample as a (value,weight) struct

• random number generators moved under RandomNumbers folder and namespace

FINITE DIFFERENCE FRAMEWORK

• BackwardEuler and ForwardEuler renamed ImplicitEuler and ExplicitEuler, respectively

• refactoring of TridiagonalOperator and derived classes

YIELD TERM STRUCTURE AND FIXED INCOME

• Added some useful methods to term structure classes

• Allowed passing a quote to RateHelpers as double

• added FuturesRateHelpers (no convexity adjustment yet)

• PiecewiseFlatForward now observer of rates passed as MarketElements

• Unified Date and Time interface in TermStructure

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1.6 Version history 27

• Added BPS to generic swap legs


• added term_structure+swap example
• Fixing days introduced for floating-coupon bond

PATTERNS

• Added factory pattern


• Calendar and DayCounter now use the Strategy pattern

VARIOUS

• used do-while-false idiom in QL_REQUIRE-like macros


• now using size_t where appropriate
• dividendYield is now a Spread instead of a Rate (that is: cost of carry is allowed)
• RelinkableHandle initialized with an optional Handle
• Worked around VC++ problems in History constructor
• added QL_VERSION and QL_HEX_VERSION
• generic bug fixes
• removed classes deprecated in 0.2.0

INSTALLATION FACILITIES

• improved and smoother Win32 binary installer

DOCUMENTATION

• general re-hauling
• improved and extended Monte Carlo documentation
• improved and extended examples
• Upgraded to Doxygen 1.2.11.1
• Added man pages for installed executables
• added docs in Windows Help format
• added info on "Win32 OnTheEdgeRelease" and "Win32 OnTheEdgeDebug" MS VC++ con-
figurations
• additional information on how to create a MS VC++ project based on QuantLib

Release 0.2.0 - September 18th, 2001

• Library:
– source code moved under ql, better GNU standards
– gcc build dir can now be separated from source tree

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


28 An introduction to QuantLib

– gcc 3.0.1 port


– clean compilation (no warnings)
– bootstrap script on cygwin
– Fixed automatic choice of seed for random number generators
– Actual/actual classes
– extended platform support (see table in documentation)
– antithetic variance-reduction technique made possible in Monte Carlo
– added dividend-Rho greek
– First implementation of segment integral (to be redesigned)
– Knuth random generator
– Cash flows, scheduler, and swap (both generic and simple) added
– added ICGaussian random generator
– generic bug fixes
• Installation facilities:
– improved and smoother Win32 binary installer
– better distribution
– debian packages available
• Documentation:
– general re-hauling
– added examples of using QuantLib and of projects based on QL

Release 0.1.9 - May 31st, 2001

• Library:
– Style guidelines introduced (see http://quantlib.org/style.html) and partially en-
forced
– full support for Microsoft Visual Studio
– full support for Linux/gcc
– momentarily broken support for Metrowerks CodeWarrior
– autoconfiscation (with specialized config.∗.hpp files for platforms without au-
tomake/autoconf support)
– Include files moved under Include/ql folder and referenced as "ql/header.hpp"
– Implemented expression templates techniques for array algebra optimization
– Added custom iterators
– Improved term structure
– Added Asian, Bermudan, Shout, Cliquet, Himalaya, and Barrier options (all with
greeks calculation, control variated where possible)
– Added Helsinki and Wellington calendars
– Improved Normal distribution related functions: cumulative, inverse cumulative, etc.
– Added uniform and Gaussian random number generators
– Added Statistics class (mean, variance, skewness, downside variance, etc.)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1.6 Version history 29

– Added RiskMeasures class: VAR, average shortfall, expected shortfall, etc.


– Added RiskStatistics class combining Statistics and RiskMeasures
– Added sample accumulator for multivariate analysis
– Added Monte Carlo tools
– Added matrix-related functions (square root, symmetric Schur decomposition)
– Added interpolation framework (linear and cubic spline interpolation implemented).
• Installation facilities:
– Added Win32 GUI installer for binaries
• Documentation:
– support for Doxygen 1.2.7
– Added man documentation

Release 0.1.1 - November 21st, 2000


Initial release.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


30 An introduction to QuantLib

1.7 Additional resources


The main QuantLib resource is the QuantLib web site (http://quantlib.org).
Additional resources available from the above site include:

• current news (http://sourceforge.net/news/?group_id=12740);


• the QuantLib mailing lists (http://quantlib.org/mailinglists.html);
• the QuantLib FAQ (http://quantlib.org/FAQ.html);
• the QuantLib programming style guidelines (http://quantlib.org/style.html);

• a link to the QuantLib project page on SourceForge.net


(http://sourceforge.net/projects/quantlib);
• links to pages for bug reports (http://sourceforge.net/tracker/?group_-
id=12740&atid=112740), patch submissions (http://sourceforge.net/tracker/?group_-
id=12740&atid=312740), and feature requests (http://sourceforge.net/tracker/?group_-
id=12740&atid=362740);
• a page (http://quantlib.org/extensions.html) about how to use QuantLib in other
languages/platforms;
• QuantLib web-site statistics (http://sourceforge.net/project/stats/?group_-
id=12740);
• as well as links to additional quantitative finance resources.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1.8 The QuantLib Group 31

1.8 The QuantLib Group

1.8.1 Authors

The QuantLib Group members are:

• Ferdinando Ametrano (nando AT ametrano DOT net), project manager


• Luigi Ballabio (luigi.ballabio AT statpro.com), library designer
• Nicolas Di Césaré, spline and optimizer
• Dirk Eddelbuettel: Debian maintainer, RQuantLib
• Neil Firth: Monte Carlo, Longstaff-Schwartz American option, Barrier option
• Marco Marchioro (marco.marchioro AT statpro.com)
• Sadruddin Rejeb (sad AT quantlib.org), interest rate models
• Niels Elken Sønderby: Gauss-Kronrod integration
• Liguo Song (Liguo.Song AT vanderbilt.edu): RPM maintainer

1.8.2 Contributors

We gratefully acknowledge contributions from Mario Aleppo, Toyin Akin, James Battle, Christo-
pher Baus, Thomas Becker, Adolfo Benin, David Binderman, Jon Davidson, Matteo Gallivanoni,
Roman Gitlin, Tomoya Kawanishi, Gilbert Peffer, Peter Schmitteckert, Enrico Sirola, Maxim
Sokolov, David Schwartz, and Bernd Johannes Wuebben.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


32 An introduction to QuantLib

1.9 QuantLib License


Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:

• Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.

• Redistributions in binary form must reproduce the above copyright notice, this list of con-
ditions and the following disclaimer in the documentation and/or other materials provided
with the distribution.

• Neither the names of the copyright holders nor the names of the QuantLib Group and
its contributors may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS


IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CON-
TRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

1.9.1 Comments on Copyright and License

QuantLib is Non-Copylefted Free Software [1] released under the modified BSD License [2] (also
know as XFree86-style license).
QuantLib is Open Source [3] because of its license: it is OSI Certified Open Source Software [4].
OSI Certified is a certification mark of the Open Source Initiative [5].
The modified BSD License is GPL compatible as confirmed by the Free Software Foundation [6].
This license has been adopted to allow free use of QuantLib and its source, to make QuantLib
flourish as a free-software/open-source project. It allows proprietary extensions to be commer-
cialized.
[1] http://www.gnu.org/philosophy/categories.html#Non-CopyleftedFreeSoftware
[2] http://www.opensource.org/licenses/bsd-license.html
[3] http://www.opensource.org/docs/definition.html
[4] http://www.opensource.org/docs/certification_mark.html
[5] http://www.opensource.org
[6] http://www.gnu.org/philosophy/bsd.html

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


Chapter 2

QuantLib components

2.1 Core classes


The base directory ql of the QuantLib sources contains what can be considered the QuantLib
foundation, i.e., the core of concrete and abstract classes upon which the rest of the library is built.
Subfolders reflect the organization of classes and functions into definite packages or class families:
the former being groups of classes forming a framework for particular applications, e.g., the PDE
package for partial differential equations; and the latter being sets of classes which inherit from
a common base class or otherwise share a common functionality and interface. These are the
subject of later sections.
The QuantLib core classes include:

• numeric types such as Time, Rate, Spread, or DiscountFactor;


• concrete data classes such as Date, Handle, Currency, or History; base classes such as
Calendar or DayCounter; and helper classes such as Scheduler;
• abstract base classes providing interfaces to the rest of the library. Among these, the most
notable include Instrument, Quote, TermStructure, Index, PricingEngine, StochasticProcess,
and others.
34 QuantLib components

2.2 Date and time calculations

2.2.1 Dates

The concrete class QuantLib::Date(p. 237) implements the concept of date. Its functionalities
include:

• providing basic information such as weekday, day of the month, day of the year, month,
and year;

• comparing two dates to determine whether they are equal, or which one is the earlier or
later, or the difference between them expressed in days;

• incrementing or decrementing a date of a given number of days, or of a given period


expressed in weeks, months, or years.

2.2.2 Calendars

The abstract class QuantLib::Calendar(p. 184) provides the interface for determining whether a
date is a business day or a holiday for a given market, or incrementing/decrementing a date of a
given number of business days. A number of calendars is contained in the ql/Calendars directory.

2.2.3 Day counters

The abstract class QuantLib::DayCounter(p. 240) provides more advanced means of measuring
the distance between two dates according to a given market convention, both as number of days
of fraction of year. A number of such conventions is contained in the ql/DayCounters directory,
namely,

• Actual/360
• Actual/365
• Actual/Actual, which can be calculated according to:
– ISMA and US Treasury convention, also known as "Actual/Actual (Bond)";
– ISDA, also known as "Actual/Actual (Historical)";
– AFB, also known as "Actual/Actual (Euro)";
• 30/360, which can be calculated according to:
– USA convention;
– European convention;
– Italian convention.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


2.3 Lattice methods 35

2.3 Lattice methods


The framework (corresponding to the ql/Lattices directory) contains basic building blocks for
pricing instruments using lattice methods (trees). A lattice, i.e. an instance of the abstract
class QuantLib::Lattice(p. 386), relies on one or several trees (each one approximating a diffusion
process) to price an instance of the DiscretizedAsset class. Trees are instances of classes derived
from QuantLib::Tree(p. 607), classes which define the branching between nodes and transition
probabilities.

2.3.1 Binomial trees

The binomial method is the simplest numerical method that can be used to price path-independent
derivatives. It is usually the preferred lattice method under the Black-Scholes-Merton model. As
an example, let’s see the framework implemented in the bsmlattice.hpp(p. 749) file. It is a method
based on a binomial tree, with constant short-rate (discounting). There are several approaches to
build the underlying binomial tree, like Jarrow-Rudd or Cox-Ross-Rubinstein.

2.3.2 Trinomial trees

When the underlying stochastic process has a mean-reverting pattern, it is usually better to use a
trinomial tree instead of a binomial tree. An example is implemented in the QuantLib::Trinomial-
Tree(p. 615) class, which is constructed using a diffusion process and a time-grid. The goal is
to build a recombining trinomial tree that will discretize, at a finite set of times, the possible
evolutions of a random variable y satisfying

dyt = µ(t, yt )dt + σ(t, yt )dWt .

At each node, there is a probability pu , pm andpd to go through respectively the upper, the middle
and the lower branch. These probabilities must satisfy

pu yi+1,k+1 + pm yi+1,k + pd yi+1,k−1 = Ei, j

and
pu y2i+1,k+1 + pm y2i+1,k + pd y2i+1,k−1 = Vi,2 j + E2i, j ,
where k (the index of the node at the end of themiddle branch) is the index of the node which is the
nearest to the expected future value, Ei, j = E y(ti+1 )|y(ti ) = yi, j and Vi,2 j = Var{y(ti+1 )|y(ti ) = yi, j }.

If we suppose that the variance is only dependant on time Vi,j = Vi and set yi+1 to Vi 3, we find
that
2
1 (Ei, j − yi+1,k ) Ei, j − yi+1,k
pu = + 2
+ √ ,
6 6Vi 2 3Vi
2
2 (Ei, j − yi+1,k )
pm = − ,
3 3Vi2
2
1 (Ei, j − yi+1,k ) Ei, j − yi+1,k
pd = + 2
− √ .
6 6Vi 2 3Vi

2.3.3 Bidimensional lattices

To come...

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


36 QuantLib components

2.3.4 The QuantLib::DiscretizedAsset class

This class is a representation of the price of a derivative at a specific time. It is roughly an array
of values, each value being associated to a state of the underlying stochastic variables. For the
moment, it is only used when working with trees, but it should be quite easy to make a use
of it in finite-differences methods. The two main points, when deriving classes from Quant-
Lib::DiscretizedAsset(p. 260), are:

1. Define the initialisation procedure (e.g. terminal payoff for european stock options).
2. Define the method adjusting values, when necessary, at each time steps (e.g. apply the
step condition for american or bermudan options). Some examples are found in Quant-
Lib::DiscretizedSwap and QuantLib::DiscretizedSwaption.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


2.4 The finite differences framework 37

2.4 The finite differences framework


This framework (corresponding to the ql/FiniteDifferences directory) contains basic building
blocks for the numerical solution of a generic differential equation

∂f
= Lf
∂t
where L is a differential operator in “space”, i.e., one which does not contain partial derivatives
in t but can otherwise contain any derivative in any other variable of the problem.
Writing the equation in the above form allows us to implement separately the discretization of
the differential operator L and the time scheme used for the evolution of the solution. The Quant-
Lib::FiniteDifferenceModel(p. 302) class acts as a glue for such two steps—which are outlined
in the following sections—and provides the interface of the resulting finite difference model for
the end user. Furthermore, it provides the possibility of checking and operating on the solution
array at each step—which is typically used to apply an exercise condition for an option. This is
also outlined in a section below.

2.4.1 Differential operators

The discretization of the differential operator L depends on the discretization chosen for the
solution f of the given equation.
Such choice is obvious in the 1-D case where the domain [a, b] of the equation is discretized as
a series of points xi , i = 0 . . . N − 1 (note that the index is zero based) where xi = a + hi and
h = (b − a)/(N − 1). In turn, the solution f of the equation is discretized as an array ui , i = 0 . . . N − 1
whose elements are defined as ui = f (xi ). The discretization of the differential operator follows
by substituting the derivatives with the corresponding incremental ratios defined in terms of the
fi . A number of basic operators are defined in the framework which can be composed to form
more complex operators, namely:
the first derivative ∂/∂x is discretized as the operator D+ , defined as
ui+1 − ui
D+ ui =
h
and implemented in class QuantLib::DPlus(p. 267); the operator D− , defined as
ui − ui−1
D− ui =
h
and implemented in class QuantLib::DMinus(p. 265); and the operator D0 , defined as
ui+1 − ui−1
D0 ui =
2h
and implemented in class QuantLib::DZero(p. 271). The discretization error of the above opera-
tors is O(h) for D+ and D− and O(h2 ) for D0 ;
the second derivative ∂2 /∂x2 is discretized as the operator D+ D− , defined as

ui+1 − 2ui + ui−1


D+ D− ui =
h2
and implemented in class QuantLib::DPlusDMinus(p. 268). Its discretization error is O(h2 ).
The boundary condition for the above operators is by default linear extrapolation. Methods are
currently provided for setting other kinds of boundary conditions to a tridiagonal operator which

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


38 QuantLib components

these operators inherit, namely, Dirichlet—i.e., constant value—and Neumann—i.e., constant


derivative—boundary conditions. This might change in the future as boundary conditions could
be astracted and passed as an additional argument to the model.
A programmer can also implement its own operator. However, in order to fit into this framework
it will have to implement a required interface depending on the chosen evolver (see below). Also,
it is currently required to manage itself any boundary conditions. Again, this could change in the
future.
On the other hand, there is no obvious choice in the 2-D case. While it is immediate to discretize
the domain into a series of points (xi , y j ) and the solution into a matrix fi j = f (xi , y j ), there is a
number of ways into which the fij can be arranged into an array—each of them determining a
different discretization of the differential operators. One of such ways was implemented in the
LexicographicalView class, while others will be implemented in the future. No 2-D operator is
currently implemented.

2.4.2 Time schemes

Once the differential operator L has been discretized, a number of choices are available for
discretizing the time derivative at the left-hand side of the equation.
In this framework, such choice is encapsulated in so-called evolvers which, given L and the
solution u(k) at time tk , yield the solution u(k−1) at the previous time step.
A number of evolvers are currently provided in the library which implement well-known schemes,
namely,
the forward Euler explicit scheme in which the equation is discretized as

u(k) − u(k−1)
= Lu(k)
∆t
hence
u(k−1) = (I − ∆tL) u(k)
from which u(k−1) can be obtained directly;
the backward Euler implicit scheme in which the equation is discretized as

u(k) − u(k−1)
= Lu(k−1)
∆t
hence
(I + ∆tL) u(k−1) = u(k)
from which u(k−1) can be obtained by solving a linear system;
the Crank-Nicolson scheme in which the equation is discretized as

u(k) − u(k−1) u(k) + u(k−1)


=L
∆t 2
hence
∆t ∆t
   
I+
L u(k−1) = I − L u(k)
2 2
(k−1)
from which u can be obtained by solving a linear system.
Each of the above evolvers forces a set of interface requirements upon the differential operator
which are detailed in the documentation of the corresponding class, namely, QuantLib::Explicit-
Euler(p. 284), QuantLib::ImplicitEuler(p. 354), and QuantLib::CrankNicolson(p. 228), respec-
tively.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


2.4 The finite differences framework 39

A programmer could implement its own evolver, which does not need to inherit from any base
class.
However, it must implement the following interface:

class Evolver {
public:
typedef ... arrayType;
typedef ... operatorType;
// constructors
Evolver(const operatorType& D);
// member functions
void step(arrayType& a, Time t) const;
void setStep(Time dt);
};

Finally, we note again that the pricing of an option requires the finite difference model to solve
the corresponding equation backwards in time. Therefore, given a discretization u of the solution
at a given time t, the call

evolver.step(u,t)

must calculate the discrete solution at the previous time, t − dt.

2.4.3 Step conditions

A finite difference model can be passed a step condition to be applied at each step during the
rollback of the solution (e.g. the early exercise American condition). Such condition must be
embodied in a class derived from QuantLib::StepCondition(p. 570) and must implement the
interface of the latter, namely,

class MyCondition : public StepCondition<arrayType> {


public:
void applyTo(arrayType& a, Time t) const;
};

2.4.4 An example of finite difference model

The Black-Scholes equation can be written in the above form as

∂f σ2 ∂2 f ∂f
=− −ν + r f.
∂t 2 ∂x 2 ∂x
It can be seen that the operator LBS is

σ2 ∂2 ∂
LBS = − − ν + rI
2 ∂x2 ∂x
and can be built from the basic operators provided in the library as

σ2
LBS = − D+ D− − νD0 + rI.
2

Its implementation closely reflects the above decomposition and can be written as

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


40 QuantLib components

class BlackScholesOperator : public TridiagonalOperator {


public:
BlackScholesOperator(
double sigma, double nu, // parameters of the
Rate r, // Black-Scholes equation;
unsigned int points, // number of discretized points;
double h) // grid spacing.
: TridiagonalOperator(
// build the operator by adding basic ones
- (sigma*sigma/2.0) * DPlusDMinus(points,h)
- nu * DZero(points,h)
+ r * TridiagonalOperator::identity(points)
) {}
};

taking as inputs the relevant parameters of the equation (σ, ν and r) as well as model parameters
such as the number N of grid points and their spacing h.
As simple example cases, we will use the above operator to price both an European and an
American option. The parameters of the two options will be the same, namely, they will be both
call options with underlying price u = 100, strike s = 95, residual time T = 1 year, dividend yield
q = 3% and volatility σ = 10%. The risk-free rate will be r = 5%. Such parameters are expressed
using QuantLib types as

Option::Type type = Option::Call;


double underlying = 100.0, strike = 95.0;
Time residualTime = 1.0;
Rate dividendYield = 0.03, riskFreeRate = 0.05;
double volatility = 0.10;

The grid upon which the model will act will be a logarithmic grid of underlying prices, i.e., f will
be defined in a range [ln umin , ln umax ] discretized as an array xi , i = 0 . . . N − 1 with xi = ln umin + ih
and h = (ln umax − ln umin )/(N − 1). Such a grid and the corresponding vector of actual prices can
√ in the code below. The domain of the model will be defined as [ln u − ∆, ln u + ∆]
be built as shown
where ∆ = 4σ T. A number of grid points N = 101 will be used.

unsigned int gridPoints = 101;


Array grid(gridPoints), prices(gridPoints);
double x0 = QL_LOG(underlying);
double Delta = 4.0*volatility*QL_SQRT(residualTime);
double xMin = x0 - Delta, xMax = x0 + Delta;
double h = (xMax-xMin)/(gridPoints-1);
for (unsigned int i=0; i<gridPoints; i++) {
grid[i] = xMin + i*h;
prices[i] = QL_EXP(grid[i]);
}

The initial condition is determined by the values of the option at maturity, i.e., either the difference
between underlying price and strike if such difference is positive, or 0 if that is not the case (the
above will have to be suitably modified for a put option or a straddle.) Such “initial” condition
will be rolled back in time by our model.

Array exercisingValue(gridPoints);
for (unsigned int i=0; i<gridPoints; i++)
exercisingValue[i] = QL_MAX(prices[i]-strike,0.0);

Now the differential operator can be initialized. Also, Neumann initial conditions are set which
correspond to the initial value of the derivatives at the boundaries (see the BoundaryCondition
class documentation for details).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


2.4 The finite differences framework 41

double nu = riskFreeRate - dividendYield - volatility*volatility/2.0;


TridiagonalOperator L = BlackScholesOperator(volatility, nu,
riskFreeRate, gridPoints, h);
L.setLowerBC(BoundaryCondition(BoundaryCondition::Neumann,
exercisingValue[1]-exercisingValue[0]));
L.setUpperBC(BoundaryCondition(BoundaryCondition::Neumann,
exercisingValue[gridPoints_-1]-exercisingValue[gridPoints_-2]));

We are now already set for the pricing of the European option. Also, the exercise condition is the
only thing still to be defined for the American option to be priced. Such condition is equivalent
to the statement that at each time step, the value of the option is the maximum between the profit
realized in exercising the option (which we already calculated and stored in exercisingValue)
and the value of the option should we keep it (which corresponds to the solution rolled back to
the current time step). This logic can be implemented as:

class ExerciseCondition : public StepCondition<Array> {


public:
ExerciseCondition(const Array& exercisingValue)
: exercisingValue_(exercisingValue) {}
void applyTo(Array& a, Time) const {
for (unsigned int i = 0; i < a.size(); i++)
a[i] = QL_MAX(a[i], exercisingValue_[i]);
}
private:
Array exercisingValue_;
};

Everything is now ready. The model can be created gluing the piece together by means of the
QuantLib::FiniteDifferenceModel(p. 302) class. The current value of the option is calculated by
rolling back the solution to the current time, i.e., t = 0, and by taking the value corresponding at
the current underlying price—which by construction corresponds to the central value provided
that the number of grid points is odd.

unsigned int timeSteps = 365;

// build the model - Crank-Nicolson scheme chosen


FiniteDifferenceModel<CrankNicolson<TridiagonalOperator> > model(L);

// European option
Array f = exercisingValue; // initial condition
model.rollback(f, residualTime, 0.0, timeSteps);
double europeanValue = valueAtCenter(f);

// American option
f = exercisingValue; // reset
Handle<StepCondition<Array> > condition(
new ExerciseCondition(exercisingValue));
model.rollback(f, residualTime, 0.0, timeSteps, condition);
double americanValue = valueAtCenter(f);

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


42 QuantLib components

2.5 The Monte Carlo framework


Anyone attempting to generate random numbers by deterministic means is, of course, living
in a state of sin. — John Von Neumann

Warning: this section of the documentation is currently outdated.


This framework (corresponding to the ql/MonteCarlo directory) contains basic building blocks
for the numerical calculation of the integral
Z
f (x)p(x)dx

where p(x) is a normalized probability function. Monte Carlo methods solve the above integral
by approximating it with the discrete sum
N
1 X
f (xi )w(xi )
N
i=1

where the xi are drawn from p(x), possibly with a weight w(xi ) — which otherwise can be
considered uniformly equal to 1.
The above sum has a straightforward interpretation in the case of a derivative product, namely,
the xi are N generated random paths which the value of the underlying can possibly follow, while
the f (xi ) are the values of the derivative on each of such paths. The sum above can therefore be
taken as an estimate of the price of the derivative, namely, the average of its value on all possible
paths — or rather all considered paths. Such a method enables the user to construct pricing
classes for an unlimited range of derivatives, most notably path-dependent ones which cannot
be priced by means of finite difference methods.
It must also be mentioned that for all such methods, the error e on the estimated value is propor-
tional to the square root of the number of samples N. A number of so-called variance-reduction
methods have been found which allows one to reduce the coefficient of proportionality between

e and 1/ N.
Separate implementations are provided in the library for the three components of the above
average, namely, the random drawing of the xi , the evaluation of the f (xi ), and the averaging
process itself. The QuantLib::MonteCarloModel(p. 448) class acts as a glue for such three steps
— which are outlined in the following sections — and provides the interface of the resulting
Monte Carlo model to the end user.

2.5.1 Path generation

The Black-Scholes equation


∂ f σ2 ∂2 f ∂f
+ +ν − r f = 0,
∂t 2 ∂x 2 ∂x
where r is the risk-free rate, σ is the volatility of the underlying, and ν = r − σ2 /2, has the form
of a diffusion process. According to this heuristic interpretation (1)(p. 47), paths followed by the
logarithm of the underlying would be Brownian random walks with a constant drift ν per unit

time and a standard deviation σ T over a time T.
Therefore, the paths to be generated for a Monte Carlo model of the Black-Scholes equation will
be vectors of successive variations of the logarithm of the underlying price over M consecutive
time intervals ∆ti , i = 0 . . . M − 1. Each such variation will be drawn from a Gaussian distribution

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


2.5 The Monte Carlo framework 43

√ √
with average ν∆Ti and standard deviation σ ∆Ti — or possibly νi ∆Ti and σi ∆Ti should ν and
σ vary in time.
The QuantLib::Path(p. 501) class stores the variation vector decomposed in its drift (determined)
and diffusion (random) components. As shown below, this allows the implementation of anti-
thetic variance reduction techniques.
The QuantLib::MultiPath(p. 455) class is a straightforward extension which acts as a vector of
Path objects.
Classes are provided which generate paths and multi-paths with the desired drift and
diffusion components, namely, QuantLib::PathGenerator(p. 502) and QuantLib::MultiPath-
Generator(p. 456).
For the time being, the path generator is initialized with a constant drift and variance. This
requirement will most likely be relaxed in the next release. The multi-path generator is initialized
with an array of constant drifts—one for each single asset—and a covariance matrix which
encapsulates the relations between the diffusion components of the single assets.
The time discretization of the (multi)paths can be specified either as a given number of equal time
steps over a given time span, or as a vector of explicitly specified times at which the path will be
sampled.

2.5.2 Pricing an instrument on a path

The QuantLib::PathPricer(p. 504) class is the base class from which path pricers must inherit. The
only method which subclasses are required to implement is

double operator()(const P&) const;

where P can be Path or MultiPath depending on the derivative whose value must be calculated.
Similarly, the term path will be used in the following discussion as meaning either path or multi-
path depending on the context. The term single path is not to be taken as opposite to multi-path,
but rather as meaning “a single instance of a (multi)path" as opposed to the set of all generated
(multi)paths.
The above method encapsulates the pricing of the derivative on a single path and must return
its value had the evolution of the underlying(s) followed the path passed as argument. For this
reason, control variate techniques (see below) must not be implemented at this level since they
would cause the returned value to differ from the actual price of the derivative on the path.
Instead, antithetic variance-reduction techniques can be effectively implemented at this level and
indeed are used in the pricers currently included in the library.
In short, such techniques consist in pricing an option on both the given path and its antithetic,
the latter being a path with the same drift and the opposite diffusion component. The value of
the sample is defined as the average of the prices on the two paths.
A generic implementation of antithetic techniques could consist of a path pricer class which takes
a concrete path pricer upon construction and whose operator() simply proxies two calls to the
contained pricer, passing the given path and its antithetic, and averages the result. However, this
would not take full advantage of the technique.
In fact, it must be noted that using antithetic paths not only reduces the variance per se but also
allows to factor out calculations commons to a path and its antithetic, thus reducing greatly the
computation time. Therefore, such techniques are best implemented inside the path pricer itself,
whose algorithm can fully exploit such factorization.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


44 QuantLib components

A number of path pricers are available in the library and listed in reference manual.

2.5.3 Accumulating and averaging samples

The class QuantLib::MonteCarloModel(p. 448) encapsulates the general structure of a Monte


Carlo calculations, namely, the generation of a number of paths, the pricing of the derivative on
each path, and the averaging of the results to yield the actual derivative price.
As outlined above, the first two steps are delegated to a path generator and a path pricer. The third
step is also delegated to an object which accumulates weighted values and returns the statistic
properties of the set of such values. One such class provided by the library is QuantLib::Statistics.
The concern of the Monte Carlo model is therefore to act as a glue between such three components
and can be expressed by the following pseudo-code:

given pathGenerator, pathPricer, accumulator;


for i in number of samples {
path,weight = pathGenerator.next();
price = pathPricer(path);
accumulator.add(price,weight);
}

The Monte Carlo model also provides the user with the possibility to take advantage of control-
variate techniques.
Such techniques consist in pricing a portfolio from which the price of the derivative can be
deduced, but with a lower variance than the derivative alone.
In our current implementation, static-hedge control variate is used, namely, the formed portfolio
is long of the derivative we need to price and short of a similar derivative whose price can be
calculated analytically. The value of the portfolio on a given path will of course be given by
the difference of the values of the two derivatives on such path. However, due to the similarity
between the derivatives, the portfolio price will have a lower variance than either derivative alone
since any variation in the price of the latter will be partly compensated by a similar variation in
the price of the other. Lastly, given the portfolio price, the price of the derivative we are interested
in can be deduced by adding the analytic value of the other.
In order to use such technique, the user must provide the model with a path pricer for the
additional option and the value of the latter. The action of the Monte Carlo model is in this case
expressed as:

given pathGenerator, pathPricer, cvPathPricer, cvPrice, accumulator;


for i in number of samples {
path,weight = pathGenerator.next();
portfolioPrice = pathPricer(path) - cvPathPricer(path);
accumulator.add(portfolioPrice+cvPrice,weight);
}

Martingale (a.k.a. dynamic-hedge) control variate techniques are planned for future releases.
A QuantLib::McPricer(p. 438) class is also available which wraps the typical usage of a Monte
Carlo model.
Details on the Monte Carlo Pricer interface will be available in the Pricers(p. 49) section.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


2.5 The Monte Carlo framework 45

2.5.4 Examples of Monte Carlo models

As a simple example, we will use the outlined tools to price an European option by means of
Monte Carlo techniques.
Given a current underlying price u0 and a path p = [p1 , . . . , pN ] where every variation pi is the
sum of a drift term di and a random diffusion term ri , the price of the underlying at maturity is
N
 N   N N

Y X  X X 
u = u0 epi = u0 exp  pi  = u0 exp  di + ri 
1 1 1 1

while the price on the antithetic path — i.e., same drift and opposite diffusion — is
 N N

X X 
u0 exp  di − ri  .
1 1

The corresponding path pricer can be implemented as:

class EuropeanPathPricer : public PathPricer<Path> {


public:
EuropeanPathPricer(Option::Type type, double underlying,
double strike, DiscountFactor discount,
bool useAntithetic)
// just store the needed parameters
: type_(type), underlying_(underlying), strike_(strike),
discount_(discount), useAntithetic_(useAntithetic) {}
// here is the logic
double operator()(const Path& path) const {

size_t n = path.size();

// factor out the sums in the formula above


double sum_d = 0.0, sum_r = 0.0;
for (size_t i = 0; i < n; i++) {
sum_d += path.drift()[i];
sum_r += path.diffusion()[i];
}

// calculate final underlying price on path


double price = underlying_*QL_EXP(sum_d+sum_r);

// calculate payoff
double payoff;
switch (type_) {
case Option::Call;
payoff = QL_MAX(price-strike,0.0);
break;
// other cases are left as an exercise to the reader
...
}

// current value of the option is the discounted payoff


double optionValue = payoff*discount_;

// stop here if not antithetic...


if (!useAntithetic_)
return optionValue;

// ...otherwise calculate the value on the antithetic path


double antiPrice = underlying_*QL_EXP(sum_d-sum_r);

// calculate payoff and option value as above


...

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


46 QuantLib components

// return the average of the results on the two paths


return (optionValue + antiOptionValue)/2.0;
}
private:
// stored parameters
...
};

The path pricer can now be used in a model. Let us assume the following parameters:

Option::Type type = Option::Call;


double underlying = 100.0, strike = 95.0;
Time residualTime = 1.0;
Rate dividendYield = 0.03, riskFreeRate = 0.05;
double volatility = 0.10;

The path generator can be instantiated as

// parameters of the Black-Scholes equation


double vol2 = volatility*volatility;
double nu = riskFreeRate - dividendYield - vol2/2.0;
// in this case we are only interested in the final underlying price.
// Therefore, we can cover all the residual time in one big time step.
int timeSteps = 1;

Handle<GaussianPathGenerator> pathGenerator(
new GaussianPathGenerator(nu,vol2,residualTime,timeSteps));

where QuantLib::GaussianPathGenerator is a typedef to a path generator using the default choice


for a Gaussian random number generator.
The path pricer is instantiated as

// discount at maturity
DiscountFactor discount = QL_EXP(-riskFreeRate*residualTime);
bool antithetic = true;

Handle<PathPricer<Path> > pathPricer(


new EuropeanPathPricer(type,underlying,strike,discount,antithetic));

The model can now be created and used as following:

// number of samples to be generated


size_t samples = 1000000;

// pass the path generator and pricer we just created and a


// newly instantiated Statistics object
MonteCarloModel<Statistics,GaussianPathGenerator,PathPricer> model(
pathGenerator,pathPricer,Statistics());

model.addSamples(samples);

// now get the results: the option price is given by value with
// a confidence level given by error
value = model.sampleAccumulator().mean();
error = model.sampleAccumulator().errorEstimate();

More examples of path pricers can be found in the ql/MonteCarlo directory, while examples of
more sophisticated pricers which uses them in Monte Carlo models can be found in the ql/Pricers
directory.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


2.5 The Monte Carlo framework 47

2.5.5 Notes

(1)(p. 42) A more rigorous approach would lead us to integrate the above equation by means of
Green functions or Laplace transforms. Both such methods would show that the price at time
t = 0 of an option with payoff G(S(T)) where S(T) is the underlying price at expiry is given by the
integral Z ∞
(ξ − νT)2
!
1
e−rT G(S0 eξ ) √ exp − dξ
−∞ 2πσ2 T 2σ2 T
where S0 is the price of the underlying at t = 0. It can be seen that the above integral is of the
form shown at the beginning of this section, namely, the pricing function is

f (x) = e−rT G(S0 ex )

and can be interpreted as the option payoff discounted to the present time, while the probability
distribution is
(x − νT)2
!
1
p(x) = √ exp − .
2πσ2 T 2σ2 T
which again shows that the logarithms of the underlying prices at time T are distributed as a

Gaussian with average νT and standard deviation σ T.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


48 QuantLib components

2.6 The short-rate modelling framework

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

dxi = µ(t, xi )dt + σ(t, xi )dWt

where r = f (t, x). If the model is affine (i.e. derived from the QuantLib::AffineModel(p. 112)
class), analytical formulas for discount bonds and discount bond options are given (useful for
calibration).

2.6.1 Single-factor models


The Hull & White model

drt = (θ(t) − α(t)rt )dt + σ(t)dWt

When α and σ are constants, this model has analytical formulas for discount bonds and
discount bond options.

The Black-Karasinski model

d ln rt = (θ(t) − α ln rt )dt + σdWt

No analytical tractability here.

The extended Cox-Ingersoll-Ross model


drt = (θ(t) − krt )dt + σ rt dWt

There are analytical formulas for discount bonds (and soon for discount bond options).

2.6.2 Calibration

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
Derived classed are QuantLib::CapHelper and QuantLib::SwaptionHelper.
For the calibration itself, you must choose an optimization method that will find constant param-
eters such that the value: v
t n
X (T − M )2
i i
V= ,
Mi
i=1

where Ti is the price given by the model and Mi is the market price, is minimized. A few
optimization methods are available in the ql/Optimization directory.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


2.6 The short-rate modelling framework 49

2.6.3 Two-factor models

2.6.4 Pricers
Analytical pricers

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::Analytical-
CapFloor(p. 119). In the case of single-factor affine models, swaptions can be priced using the
Jamshidian decomposition, implemented in QuantLib::JamshidianSwaption(p. 379).

Using Finite Differences

(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:

dxt = µ(t, x)dt + σ(t, x)dWt

any european-style instrument will follow the following PDE:

∂P ∂P 1 2 ∂2 P
+µ + σ = r(t, x)P
∂t ∂x 2 ∂x2

The adequate operator to feed a Finite Difference Model instance is defined in the QuantLib::One-
FactorOperator(p. 487) class.

Using Trees

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-independant derivative. Just implement a class derived from Numerical-
Derivative (see QuantLib::NumericalSwaption for example) and roll it back until the present
time... Just look at QuantLib::TreeCapFloor(p. 608) and QuantLib::TreeSwaption(p. 609) for
working pricers.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


50 QuantLib components

2.7 Currencies and FX rates

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


2.8 Instruments and pricers 51

2.8 Instruments and pricers

2.8.1 Instruments and pricers

Since version 0.3.4, the Instrument class was reworked as shown in the following figure.

if (isExpired()) LazyObject
setupExpired();
else #calculate(): void
LazyObject::calculate(); #performCalculations(): void

setupArguments(engine_->arguments());
engine_->arguments()->validate();
engine_->calculate(); engine_
// dynamic_cast needed in real code
NPV_ = engine_->results()->NPV;
Instrument
+isExpired(): bool
#calculate(): void PricingEngine
#performCalculations(): void
#setupExpired(): void -arguments: Arguments *
+setupArguments(Arguments *): void -results: Results *
+calculate()

Old-style instrument New-style instrument


+isExpired(): bool +isExpired(): bool
#performCalculations(): void +setupArguments(Arguments *): void Concrete engine
----- and possibly -----() ----- and possibly -----()
#setupExpired(): void #setupExpired(): void +calculate(): void
#performCalculations(): void

// override parent implementation


Instrument::performCalculations();
// additional behavior

On the one hand, the checking of the expiration condition is now performed in a method is-
Expired() separated from the actual calculation, and a setupExpired() method is provided.
The latter sets the NPV to 0.0 and can be extended in derived classes should any other results be
returned.
On the other hand, the pricing-engine machinery previously contained in the Option class was
moved upwards to the Instrument class. Also, the setupEngine() method was replaced by a
setupArguments(Arguments∗) method. This allows one to cleanly implement containment of
instruments with code such as:

class FooArguments : public Arguments { ... };

class Foo : public Instrument {


public:
void setupArguments(Arguments*);
...
};

class FooOptionArguments : public FooArguments { ... };

class FooOption : public Option {


private:
Foo underlying_;
public:
void setupArguments(Arguments* args) {
underlying_.setupArguments(args);
// set the option-specific part
}
...
};

which was more difficult to write with setupEngine().


Therefore, there are now two ways to inherit from Instrument, namely:

1. implement the isExpired method, and completely override the performCalculations


method so that it bypasses the pricing-engine machinery. If the class declared any other

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


52 QuantLib components

results beside NPV_ and errorEstimate_, the setupExpired method should also be extended
so that those results are set to a value suitable for an expired instrument. This was the
migration path taken for all instruments not previously deriving from the Option class.
2. define suitable argument and result classes for the instrument and implement the is-
Expired and setupArguments methods, reusing the pricing-engine machinery provided by
the default performCalculations method. The latter can be extended by first calling
the default implementation and then performing any additional tasks required by the
instrument—most often, copying additional results from the pricing engine results to the
corresponding data members of the instrument. As in the previous case, the setupExpired
method can be extended to account for such extra data members.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


2.9 Math tools 53

2.9 Math tools


Math facilities of the library include:

2.9.1 Pseudo-random number and low-discrepancy sequence generators

Implementations of pseudo-random number and low-discrepancy sequence generators. They


share the ql/RandomNumbers directory.

2.9.2 One-dimensional solvers

The abstract class QuantLib::Solver1D(p. 565) provides the interface for one-dimensional solvers
which can find the zeroes of a given function.
A number of such solvers is contained in the ql/Solvers1D directory.
The implementation of the algorithms was inspired by "Numerical Recipes in C", 2nd edition,
Press, Teukolsky, Vetterling, Flannery - Chapter 9
Some work is needed to resolve the ambiguity of the root finding accuracy defition: for some
algorithms it is the x-accuracy, for others it is f(x)-accuracy.

2.9.3 Optimizers

The optimization framework (corresponding to the ql/Optimization directory) implements some


multi-dimensional minimizing methods. The function to be minimized is to be derived from the
QuantLib::CostFunction(p. 219) base class (if the gradient is not analytically implemented, it will
be computed numerically).

The simplex method

This method, implemented in QuantLib::Simplex(p. 560), is rather raw and requires quite a lot
of computing resources, but it has the advantage that it does not need any evaluation of the cost
function’s gradient, and that it is quite easily implemented. First, we must choose N+1 starting
points, given here by a starting point P0 and N points such that
Pi = P0 + λei ,
where λ is the problem’s characteristic length scale). These points will form a geometrical form
called simplex. The principle of the downhill simplex method is, at each iteration, to move the
worst point (highest cost function value) through the opposite face to a better point. When the
simplex seems to be constrained in a valley, it will be contracted downhill, keeping the best point
unchanged.

The conjugate gradient method


We’ll now continue with a bit more sophisticated method, implemented in Quant-
Lib::ConjugateGradient(p. 213) . At each step, we minimize (using Armijo’s line search
algorithm, implemented in QuantLib::ArmijoLineSearch(p. 125)) the function along a line
defined by
2
∇ f (xi )
di = −∇ f (xi ) + 2
di−1 ,
∇ f (xi−1 )

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


54 QuantLib components

d0 = −∇ f (x0 ).

As we can see, this optimization method requires the knowledge of the gradient of the cost
function. See QuantLib::ConjugateGradient(p. 213) .

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


2.10 Design patterns 55

2.10 Design patterns

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


56 QuantLib components

2.11 Term structures


The abstract class QuantLib::TermStructure(p. 594) provides the common interface to concrete
term structure models. Among others, methods are declared which return instantaneous forward
rate, discount factor, and zero rate at a given date. Adapter classes are provided which already
implement part of the required methods, thus allowing the programmer to define only the
non-redundant part. The PiecewiseConstantForwards class is provided as an example in the
ql/TermStructures directory.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


2.12 Utilities 57

2.12 Utilities
Iterators are meant to build a sequence on the fly from one or more other sequences, without
having to allocate place for storing it. A couple of examples: suppose we have a function which
calculates the average of a sequence, and that for genericity we have implemented it as a template
function which takes the beginning and the end of the sequence, so that its declaration is:

template <class Iterator>


typename Iterator::value_type
average(const Iterator& begin, const Iterator& end)

This kind of genericity allows one to use the same function to calculate the average of a std::vector,
a std::list, a QuantLib::History(p. 342), any other container, of a subset of any of the former.
Now let’s say we have two sequences of numbers, and we want to calculate the average of their
products. One approach could be to store the products in another sequence, and to calculate the
average of the latter, as in:

// we have sequence1 and sequence2 and assume equal size:


// first we store their product in a vector...
std::vector<double> products;
std::transform(sequence1.begin(),sequence1.end(), // first sequence
sequence2.begin(), // second sequence
std::back_inserter(products), // output
std::multiplies<double>()); // operation to perform
// ...then we calculate the average
double result = average(products.begin(),products.end());

The above works, however, it might be not particularly efficient since we have to allocate the
product vector, quite possibly just to throw it away when the calculation is done.
QuantLib::coupling_iterator(p. 220) allows us to do the same thing without allocating the extra
vector: what we do is simply:

// we have sequence1 and sequence2 and assume equal size:


double result = average(
make_coupling_iterator(sequence1.begin(),
sequence2.begin(),
std::multiplies<double()),
make_coupling_iterator(sequence1.end(),
sequence2.end(),
std::multiplies<double()));

The call to make_coupling_iterator creates an iterator which is really a reference to the two
iterators and the operation we passed. Dereferencing such iterator returns the result of applying
such operation to the values pointed to by the two contained iterators. Advancing the coupling
iterator advances the two underlying ones. One can see how iterating on such iterator generates
the products one by one so that they can be processed by average(), but does not need allocating
memory for storing the results. The product sequence is generated on the fly.
The other iterators share the same principle but have different functionalities:

• combining_iterator is the same as coupling_iterator, but works on N sequences while the


latter works on 2;
• filtering_iterator generates the elements of a given sequence which satisfy a given predicate,
i.e., it takes a sequence [x0 , x1 , . . .] and a predicate p and generates the sequence of those xi
for which p(xi ) returns true;

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


58 QuantLib components

• processing_iterator takes a sequence [x0 , x1 , . . .] and a function f and generates the sequence
[ f (x0 ), f (x1 ), . . .];
• stepping_iterator takes a sequence [x0 , x1 , . . .] and a step m and generates the sequence
[x0 , xm , x2m , . . .]

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


Chapter 3

Examples

A few examples of using the QuantLib library can be found in chapter 11 of the reference manual.
60 Examples

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


Part II

Reference Manual
Chapter 4

QuantLib Module Index

4.1 QuantLib Modules


Here is a list of all modules:
Global QuantLib macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Numeric limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Time functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
String functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Character functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Input/output functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Min and max functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Template capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Iterator support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
64 QuantLib Module Index

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


Chapter 5

QuantLib Hierarchical Index

5.1 QuantLib Class Hierarchy


This inheritance list is sorted roughly, but not completely, alphabetically:
AcyclicVisitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
BPSBasketCalculator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
BPSCalculator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
AmericanPayoffAtExpiry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
AmericanPayoffAtHit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
CapFloor::arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Option::arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
MultiAssetOption::arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
BasketOption::arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
OneAssetOption::arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Swaption::arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
SimpleSwap::arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
Swaption::arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
ArrayFormatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Average . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Barrier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
BarrierOption::arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
BinomialDistribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
BivariateCumulativeNormalDistribution . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
BlackKarasinski::Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
BoundaryCondition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
BoundaryCondition< TridiagonalOperator > . . . . . . . . . . . . . . . . . . . . . . . . . 172
DirichletBC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
NeumannBC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
BoxMullerGaussianRng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Bridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Bridge< Calendar, CalendarImpl > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Budapest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Copenhagen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
66 QuantLib Hierarchical Index

Frankfurt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Helsinki . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
Johannesburg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
JointCalendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
London . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Milan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
NewYork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
NullCalendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
Oslo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
Stockholm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
Sydney . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
TARGET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
Tokyo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
Toronto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
Warsaw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
Wellington . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
Zurich . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
Bridge< Constraint, ConstraintImpl > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Constraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
BoundaryConstraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
CompositeConstraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
NoConstraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
PositiveConstraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
Bridge< DayCounter, DayCounterImpl > . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
DayCounter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Actual360 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Actual365 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
ActualActual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
SimpleDayCounter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
Thirty360 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
Bridge< Interpolation, InterpolationImpl > . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
CubicSpline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
MonotonicCubicSpline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
NaturalCubicSpline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
NaturalMonotonicCubicSpline . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
LinearInterpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
LogLinearInterpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
Bridge< Interpolation2D, Interpolation2DImpl > . . . . . . . . . . . . . . . . . . . . . . . 179
Interpolation2D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
BicubicSpline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
BilinearInterpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Bridge< Parameter, ParameterImpl > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
ConstantParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
NullParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
PiecewiseConstantParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
TermStructureFittingParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
ExtendedCoxIngersollRoss::FittingParameter . . . . . . . . . . . . . . . . . . . 287
G2::FittingParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
HullWhite::FittingParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


5.1 QuantLib Class Hierarchy 67

BrownianBridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
CalendarImpl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Calendar::WesternImpl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
CalibrationSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
CLGaussianRng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
CliquetOption::arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
CliquetOptionPricer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
combining_iterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Composite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
ConstraintImpl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
CostFunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
LeastSquareFunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
coupling_iterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
CoxIngersollRoss::Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
ExtendedCoxIngersollRoss::Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Cubic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
CumulativeBinomialDistribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
CumulativeNormalDistribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
CumulativePoissonDistribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
CuriouslyRecurringTemplate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Solver1D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
CuriouslyRecurringTemplate< Bisection > . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Solver1D< Bisection > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Bisection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
CuriouslyRecurringTemplate< Brent > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Solver1D< Brent > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Brent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
CuriouslyRecurringTemplate< FalsePosition > . . . . . . . . . . . . . . . . . . . . . . . . 235
Solver1D< FalsePosition > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
FalsePosition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
CuriouslyRecurringTemplate< Newton > . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Solver1D< Newton > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Newton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
CuriouslyRecurringTemplate< NewtonSafe > . . . . . . . . . . . . . . . . . . . . . . . . . 235
Solver1D< NewtonSafe > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
NewtonSafe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
CuriouslyRecurringTemplate< Ridder > . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Solver1D< Ridder > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Ridder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
CuriouslyRecurringTemplate< Secant > . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Solver1D< Secant > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Secant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
CurrencyFormatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
DateFormatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
DayCounterImpl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
DiffusionProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
BlackScholesProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
OrnsteinUhlenbeckProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
SquareRootProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


68 QuantLib Hierarchical Index

DiscreteAveragingAsianOption::arguments . . . . . . . . . . . . . . . . . . . . . . . . . . 257
DiscretizedAsset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
DiscretizedDiscountBond . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
DiscretizedOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Disposable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
DoubleFormatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
EndCriteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
AssertionFailedError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
IllegalArgumentError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
IllegalResultError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
IndexError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
OutOfMemoryError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
PostconditionNotSatisfiedError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
PreconditionNotSatisfiedError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
ErrorFunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
EuroFormatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
EarlyExercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
AmericanExercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
BermudanExercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
EuropeanExercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Factorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
FdBermudanOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
FdDividendAmericanOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
FdDividendShoutOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
filtering_iterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
FiniteDifferenceModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
ForwardOptionArguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
GammaFunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
GaussianStatistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
GeneralStatistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
GenericRiskStatistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
HaltonRsg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
Handle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Handle< AffineModel > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Handle< BlackModel > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Handle< Impl > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Handle< Lattice > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Handle< Link< TermStructure > > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
RelinkableHandle< TermStructure > . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
Handle< Link< Type > > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
RelinkableHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
Handle< MonteCarloModel< MultiAsset< RNG >, S > > . . . . . . . . . . . . . . . . . . 339
Handle< MonteCarloModel< MultiAsset_old< PseudoRandomSequence_old >, Statis-
tics > > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Handle< MonteCarloModel< SingleAsset< RNG >, S > > . . . . . . . . . . . . . . . . . . 339
Handle< MonteCarloModel< SingleAsset_old< PseudoRandom_old >, Statistics > > . . 339
Handle< OneFactorAffineModel > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Handle< path_generator_type > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Handle< path_pricer_type > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Handle< ShortRateModel > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


5.1 QuantLib Class Hierarchy 69

Handle< TermStructure > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339


History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
History::const_iterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
History::Entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
HullWhite::Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
ICGaussianRng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
ICGaussianRsg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
IncrementalStatistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
IntegerFormatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Interpolation2DImpl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Interpolation2D::templateImpl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
BicubicSpline::Impl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
BilinearInterpolation::Impl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
InterpolationImpl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
Interpolation::templateImpl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
InverseCumulativeNormal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
KnuthUniformRng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
KronrodIntegral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
LeastSquareProblem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
LecuyerUniformRng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
LexicographicalView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
Linear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
LineSearch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
ArmijoLineSearch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
LogLinear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
lowest_category_iterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
MakeSchedule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
McPricer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
McPricer< MultiAsset_old< PseudoRandomSequence_old > > . . . . . . . . . . . . . . . 438
McBasket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
McEverest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
McHimalaya . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
McMaxBasket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
McPagoda . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
McPricer< SingleAsset_old< PseudoRandom_old > > . . . . . . . . . . . . . . . . . . . . 438
McCliquetOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
McDiscreteArithmeticAPO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
McDiscreteArithmeticASO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
McPerformanceOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
McSimulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
McSimulation< MultiAsset< RNG >, S > . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
MCBasketEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
McSimulation< SingleAsset< RNG >, S > . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
MCBarrierEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
MCVanillaEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
MCDigitalEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
MCEuropeanEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
MersenneTwisterUniformRng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
MixedScheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
CrankNicolson . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


70 QuantLib Hierarchical Index

ExplicitEuler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
ImplicitEuler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
MonteCarloModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
MonteCarloModel< MultiAsset< RNG >, S > . . . . . . . . . . . . . . . . . . . . . . . . . 448
MonteCarloModel< MultiAsset_old< PseudoRandomSequence_old >, Statistics > . . . 448
MonteCarloModel< SingleAsset< RNG >, S > . . . . . . . . . . . . . . . . . . . . . . . . 448
MonteCarloModel< SingleAsset_old< PseudoRandom_old >, Statistics > . . . . . . . . 448
MoroInverseCumulativeNormal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
MultiPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
MultiPathGenerator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
MultiPathGenerator_old . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
NonLinearLeastSquare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
NormalDistribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
Null . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
NumericalMethod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
Lattice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
BlackScholesLattice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Lattice2D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
TwoFactorModel::ShortRateTree . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
OneFactorModel::ShortRateTree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
Observable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
AffineModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
G2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
OneFactorAffineModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
CoxIngersollRoss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
ExtendedCoxIngersollRoss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Vasicek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
HullWhite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
BlackModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
BlackVolTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
BlackVarianceTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
BlackVarianceCurve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
BlackVarianceSurface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
ImpliedVolTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
BlackVolatilityTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
BlackConstantVol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
CalibrationHelper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
CapFlatVolatilityStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
CapFlatVolatilityVector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
CapletForwardVolatilityStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
CashFlow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Coupon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
FixedRateCoupon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
FloatingRateCoupon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
IndexedCoupon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
InArrearIndexedCoupon . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
UpFrontIndexedCoupon . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
ParCoupon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
ShortFloatingRateCoupon . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
SimpleCashFlow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


5.1 QuantLib Class Hierarchy 71

Xibor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
AUDLibor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
CADLibor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
CHFLibor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Euribor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
GBPLibor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
JPYLibor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
USDLibor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
ZARLibor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
LazyObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Instrument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
CapFloor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Cap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Collar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Floor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
MultiAssetOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
BasketOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
OneAssetOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
OneAssetStrikedOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
BarrierOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
DiscreteAveragingAsianOption . . . . . . . . . . . . . . . . . . . . . . . . 255
VanillaOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
ForwardVanillaOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
QuantoVanillaOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
QuantoForwardVanillaOption . . . . . . . . . . . . . . . . . . . . . . . . . 524
Swaption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
Stock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
Swap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
SimpleSwap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
PiecewiseFlatForward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Link< TermStructure > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
LocalVolTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
LocalConstantVol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
LocalVolCurve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
LocalVolSurface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
PricingEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
GenericEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
BarrierEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
AnalyticBarrierEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
MCBarrierEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
BasketEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
MCAmericanBasketEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
MCBasketEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
StulzEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
CliquetEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
DiscreteAveragingAsianEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
AnalyticDiscreteAveragingAsianEngine . . . . . . . . . . . . . . . . . . . . . 122
GenericModelEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
AnalyticalCapFloor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
BlackCapFloor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


72 QuantLib Hierarchical Index

BlackSwaption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
JamshidianSwaption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
LatticeShortRateModelEngine< CapFloor::arguments, CapFloor::results > . 389
LatticeShortRateModelEngine< Swaption::arguments, Swaption::results > . 389
GenericModelEngine< AffineModel, CapFloor::arguments, CapFloor::results > 333
GenericModelEngine< BlackModel, CapFloor::arguments, CapFloor::results > 333
GenericModelEngine< BlackModel, Swaption::arguments, Swaption::results > 333
GenericModelEngine< OneFactorAffineModel, Swaption::arguments, Swap-
tion::results > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
GenericModelEngine< ShortRateModel, CapFloor::arguments, Cap-
Floor::results > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
GenericModelEngine< ShortRateModel, Swaption::arguments, Swap-
tion::results > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
VanillaEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
AnalyticDigitalAmericanEngine . . . . . . . . . . . . . . . . . . . . . . . . . 121
AnalyticEuropeanEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
BaroneAdesiWhaleyApproximationEngine . . . . . . . . . . . . . . . . . . . 133
BinomialVanillaEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
BjerksundStenslandApproximationEngine . . . . . . . . . . . . . . . . . . . 153
IntegralEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
MCVanillaEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
GenericEngine< Arguments, Results > . . . . . . . . . . . . . . . . . . . . . . . . . 332
GenericModelEngine< ShortRateModel, Arguments, Results > . . . . . . . . . 333
LatticeShortRateModelEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
TreeCapFloor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
TreeSwaption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
GenericEngine< BarrierOption::arguments, BarrierOption::results > . . . . . . . . 332
GenericEngine< BasketOption::arguments, BasketOption::results > . . . . . . . . 332
GenericEngine< CapFloor::arguments, CapFloor::results > . . . . . . . . . . . . . 332
GenericEngine< CliquetOption::arguments, VanillaOption::results > . . . . . . . 332
GenericEngine< DiscreteAveragingAsianOption::arguments, DiscreteAveraging-
AsianOption::results > . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
GenericEngine< ForwardOptionArguments< ArgumentsType >, ResultsType > . 332
ForwardEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
ForwardPerformanceEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
GenericEngine< QuantoOptionArguments< ArgumentsType >, QuantoOption-
Results< ResultsType > > . . . . . . . . . . . . . . . . . . . . . . . . . . 332
QuantoEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
GenericEngine< Swaption::arguments, Swaption::results > . . . . . . . . . . . . . 332
GenericEngine< VanillaOption::arguments, VanillaOption::results > . . . . . . . . 332
Quote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
CompositeQuote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
DerivedQuote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
SimpleQuote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
RateHelper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
DepositRateHelper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
FraRateHelper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
FuturesRateHelper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
SwapRateHelper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
ShortRateModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
OneFactorModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
BlackKarasinski . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
OneFactorAffineModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


5.1 QuantLib Class Hierarchy 73

TwoFactorModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
G2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
StochasticProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
SwaptionVolatilityStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
SwaptionVolatilityMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
TermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
DiscountStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
AffineTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
DiscountCurve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
ExtendedDiscountCurve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
ImpliedTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
ForwardRateStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
ForwardSpreadedTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . 313
PiecewiseFlatForward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
ZeroYieldStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
DriftTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
QuantoTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
ZeroCurve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
ZeroSpreadedTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
TermStructureConsistentModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
BlackKarasinski . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
ExtendedCoxIngersollRoss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
G2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
HullWhite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Observer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
AffineTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
BlackConstantVol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
BlackModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
BlackVarianceCurve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
BlackVarianceSurface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
CalibrationHelper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
CompositeQuote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
DerivedQuote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
DriftTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
ExtendedDiscountCurve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
ForwardSpreadedTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
GenericModelEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
GenericModelEngine< AffineModel, CapFloor::arguments, CapFloor::results > . . . 333
GenericModelEngine< BlackModel, CapFloor::arguments, CapFloor::results > . . . . 333
GenericModelEngine< BlackModel, Swaption::arguments, Swaption::results > . . . 333
GenericModelEngine< OneFactorAffineModel, Swaption::arguments, Swap-
tion::results > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
GenericModelEngine< ShortRateModel, Arguments, Results > . . . . . . . . . . . . . 333
GenericModelEngine< ShortRateModel, CapFloor::arguments, CapFloor::results > . 333
GenericModelEngine< ShortRateModel, Swaption::arguments, Swaption::results > . 333
ImpliedTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
ImpliedVolTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
IndexedCoupon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
LazyObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Link< TermStructure > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
LocalConstantVol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
LocalVolCurve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


74 QuantLib Hierarchical Index

LocalVolSurface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
ParCoupon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
QuantoTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
RateHelper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
ShortRateModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
StochasticProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
Xibor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
ZeroSpreadedTermStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
OneFactorModel::ShortRateDynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
OptimizationMethod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
ConjugateGradient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Simplex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
SteepestDescent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
OptionTypeFormatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
ParameterImpl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
PathGenerator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
PathGenerator_old . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
PathPricer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
PathPricer< MultiPath > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
PathPricer< Path > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
PathPricer_old . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Payoff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
TypePayoff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
StrikedTypePayoff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
AssetOrNothingPayoff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
CashOrNothingPayoff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
GapPayoff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
PercentageStrikePayoff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
PlainVanillaPayoff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
SuperSharePayoff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
PerformanceOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
Period . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
PoissonDistribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
PrimeNumbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
processing_iterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
QuantoOptionArguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
QuantoOptionResults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
RandomArrayGenerator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
RandomSequenceGenerator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
RateFormatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
Greeks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
MultiAssetOption::results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
OneAssetOption::results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
MoreGreeks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
OneAssetOption::results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
CapFloor::results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
MultiAssetOption::results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
OneAssetOption::results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


5.1 QuantLib Class Hierarchy 75

SimpleSwap::results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
Swaption::results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
SalvagingAlgorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
Schedule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
SegmentIntegral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
SequenceStatistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
SequenceStatistics< Statistics > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
DiscrepancyStatistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Short . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
SingleAssetOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
DiscreteGeometricAPO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
DiscreteGeometricASO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
EuropeanOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
ContinuousGeometricAPO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
FdDividendEuropeanOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
FdBsmOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
FdEuropean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
FdStepConditionOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
FdAmericanOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
SobolRsg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
StatsHolder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
StepCondition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570
AmericanCondition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
ShoutCondition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
StepCondition< Array > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570
stepping_iterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
StringFormatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
SVD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
SymmetricSchurDecomposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
TimeBasket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
TimeGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
TrapezoidIntegral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
SimpsonIntegral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
BinomialTree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
EqualJumpsBinomialTree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
CoxRossRubinstein . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Trigeorgis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
EqualProbabilitiesBinomialTree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
AdditiveEQPBinomialTree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
JarrowRudd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
LeisenReimer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Tian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
TrinomialTree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
TridiagonalOperator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
BSMOperator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
DMinus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
DPlus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
DPlusDMinus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
DZero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


76 QuantLib Hierarchical Index

OneFactorOperator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
TridiagonalOperator::TimeSetter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
TrinomialBranching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
TwoFactorModel::ShortRateDynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
Vasicek::Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
Visitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
Visitor< BlackConstantVol > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
Visitor< BlackVarianceCurve > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
Visitor< BlackVolTermStructure > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
Visitor< CashFlow > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
BPSBasketCalculator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
BPSCalculator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Visitor< Coupon > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
BPSBasketCalculator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
BPSCalculator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Visitor< FixedRateCoupon > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
BPSBasketCalculator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
XiborManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


Chapter 6

QuantLib Class Index

6.1 QuantLib Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
Actual360 (Actual/360 day count convention ) . . . . . . . . . . . . . . . . . . . . . . . . 107
Actual365 (Actual/365 day count convention ) . . . . . . . . . . . . . . . . . . . . . . . . 108
ActualActual (Actual/Actual day count ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
AcyclicVisitor (Degenerate base class for the Acyclic Visitor pattern ) . . . . . . . . . . . 110
AdditiveEQPBinomialTree (Additive equal probabilities binomial tree ) . . . . . . . . . 111
AffineModel (Affine model class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
AffineTermStructure (Term-structure implied by an affine model ) . . . . . . . . . . . . 113
AmericanCondition (American exercise condition ) . . . . . . . . . . . . . . . . . . . . . 115
AmericanExercise (American exercise ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
AmericanPayoffAtExpiry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
AmericanPayoffAtHit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
AnalyticalCapFloor (Analytical pricer for cap/floor ) . . . . . . . . . . . . . . . . . . . . . 119
AnalyticBarrierEngine (Pricing engine for barrier options using analytical formulae ) . 120
AnalyticDigitalAmericanEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
AnalyticDiscreteAveragingAsianEngine (Pricing engine for European discrete geomet-
ric average Asian option ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
AnalyticEuropeanEngine (Pricing engine for European vanilla options using analytical
formulae ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Arguments (Base class for generic argument groups ) . . . . . . . . . . . . . . . . . . . . 124
ArmijoLineSearch (Armijo line search ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Array (1-D array used in linear algebra ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
ArrayFormatter (Formats arrays for output ) . . . . . . . . . . . . . . . . . . . . . . . . . 128
AssertionFailedError (Specialized error ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
AssetOrNothingPayoff (Binary asset-or-nothing payoff ) . . . . . . . . . . . . . . . . . . 130
AUDLibor (AUD Libor index, also known as SIBOR ) . . . . . . . . . . . . . . . . . . . . 131
Average (Placeholder for enumerated averaging types ) . . . . . . . . . . . . . . . . . . . 132
BaroneAdesiWhaleyApproximationEngine . . . . . . . . . . . . . . . . . . . . . . . . . 133
Barrier (Placeholder for enumerated barrier types ) . . . . . . . . . . . . . . . . . . . . . 134
BarrierEngine (Barrier engine base class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
BarrierOption (Barrier option on a single asset ) . . . . . . . . . . . . . . . . . . . . . . . 136
BarrierOption::arguments (Arguments for barrier option calculation ) . . . . . . . . . . 138
BasketEngine (Basket option engine base class ) . . . . . . . . . . . . . . . . . . . . . . . 139
BasketOption (Basket option on a number of assets ) . . . . . . . . . . . . . . . . . . . . 140
78 QuantLib Class Index

BasketOption::arguments (Arguments for basket option calculation ) . . . . . . . . . . . 142


BermudanExercise (Bermudan exercise ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
BicubicSpline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
BicubicSpline::Impl (Bicubic spline implementation ) . . . . . . . . . . . . . . . . . . . . 145
BilinearInterpolation (Bilinear interpolation between discrete points ) . . . . . . . . . . 146
BilinearInterpolation::Impl (Bilinear interpolation implementation ) . . . . . . . . . . . 147
BinomialDistribution (Binomial probability distribution function ) . . . . . . . . . . . . 148
BinomialTree (Binomial tree base class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
BinomialVanillaEngine (Pricing engine for vanilla options using binomial trees ) . . . . 150
Bisection (Bisection 1-D solver ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
BivariateCumulativeNormalDistribution (Cumulative bivariate normal distribution
function ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
BjerksundStenslandApproximationEngine . . . . . . . . . . . . . . . . . . . . . . . . . 153
BlackCapFloor (Cap/floor priced by means of the Black formula ) . . . . . . . . . . . . . 154
BlackConstantVol (Constant Black volatility, no time-strike dependence ) . . . . . . . . 155
BlackKarasinski (Standard Black-Karasinski model class ) . . . . . . . . . . . . . . . . . 157
BlackKarasinski::Dynamics (Short-rate dynamics in the Black-Karasinski model ) . . . 158
BlackModel (Black-model for vanilla interest-rate derivatives ) . . . . . . . . . . . . . . 159
BlackScholesLattice (Simple binomial lattice approximating the Black-Scholes model ) . 161
BlackScholesProcess (Black-Scholes diffusion process class ) . . . . . . . . . . . . . . . . 162
BlackSwaption (Swaption priced by means of the Black formula ) . . . . . . . . . . . . . 163
BlackVarianceCurve (Black volatility curve modelled as variance curve ) . . . . . . . . . 164
BlackVarianceSurface (Black volatility surface modelled as variance surface ) . . . . . . 166
BlackVarianceTermStructure (Black variance term structure ) . . . . . . . . . . . . . . . 168
BlackVolatilityTermStructure (Black-volatility term structure ) . . . . . . . . . . . . . . 169
BlackVolTermStructure (Black-volatility term structure ) . . . . . . . . . . . . . . . . . . 170
BoundaryCondition (Abstract boundary condition class for finite difference problems ) 172
BoundaryConstraint (Constraint imposing all arguments to be in [low,high] ) . . . . . . 174
BoxMullerGaussianRng (Gaussian random number generator ) . . . . . . . . . . . . . . 175
BPSBasketCalculator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
BPSCalculator (Basis point sensitivity (BPS) calculator ) . . . . . . . . . . . . . . . . . . . 177
Brent (Brent 1-D solver ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Bridge (The Bridge pattern made explicit ) . . . . . . . . . . . . . . . . . . . . . . . . . . 179
BrownianBridge (Builds Wiener process paths using Gaussian variates ) . . . . . . . . . 180
BSMOperator (Black-Scholes-Merton differential operator ) . . . . . . . . . . . . . . . . 181
Budapest (Budapest calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
CADLibor (CAD Libor index, also known as CDOR ) . . . . . . . . . . . . . . . . . . . . 183
Calendar (calendar class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Calendar::WesternImpl (Partial calendar implementation ) . . . . . . . . . . . . . . . . . 187
CalendarImpl (Abstract base class for calendar implementations ) . . . . . . . . . . . . . 188
CalibrationHelper (Liquid market instrument used during calibration ) . . . . . . . . . 189
CalibrationSet (Set of calibration instruments ) . . . . . . . . . . . . . . . . . . . . . . . . 191
Cap (Concrete cap class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
CapFlatVolatilityStructure (Cap/floor flat volatility structure ) . . . . . . . . . . . . . . . 193
CapFlatVolatilityVector (Cap/floor at-the-money flat volatility vector ) . . . . . . . . . . 194
CapFloor (Base class for cap-like instruments ) . . . . . . . . . . . . . . . . . . . . . . . . 195
CapFloor::arguments (Arguments for cap/floor calculation ) . . . . . . . . . . . . . . . . 197
CapFloor::results (Results from cap/floor calculation ) . . . . . . . . . . . . . . . . . . . . 198
CapletForwardVolatilityStructure (Caplet/floorlet forward volatility structure ) . . . . . 199
CashFlow (Base class for cash flows ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
CashOrNothingPayoff (Binary cash-or-nothing payoff ) . . . . . . . . . . . . . . . . . . . 201
CHFLibor (CHF Libor index, also known as ZIBOR ) . . . . . . . . . . . . . . . . . . . . 202
CLGaussianRng (Gaussian random number generator ) . . . . . . . . . . . . . . . . . . 203
CliquetEngine (Cliquet engine base class ) . . . . . . . . . . . . . . . . . . . . . . . . . . 204

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


6.1 QuantLib Class List 79

CliquetOption::arguments (Arguments for cliquet option calculation ) . . . . . . . . . . 205


CliquetOptionPricer (Cliquet (Ratchet) option ) . . . . . . . . . . . . . . . . . . . . . . . 206
Collar (Concrete collar class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
combining_iterator (Iterator mapping a function to a set of underlying sequences ) . . . 208
Composite (Composite pattern ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
CompositeConstraint (Constraint enforcing both given sub-constraints ) . . . . . . . . . 211
CompositeQuote (Market element whose value depends on two other market element ) 212
ConjugateGradient (Multi-dimensional Conjugate Gradient class ) . . . . . . . . . . . . 213
ConstantParameter (Standard constant parameter a(t) = a ) . . . . . . . . . . . . . . . . . 214
Constraint (Base constraint class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
ConstraintImpl (Base class for constraint implementations ) . . . . . . . . . . . . . . . . 216
ContinuousGeometricAPO (Continuous geometric average-price option (European ex-
ercise) ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Copenhagen (Copenhagen calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
CostFunction (Cost function abstract class for optimization problem ) . . . . . . . . . . . 219
coupling_iterator (Iterator mapping a function to a pair of underlying sequences ) . . . 220
Coupon (coupon accruing over a fixed period ) . . . . . . . . . . . . . . . . . . . . . . . . 222
CoxIngersollRoss (Cox-Ingersoll-Ross model class ) . . . . . . . . . . . . . . . . . . . . . 224
CoxIngersollRoss::Dynamics (Dynamics of the short-rate under the Cox-Ingersoll-Ross
model ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
CoxRossRubinstein (Cox-Ross-Rubinstein (multiplicative) equal jumps binomial tree ) 227
CrankNicolson (Crank-Nicolson scheme for finite difference methods ) . . . . . . . . . . 228
Cubic (Cubic-spline interpolation traits ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
CubicSpline (Cubic spline interpolation between discrete points ) . . . . . . . . . . . . . 230
CumulativeBinomialDistribution (Cumulative binomial distribution function ) . . . . 232
CumulativeNormalDistribution (Cumulative normal distribution function ) . . . . . . 233
CumulativePoissonDistribution (Cumulative Poisson distribution function ) . . . . . . 234
CuriouslyRecurringTemplate (Support for the curiously recurring template pattern ) . 235
CurrencyFormatter (Formats currencies for output ) . . . . . . . . . . . . . . . . . . . . . 236
Date (Concrete date class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
DateFormatter (Formats dates for output ) . . . . . . . . . . . . . . . . . . . . . . . . . . 239
DayCounter (Day counter class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
DayCounterImpl (Abstract base class for day counter implementations ) . . . . . . . . . 242
DepositRateHelper (Deposit rate ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
DerivedQuote (Market element whose value depends on another market element ) . . . 245
DiffusionProcess (Diffusion process class ) . . . . . . . . . . . . . . . . . . . . . . . . . . 246
DirichletBC (Neumann boundary condition (i.e., constant value) ) . . . . . . . . . . . . 248
DiscountCurve (Term structure based on loglinear interpolation of discount factors ) . . 249
DiscountStructure (Discount factor term structure ) . . . . . . . . . . . . . . . . . . . . . 251
DiscrepancyStatistics (Statistic tool for sequences with discrepancy calculation ) . . . . 253
DiscreteAveragingAsianEngine (Discrete averaging asian engine base class ) . . . . . . 254
DiscreteAveragingAsianOption (Asian option ) . . . . . . . . . . . . . . . . . . . . . . . 255
DiscreteAveragingAsianOption::arguments (Extra arguments for single asset asian op-
tion calculation ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
DiscreteGeometricAPO (Discrete geometric average-price Asian option (European
style) ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
DiscreteGeometricASO (Discrete geometric average-strike Asian option (European
style) ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
DiscretizedAsset (Discretized asset class used by numerical methods ) . . . . . . . . . . 260
DiscretizedDiscountBond (Useful discretized discount bond asset ) . . . . . . . . . . . 262
DiscretizedOption (Discretized option on another asset ) . . . . . . . . . . . . . . . . . . 263
Disposable (Generic disposable object with move semantics ) . . . . . . . . . . . . . . . 264
DMinus (D− matricial representation ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
DoubleFormatter (Formats doubles for output ) . . . . . . . . . . . . . . . . . . . . . . . 266

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


80 QuantLib Class Index

DPlus (D+ matricial representation ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267


DPlusDMinus (D+ D− matricial representation ) . . . . . . . . . . . . . . . . . . . . . . . 268
DriftTermStructure (Drift term structure ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
DZero (D0 matricial representation ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
EarlyExercise (Early-exercise base class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
EndCriteria (Criteria to end optimization process ) . . . . . . . . . . . . . . . . . . . . . . 273
EqualJumpsBinomialTree (Base class for equal jumps binomial tree ) . . . . . . . . . . . 275
EqualProbabilitiesBinomialTree (Base class for equal probabilities binomial tree ) . . . 276
Error (Base error class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
ErrorFunction (Error function ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Euribor (Euribor index ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
EuroFormatter (Formats amounts in Euro for output ) . . . . . . . . . . . . . . . . . . . . 280
EuropeanExercise (European exercise ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
EuropeanOption (Black-Scholes-Merton European option ) . . . . . . . . . . . . . . . . . 282
Exercise (Base exercise class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
ExplicitEuler (Forward Euler scheme for finite difference methods ) . . . . . . . . . . . . 284
ExtendedCoxIngersollRoss (Extended Cox-Ingersoll-Ross model class ) . . . . . . . . . 285
ExtendedCoxIngersollRoss::Dynamics (Short-rate dynamics in the extended Cox-
Ingersoll-Ross model ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
ExtendedCoxIngersollRoss::FittingParameter (Analytical term-structure fitting param-
eter ϕ(t) ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
ExtendedDiscountCurve (Term structure based on loglinear interpolation of discount
factors ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Factorial (Factorial numbers calculator ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
FalsePosition (False position 1-D solver ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
FdAmericanOption (American option ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
FdBermudanOption (Bermudan option ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
FdBsmOption (Black-Scholes-Merton option priced numerically ) . . . . . . . . . . . . . 294
FdDividendAmericanOption (American option with discrete dividends ) . . . . . . . . 296
FdDividendEuropeanOption (European option with dividends ) . . . . . . . . . . . . . 297
FdDividendShoutOption (Shout option with dividends ) . . . . . . . . . . . . . . . . . . 298
FdEuropean (Example of European option calculated using finite differences ) . . . . . . 299
FdStepConditionOption (option executing additional code at each time step ) . . . . . 300
filtering_iterator (Iterator filtering undesired data ) . . . . . . . . . . . . . . . . . . . . . 301
FiniteDifferenceModel (Generic finite difference model ) . . . . . . . . . . . . . . . . . . 302
FixedRateCoupon (Coupon paying a fixed interest rate ) . . . . . . . . . . . . . . . . . . 303
FloatingRateCoupon (Coupon at par on a term structure ) . . . . . . . . . . . . . . . . . 305
Floor (Concrete floor class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
ForwardEngine (Forward engine base class ) . . . . . . . . . . . . . . . . . . . . . . . . . 308
ForwardOptionArguments (Arguments for forward (strike-resetting) option calculation )309
ForwardPerformanceEngine (Forward performance engine ) . . . . . . . . . . . . . . . . 310
ForwardRateStructure (Forward rate term structure ) . . . . . . . . . . . . . . . . . . . . 311
ForwardSpreadedTermStructure (Term structure with added spread on the instanta-
neous forward rate ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
ForwardVanillaOption (Forward version of a vanilla option ) . . . . . . . . . . . . . . . 315
Frankfurt (Frankfurt calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
FraRateHelper (Forward rate agreement ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
FuturesRateHelper (Interest-rate futures ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
G2 (Two-additive-factor gaussian model class ) . . . . . . . . . . . . . . . . . . . . . . . . 321
G2::FittingParameter (Analytical term-structure fitting parameter ϕ(t) ) . . . . . . . . . 323
GammaFunction (Gamma function class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
GapPayoff (Binary gap payoff ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
GaussianStatistics (Statistics tool for gaussian-assumption risk measures ) . . . . . . . . 326
GBPLibor (GBP Libor index ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


6.1 QuantLib Class List 81

GeneralStatistics (Statistics tool ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329


GenericEngine (Template base class for option pricing engines ) . . . . . . . . . . . . . . 332
GenericModelEngine (Base class for some pricing engine on a particular model ) . . . . 333
GenericRiskStatistics (Empirical-distribution risk measures ) . . . . . . . . . . . . . . . 334
Greeks (Additional option results ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
HaltonRsg (Halton low-discrepancy sequence generator ) . . . . . . . . . . . . . . . . . 338
Handle (Reference-counted pointer ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Helsinki (Helsinki calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
History (Container for historical data ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
History::const_iterator (Random access iterator on history entries ) . . . . . . . . . . . . 345
History::Entry (Single datum in history ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
HullWhite (Single-factor Hull-White (extended Vasicek) model class ) . . . . . . . . . . 347
HullWhite::Dynamics (Short-rate dynamics in the Hull-White model ) . . . . . . . . . . 348
HullWhite::FittingParameter (Analytical term-structure fitting parameter ϕ(t) ) . . . . . 349
ICGaussianRng (Inverse cumulative Gaussian random number generator ) . . . . . . . 350
ICGaussianRsg (Inverse cumulative Gaussian random sequence generator ) . . . . . . . 351
IllegalArgumentError (Specialized error ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
IllegalResultError (Specialized error ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
ImplicitEuler (Backward Euler scheme for finite difference methods ) . . . . . . . . . . . 354
ImpliedTermStructure (Implied term structure at a given date in the future ) . . . . . . 355
ImpliedVolTermStructure (Implied vol term structure at a given date in the future ) . . 357
InArrearIndexedCoupon (In-arrear indexed coupon class ) . . . . . . . . . . . . . . . . . 359
IncrementalStatistics (Statistics tool based on incremental accumulation ) . . . . . . . . 360
Index (Purely virtual base class for indexes ) . . . . . . . . . . . . . . . . . . . . . . . . . 363
IndexedCoupon (Base indexed coupon class ) . . . . . . . . . . . . . . . . . . . . . . . . 364
IndexError (Specialized error ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Instrument (Abstract instrument class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
IntegerFormatter (Formats integers for output ) . . . . . . . . . . . . . . . . . . . . . . . 370
IntegralEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Interpolation (Base class for 1-D interpolations ) . . . . . . . . . . . . . . . . . . . . . . . 372
Interpolation2D (Base class for 2-D interpolations ) . . . . . . . . . . . . . . . . . . . . . 373
Interpolation2D::templateImpl (Basic template implementation ) . . . . . . . . . . . . . 374
Interpolation2DImpl (Abstract base class for 2-D interpolation implementations ) . . . 375
Interpolation::templateImpl (Basic template implementation ) . . . . . . . . . . . . . . . 376
InterpolationImpl (Abstract base class for interpolation implementations ) . . . . . . . . 377
InverseCumulativeNormal (Inverse cumulative normal distribution function ) . . . . . 378
JamshidianSwaption (Jamshidian swaption pricer ) . . . . . . . . . . . . . . . . . . . . . 379
JarrowRudd (Jarrow-Rudd (multiplicative) equal probabilities binomial tree ) . . . . . . 380
Johannesburg (Johannesburg calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
JointCalendar (Joint calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
JPYLibor (JPY Libor index, also known as TIBOR ) . . . . . . . . . . . . . . . . . . . . . . 383
KnuthUniformRng (Uniform random number generator ) . . . . . . . . . . . . . . . . . 384
KronrodIntegral (Integral of a 1-dimensional function using the Gauss-Kronrod method )385
Lattice (Lattice-method base class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Lattice2D (Two-dimensional lattice ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
LatticeShortRateModelEngine (Engine for a short-rate model specialized on a lattice ) . 389
LazyObject (Framework for calculation on demand and result caching ) . . . . . . . . . 391
LeastSquareFunction (Cost function for least-square problems ) . . . . . . . . . . . . . . 394
LeastSquareProblem (Base class for least square problem ) . . . . . . . . . . . . . . . . . 395
LecuyerUniformRng (Uniform random number generator ) . . . . . . . . . . . . . . . . 396
LeisenReimer (Leisen & Reimer tree: multiplicative approach ) . . . . . . . . . . . . . . 397
LexicographicalView (Lexicographical 2-D view of a contiguous set of data ) . . . . . . 398
Linear (Linear interpolation traits ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
LinearInterpolation (Linear interpolation between discrete points ) . . . . . . . . . . . . 401

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


82 QuantLib Class Index

LineSearch (Base class for line search ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402


Link (Relinkable access to a Handle ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
LocalConstantVol (Constant local volatility, no time-strike dependence ) . . . . . . . . . 406
LocalVolCurve (Local volatility curve derived from a Black curve ) . . . . . . . . . . . . 408
LocalVolSurface (Local volatility surface derived from a Black vol surface ) . . . . . . . 410
LocalVolTermStructure (Local-volatility term structure ) . . . . . . . . . . . . . . . . . . 412
LogLinear (Log-linear interpolation traits ) . . . . . . . . . . . . . . . . . . . . . . . . . . 413
LogLinearInterpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
London (London calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
lowest_category_iterator (Most generic of two given iterator categories ) . . . . . . . . . 416
MakeSchedule (Helper class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Matrix (Matrix used in linear algebra ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
MCAmericanBasketEngine (Least-square Monte Carlo engine ) . . . . . . . . . . . . . . 422
MCBarrierEngine (Pricing engine for barrier options using Monte Carlo ) . . . . . . . . 423
McBasket (Simple example of multi-factor Monte Carlo pricer ) . . . . . . . . . . . . . . 425
MCBasketEngine (MC Pricing engine for European Baskets ) . . . . . . . . . . . . . . . 426
McCliquetOption (Simple example of Monte Carlo pricer ) . . . . . . . . . . . . . . . . . 428
MCDigitalEngine (Pricing engine for digital options using Monte Carlo simulation ) . . 429
McDiscreteArithmeticAPO (Example of Monte Carlo pricer using a control variate ) . . 430
McDiscreteArithmeticASO (Example of Monte Carlo pricer using a control variate ) . . 431
MCEuropeanEngine (European option pricing engine using Monte Carlo simulation ) . 432
McEverest (Everest-type option pricer ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
McHimalaya (Himalayan-type option pricer ) . . . . . . . . . . . . . . . . . . . . . . . . 434
McMaxBasket (Simple example of multi-factor Monte Carlo pricer ) . . . . . . . . . . . 435
McPagoda (Roofed Asian option ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
McPerformanceOption (Performance option computed using Monte Carlo simulation ) 437
McPricer (Base class for Monte Carlo pricers ) . . . . . . . . . . . . . . . . . . . . . . . . . 438
McSimulation (Base class for Monte Carlo engines ) . . . . . . . . . . . . . . . . . . . . . 439
MCVanillaEngine (Pricing engine for vanilla option using Monte Carlo simulation ) . . 441
MersenneTwisterUniformRng (Uniform random number generator ) . . . . . . . . . . 443
Milan (Milan calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
MixedScheme (Mixed (explicit/implicit) scheme for finite difference methods ) . . . . . 445
MonotonicCubicSpline (Cubic spline with monotonicity constraint ) . . . . . . . . . . . 447
MonteCarloModel (General purpose Monte Carlo model for path samples ) . . . . . . . 448
MoreGreeks (More additional option results ) . . . . . . . . . . . . . . . . . . . . . . . . 449
MoroInverseCumulativeNormal (Moro Inverse cumulative normal distribution class ) 450
MultiAssetOption (Base class for options on multiple assets ) . . . . . . . . . . . . . . . 451
MultiAssetOption::arguments (Arguments for multi-asset option calculation ) . . . . . 453
MultiAssetOption::results (Results from multi-asset option calculation ) . . . . . . . . . 454
MultiPath (Multiple random walk ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
MultiPathGenerator (Generates a multipath from a random number generator ) . . . . 456
MultiPathGenerator_old (Generates a multipath from a random number generator ) . . 457
NaturalCubicSpline (Cubic spline with null second derivative at end points ) . . . . . . 458
NaturalMonotonicCubicSpline (Natural cubic spline with monotonicity constraint ) . . 459
NeumannBC (Neumann boundary condition (i.e., constant derivative) ) . . . . . . . . . 460
Newton (Newton 1-D solver ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
NewtonSafe (Safe Newton 1-D solver ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
NewYork (New York calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
NoConstraint (No constraint ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
NonLinearLeastSquare (Non-linear least-square method ) . . . . . . . . . . . . . . . . . 465
NormalDistribution (Normal distribution function ) . . . . . . . . . . . . . . . . . . . . 466
Null (Template class providing a null value for a given type ) . . . . . . . . . . . . . . . 467
NullCalendar (Calendar for reproducing theoretical calculations ) . . . . . . . . . . . . . 468
NullParameter (Parameter which is always zero a(t) = 0 ) . . . . . . . . . . . . . . . . . . 469

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


6.1 QuantLib Class List 83

NumericalMethod (Numerical method (tree, finite-differences) base class ) . . . . . . . 470


Observable (Object that notifies its changes to a set of observables ) . . . . . . . . . . . . 471
Observer (Object that gets notified when a given observable changes ) . . . . . . . . . . 473
OneAssetOption (Base class for options on a single asset ) . . . . . . . . . . . . . . . . . 476
OneAssetOption::arguments (Arguments for single-asset option calculation ) . . . . . . 479
OneAssetOption::results (Results from single-asset option calculation ) . . . . . . . . . 480
OneAssetStrikedOption (Base class for options on a single asset with striked payoff ) . 481
OneFactorAffineModel (Single-factor affine base class ) . . . . . . . . . . . . . . . . . . . 483
OneFactorModel (Single-factor short-rate model abstract class ) . . . . . . . . . . . . . . 484
OneFactorModel::ShortRateDynamics (Base class describing the short-rate dynamics ) 485
OneFactorModel::ShortRateTree (Recombining trinomial tree discretizing the state vari-
able ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
OneFactorOperator (Interest-rate single factor model differential operator ) . . . . . . . 487
OptimizationMethod (Abstract class for constrained optimization method ) . . . . . . . 488
Option (Base option class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
Option::arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
OptionTypeFormatter (Formats option type for output ) . . . . . . . . . . . . . . . . . . 492
OrnsteinUhlenbeckProcess (Ornstein-Uhlenbeck process class ) . . . . . . . . . . . . . . 493
Oslo (Oslo calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
OutOfMemoryError (Specialized error ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
Parameter (Base class for model arguments ) . . . . . . . . . . . . . . . . . . . . . . . . . 497
ParameterImpl (Base class for model parameter implementation ) . . . . . . . . . . . . . 498
ParCoupon (coupon at par on a term structure ) . . . . . . . . . . . . . . . . . . . . . . . 499
Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
PathGenerator (Generates random paths using a sequence generator ) . . . . . . . . . . 502
PathGenerator_old (Generates random paths from a random number generator ) . . . . 503
PathPricer (Base class for path pricers ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
PathPricer_old (Base class for path pricers ) . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Payoff (Base class for option payoffs ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
PercentageStrikePayoff (Payoff with strike expressed as percentage ) . . . . . . . . . . . 507
PerformanceOption (Performance option ) . . . . . . . . . . . . . . . . . . . . . . . . . . 508
Period (Time period described by a number of a given time unit ) . . . . . . . . . . . . . 509
PiecewiseConstantParameter (Piecewise-constant parameter ) . . . . . . . . . . . . . . . 510
PiecewiseFlatForward (Piecewise flat forward term structure ) . . . . . . . . . . . . . . . 511
PlainVanillaPayoff (Plain-vanilla payoff ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
PoissonDistribution (Normal distribution function ) . . . . . . . . . . . . . . . . . . . . 514
PositiveConstraint (Constraint imposing positivity to all arguments ) . . . . . . . . . . . 515
PostconditionNotSatisfiedError (Specialized error ) . . . . . . . . . . . . . . . . . . . . . 516
PreconditionNotSatisfiedError (Specialized error ) . . . . . . . . . . . . . . . . . . . . . 517
PricingEngine (Interface for pricing engines ) . . . . . . . . . . . . . . . . . . . . . . . . . 518
PrimeNumbers (Prime numbers calculator ) . . . . . . . . . . . . . . . . . . . . . . . . . 519
Problem (Constrained optimization problem ) . . . . . . . . . . . . . . . . . . . . . . . . 520
processing_iterator (Iterator mapping a unary function to an underlying sequence ) . . 521
QuantoEngine (Quanto engine base class ) . . . . . . . . . . . . . . . . . . . . . . . . . . 523
QuantoForwardVanillaOption (Quanto version of a forward vanilla option ) . . . . . . 524
QuantoOptionArguments (Arguments for quanto option calculation ) . . . . . . . . . . 526
QuantoOptionResults (Results from quanto option calculation ) . . . . . . . . . . . . . . 527
QuantoTermStructure (Quanto term structure ) . . . . . . . . . . . . . . . . . . . . . . . 528
QuantoVanillaOption (Quanto version of a vanilla option ) . . . . . . . . . . . . . . . . 530
Quote (Purely virtual base class for market observables ) . . . . . . . . . . . . . . . . . . 532
RandomArrayGenerator (Generates random arrays using a random number generator ) 533
RandomSequenceGenerator (Random sequence generator based on a pseudo-random
number generator ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
RateFormatter (Formats rates for output ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 535

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


84 QuantLib Class Index

RateHelper (Base class for rate helpers ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536


RelinkableHandle (Globally accessible relinkable pointer ) . . . . . . . . . . . . . . . . . 538
Results (Base class for generic result groups ) . . . . . . . . . . . . . . . . . . . . . . . . . 539
Ridder (Ridder 1-D solver ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
SalvagingAlgorithm (Algorithm used for matricial pseudo square root ) . . . . . . . . . 541
Sample (Weighted sample ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
Schedule (Payment schedule ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
Secant (Secant 1-D solver ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
SegmentIntegral (Integral of a one-dimensional function ) . . . . . . . . . . . . . . . . . 545
SequenceStatistics (Statistics analysis of N-dimensional (sequence) data ) . . . . . . . . 546
Short (Short indexed coupon ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
ShortFloatingRateCoupon (Short coupon at par on a term structure ) . . . . . . . . . . . 549
ShortRateModel (Abstract short-rate model class ) . . . . . . . . . . . . . . . . . . . . . . 550
ShoutCondition (Shout option condition ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
SimpleCashFlow (Predetermined cash flow ) . . . . . . . . . . . . . . . . . . . . . . . . . 553
SimpleDayCounter (Simple day counter for reproducing theoretical calculations ) . . . 554
SimpleQuote (Market element returning a stored value ) . . . . . . . . . . . . . . . . . . 555
SimpleSwap (Simple fixed-rate vs Libor swap ) . . . . . . . . . . . . . . . . . . . . . . . 556
SimpleSwap::arguments (Arguments for simple swap calculation ) . . . . . . . . . . . . 558
SimpleSwap::results (Results from simple swap calculation ) . . . . . . . . . . . . . . . 559
Simplex (Multi-dimensional simplex class ) . . . . . . . . . . . . . . . . . . . . . . . . . . 560
SimpsonIntegral (Integral of a one-dimensional function ) . . . . . . . . . . . . . . . . . 561
SingleAssetOption (Black-Scholes-Merton option ) . . . . . . . . . . . . . . . . . . . . . 562
SobolRsg (Sobol low-discrepancy sequence generator ) . . . . . . . . . . . . . . . . . . . 564
Solver1D (Base class for 1-D solvers ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
SquareRootProcess (Square-root process class ) . . . . . . . . . . . . . . . . . . . . . . . . 567
StatsHolder (Helper class for precomputed distributions ) . . . . . . . . . . . . . . . . . 568
SteepestDescent (Multi-dimensional steepest-descent class ) . . . . . . . . . . . . . . . . 569
StepCondition (Condition to be applied at every time step ) . . . . . . . . . . . . . . . . 570
stepping_iterator (Iterator advancing in constant steps ) . . . . . . . . . . . . . . . . . . 571
StochasticProcess (Base stochastic process class ) . . . . . . . . . . . . . . . . . . . . . . . 573
Stock (Simple stock class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
Stockholm (Stockholm calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
StrikedTypePayoff (Intermediate class for payoffs based on a fixed strike ) . . . . . . . . 576
StringFormatter (Formats strings as lower- or uppercase ) . . . . . . . . . . . . . . . . . 577
StulzEngine (Pricing engine for 2D European Baskets ) . . . . . . . . . . . . . . . . . . . 578
SuperSharePayoff (Binary supershare payoff ) . . . . . . . . . . . . . . . . . . . . . . . . 579
SVD (Singular value decomposition ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
Swap (Interest rate swap ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
SwapRateHelper (Swap rate ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
Swaption (Swaption class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
Swaption::arguments (Arguments for swaption calculation ) . . . . . . . . . . . . . . . . 587
Swaption::results (Results from swaption calculation ) . . . . . . . . . . . . . . . . . . . 588
SwaptionVolatilityMatrix (At-the-money swaption-volatility matrix ) . . . . . . . . . . 589
SwaptionVolatilityStructure (Swaption-volatility structure ) . . . . . . . . . . . . . . . . 590
Sydney (Sydney calendar (New South Wales, Australia) ) . . . . . . . . . . . . . . . . . . 591
SymmetricSchurDecomposition (Symmetric threshold Jacobi algorithm ) . . . . . . . . 592
TARGET (TARGET calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
TermStructure (Interest-rate term structure ) . . . . . . . . . . . . . . . . . . . . . . . . . 594
TermStructureConsistentModel (Term-structure consistent model class ) . . . . . . . . 596
TermStructureFittingParameter (Deterministic time-dependent parameter used for
yield-curve fitting ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
Thirty360 (30/360 day count convention ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
Tian (Tian tree: third moment matching, multiplicative approach ) . . . . . . . . . . . . 599

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


6.1 QuantLib Class List 85

TimeBasket (Distribution over a number of dates ) . . . . . . . . . . . . . . . . . . . . . . 600


TimeGrid (Time grid class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
Tokyo (Tokyo calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
Toronto (Toronto calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
TrapezoidIntegral (Integral of a one-dimensional function ) . . . . . . . . . . . . . . . . 605
Tree (Tree approximating a single-factor diffusion ) . . . . . . . . . . . . . . . . . . . . . . 607
TreeCapFloor (Cap/floor priced on a lattice ) . . . . . . . . . . . . . . . . . . . . . . . . . 608
TreeSwaption (Swaption priced on a lattice ) . . . . . . . . . . . . . . . . . . . . . . . . . 609
TridiagonalOperator (Base implementation for tridiagonal operator ) . . . . . . . . . . . 610
TridiagonalOperator::TimeSetter (Encapsulation of time-setting logic ) . . . . . . . . . . 612
Trigeorgis (Trigeorgis (additive equal jumps) binomial tree ) . . . . . . . . . . . . . . . . 613
TrinomialBranching (Branching scheme for a trinomial node ) . . . . . . . . . . . . . . . 614
TrinomialTree (Recombining trinomial tree class ) . . . . . . . . . . . . . . . . . . . . . . 615
TwoFactorModel (Abstract base-class for two-factor models ) . . . . . . . . . . . . . . . 616
TwoFactorModel::ShortRateDynamics (Class describing the dynamics of the two state
variables ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
TwoFactorModel::ShortRateTree (Recombining two-dimensional tree discretizing the
state variable ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
TypePayoff (Intermediate class for call/put/straddle payoffs ) . . . . . . . . . . . . . . . . 619
UpFrontIndexedCoupon (up front indexed coupon class ) . . . . . . . . . . . . . . . . . 620
USDLibor (USD Libor index ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
Value (Pricing results ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
VanillaEngine (Vanilla option engine base class ) . . . . . . . . . . . . . . . . . . . . . . . 623
VanillaOption (Vanilla option (no discrete dividends, no barriers) on a single asset ) . . 624
Vasicek (Vasicek model class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
Vasicek::Dynamics (Short-rate dynamics in the Vasicek model ) . . . . . . . . . . . . . . 627
Visitor (Visitor for a specific class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
Warsaw (Warsaw calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
Wellington (Wellington calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
Xibor (Base class for libor indexes ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
XiborManager (Global repository for libor histories ) . . . . . . . . . . . . . . . . . . . . 633
ZARLibor (ZAR Libor index, also known as JIBAR ) . . . . . . . . . . . . . . . . . . . . . 634
ZeroCurve (Term structure based on linear interpolation of zero yields ) . . . . . . . . . 635
ZeroSpreadedTermStructure (Term structure with an added spread on the zero yield
rate ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
ZeroYieldStructure (Zero yield term structure ) . . . . . . . . . . . . . . . . . . . . . . . . 638
Zurich (Zurich calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


86 QuantLib Class Index

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


Chapter 7

QuantLib File Index

7.1 QuantLib File List

Here is a list of all documented files with brief descriptions:


ql/argsandresults.hpp (Base classes for generic arguments and results ) . . . . . . . . . . 641
ql/calendar.hpp (calendar class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
ql/capvolstructures.hpp (Cap/Floor volatility structures ) . . . . . . . . . . . . . . . . . . 662
ql/cashflow.hpp (Base class for cash flows ) . . . . . . . . . . . . . . . . . . . . . . . . . . 663
ql/currency.hpp (Known currencies ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
ql/dataformatters.hpp (Classes used to format data for output ) . . . . . . . . . . . . . . 679
ql/dataparsers.hpp (Classes used to parse data for input ) . . . . . . . . . . . . . . . . . . 680
ql/date.hpp (Date- and time-related classes, typedefs and enumerations ) . . . . . . . . . 681
ql/daycounter.hpp (Day counter class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
ql/diffusionprocess.hpp (Diffusion process ) . . . . . . . . . . . . . . . . . . . . . . . . . 688
ql/discretizedasset.hpp (Discretized asset classes ) . . . . . . . . . . . . . . . . . . . . . . 689
ql/disposable.hpp (Generic disposable object with move semantics ) . . . . . . . . . . . 690
ql/errors.hpp (Classes and functions for error handling ) . . . . . . . . . . . . . . . . . . 691
ql/exercise.hpp (Option exercise classes and payoff function ) . . . . . . . . . . . . . . . 693
ql/grid.hpp (Grid classes with useful constructors for trees and finite diffs ) . . . . . . . 715
ql/handle.hpp (Reference-counted pointer ) . . . . . . . . . . . . . . . . . . . . . . . . . . 716
ql/history.hpp (History class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
ql/index.hpp (Purely virtual base class for indexes ) . . . . . . . . . . . . . . . . . . . . . 718
ql/instrument.hpp (Abstract instrument class ) . . . . . . . . . . . . . . . . . . . . . . . . 729
ql/marketelement.hpp (Purely virtual base class for market observables ) . . . . . . . . 754
ql/null.hpp (Null values ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807
ql/numericalmethod.hpp (Numerical method class ) . . . . . . . . . . . . . . . . . . . . . 808
ql/option.hpp (Base option class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 820
ql/payoff.hpp (Option payoff classes ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 827
ql/pricingengine.hpp (Base class for pricing engines ) . . . . . . . . . . . . . . . . . . . . 855
ql/qldefines.hpp (Global definitions and compiler switches ) . . . . . . . . . . . . . . . . 891
ql/relinkablehandle.hpp (Globally accessible relinkable pointer ) . . . . . . . . . . . . . 906
ql/scheduler.hpp (Date scheduler ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
ql/solver1d.hpp (Abstract 1-D solver class ) . . . . . . . . . . . . . . . . . . . . . . . . . . 921
ql/stochasticprocess.hpp (Base stochastic process class ) . . . . . . . . . . . . . . . . . . . 929
ql/swaptionvolstructure.hpp (Swaption volatility structure ) . . . . . . . . . . . . . . . . 930
ql/termstructure.hpp (Term structure ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 931
ql/types.hpp (Custom types ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 945
88 QuantLib File Index

ql/voltermstructure.hpp (Volatility term structures ) . . . . . . . . . . . . . . . . . . . . . 961


ql/Calendars/budapest.hpp (Budapest calendar ) . . . . . . . . . . . . . . . . . . . . . . . 643
ql/Calendars/copenhagen.hpp (Copenhagen calendar ) . . . . . . . . . . . . . . . . . . . 644
ql/Calendars/frankfurt.hpp (Frankfurt calendar ) . . . . . . . . . . . . . . . . . . . . . . . 645
ql/Calendars/helsinki.hpp (Helsinki calendar ) . . . . . . . . . . . . . . . . . . . . . . . . 646
ql/Calendars/johannesburg.hpp (Johannesburg calendar ) . . . . . . . . . . . . . . . . . 647
ql/Calendars/jointcalendar.hpp (Joint calendar ) . . . . . . . . . . . . . . . . . . . . . . . 648
ql/Calendars/london.hpp (London calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . 649
ql/Calendars/milan.hpp (Milan calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
ql/Calendars/newyork.hpp (New York calendar ) . . . . . . . . . . . . . . . . . . . . . . . 651
ql/Calendars/nullcalendar.hpp (Calendar for reproducing theoretical calculations ) . . . 652
ql/Calendars/oslo.hpp (Oslo calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
ql/Calendars/stockholm.hpp (Stockholm calendar ) . . . . . . . . . . . . . . . . . . . . . 654
ql/Calendars/sydney.hpp (Sydney calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . 655
ql/Calendars/target.hpp (TARGET calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . 656
ql/Calendars/tokyo.hpp (Tokyo calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
ql/Calendars/toronto.hpp (Toronto calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . 658
ql/Calendars/warsaw.hpp (Warsaw calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . 659
ql/Calendars/wellington.hpp (Wellington calendar ) . . . . . . . . . . . . . . . . . . . . . 660
ql/Calendars/zurich.hpp (Zurich calendar ) . . . . . . . . . . . . . . . . . . . . . . . . . . 661
ql/CashFlows/basispointsensitivity.hpp (Basis point sensitivity calculator ) . . . . . . . 664
ql/CashFlows/cashflowvectors.hpp (Cash flow vector builders ) . . . . . . . . . . . . . . 665
ql/CashFlows/coupon.hpp (Coupon accruing over a fixed period ) . . . . . . . . . . . . . 666
ql/CashFlows/fixedratecoupon.hpp (Coupon paying a fixed annual rate ) . . . . . . . . 667
ql/CashFlows/floatingratecoupon.hpp (Coupon at par on a term structure ) . . . . . . . 668
ql/CashFlows/inarrearindexedcoupon.hpp (In arrear indexed coupon ) . . . . . . . . . . 669
ql/CashFlows/indexcashflowvectors.hpp (Index Cash flow vector builders ) . . . . . . . 670
ql/CashFlows/indexedcoupon.hpp (Indexed coupon ) . . . . . . . . . . . . . . . . . . . . 671
ql/CashFlows/parcoupon.hpp (Coupon at par on a term structure ) . . . . . . . . . . . . 672
ql/CashFlows/shortfloatingcoupon.hpp (Short (or long) coupon at par on a term struc-
ture ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673
ql/CashFlows/shortindexedcoupon.hpp (Short (or long) indexed coupon ) . . . . . . . . 674
ql/CashFlows/simplecashflow.hpp (Predetermined cash flow ) . . . . . . . . . . . . . . . 675
ql/CashFlows/timebasket.hpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
ql/CashFlows/upfrontindexedcoupon.hpp (Up front indexed coupon ) . . . . . . . . . . 677
ql/DayCounters/actual360.hpp (Act/360 day counter ) . . . . . . . . . . . . . . . . . . . . 683
ql/DayCounters/actual365.hpp (Act/365 day counter ) . . . . . . . . . . . . . . . . . . . . 684
ql/DayCounters/actualactual.hpp (Act/act day counters ) . . . . . . . . . . . . . . . . . . 685
ql/DayCounters/simpledaycounter.hpp (Simple day counter for reproducing theoretical
calculations ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
ql/DayCounters/thirty360.hpp (30/360 day counters ) . . . . . . . . . . . . . . . . . . . . 687
ql/FiniteDifferences/americancondition.hpp (American option exercise condition ) . . . 694
ql/FiniteDifferences/boundarycondition.hpp (Boundary conditions for differential op-
erators ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
ql/FiniteDifferences/bsmoperator.hpp (Differential operator for Black-Scholes-Merton
equation ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
ql/FiniteDifferences/cranknicolson.hpp (Crank-Nicolson scheme for finite difference
methods ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
ql/FiniteDifferences/dminus.hpp (D− matricial representation ) . . . . . . . . . . . . . . . 698
ql/FiniteDifferences/dplus.hpp (D+ matricial representation ) . . . . . . . . . . . . . . . . 699
ql/FiniteDifferences/dplusdminus.hpp (D+ D− matricial representation ) . . . . . . . . . 700
ql/FiniteDifferences/dzero.hpp (D0 matricial representation ) . . . . . . . . . . . . . . . . 701
ql/FiniteDifferences/expliciteuler.hpp (Explicit Euler scheme for finite difference meth-
ods ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


7.1 QuantLib File List 89

ql/FiniteDifferences/fdtypedefs.hpp (Default choices for template instantiations ) . . . . 703


ql/FiniteDifferences/finitedifferencemodel.hpp (Generic finite difference model ) . . . . 704
ql/FiniteDifferences/impliciteuler.hpp (Implicit Euler scheme for finite difference meth-
ods ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
ql/FiniteDifferences/mixedscheme.hpp (Mixed (explicit/implicit) scheme for finite dif-
ference methods ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
ql/FiniteDifferences/onefactoroperator.hpp (General differential operator for one-factor
interest rate models ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
ql/FiniteDifferences/shoutcondition.hpp (Shout option exercise condition ) . . . . . . . 708
ql/FiniteDifferences/stepcondition.hpp (Conditions to be applied at every time step ) . . 709
ql/FiniteDifferences/tridiagonaloperator.hpp (Tridiagonal operator ) . . . . . . . . . . . 710
ql/FiniteDifferences/valueatcenter.hpp (Compute value, first, and second derivatives at
grid center ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711
ql/functions/daycounters.hpp (Day counters functions ) . . . . . . . . . . . . . . . . . . . 712
ql/functions/mathf.hpp (Math functions ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
ql/functions/vols.hpp (Volatility functions ) . . . . . . . . . . . . . . . . . . . . . . . . . . 714
ql/Indexes/audlibor.hpp (AUD Libor index (check settlement days) ) . . . . . . . . . . . 719
ql/Indexes/cadlibor.hpp (CAD Libor index (Also known as CDOR) ) . . . . . . . . . . . 720
ql/Indexes/chflibor.hpp (CHF Libor index (Also known as ZIBOR) ) . . . . . . . . . . . . 721
ql/Indexes/euribor.hpp (Euribor index ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
ql/Indexes/gbplibor.hpp (GBP Libor index ) . . . . . . . . . . . . . . . . . . . . . . . . . . 723
ql/Indexes/jpylibor.hpp (JPY Libor index (Also known as TIBOR, check settlement days) )724
ql/Indexes/usdlibor.hpp (USD Libor index ) . . . . . . . . . . . . . . . . . . . . . . . . . . 725
ql/Indexes/xibor.hpp (Base class for libor indexes ) . . . . . . . . . . . . . . . . . . . . . . 726
ql/Indexes/xibormanager.hpp (Global repository for Xibor histories ) . . . . . . . . . . . 727
ql/Indexes/zarlibor.hpp (ZAR Libor index (also known as JIBAR) ) . . . . . . . . . . . . 728
ql/Instruments/asianoption.hpp (Asian option on a single asset ) . . . . . . . . . . . . . 730
ql/Instruments/barrieroption.hpp (Barrier option on a single asset ) . . . . . . . . . . . . 731
ql/Instruments/basketoption.hpp (Basket option on a number of assets ) . . . . . . . . . 732
ql/Instruments/capfloor.hpp (Cap and Floor class ) . . . . . . . . . . . . . . . . . . . . . . 733
ql/Instruments/cliquetoption.hpp (Cliquet option ) . . . . . . . . . . . . . . . . . . . . . 734
ql/Instruments/forwardvanillaoption.hpp (Forward version of a vanilla option ) . . . . 736
ql/Instruments/multiassetoption.hpp (Option on multiple assets ) . . . . . . . . . . . . . 737
ql/Instruments/oneassetoption.hpp (Option on a single asset ) . . . . . . . . . . . . . . . 738
ql/Instruments/oneassetstrikedoption.hpp (Option on a single asset with striked payoff ) 739
ql/Instruments/payoffs.hpp (Payoffs for various options ) . . . . . . . . . . . . . . . . . . 740
ql/Instruments/quantoforwardvanillaoption.hpp (Quanto version of a forward vanilla
option ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
ql/Instruments/quantovanillaoption.hpp (Quanto version of a vanilla option ) . . . . . 742
ql/Instruments/simpleswap.hpp (Simple fixed-rate vs Libor swap ) . . . . . . . . . . . . 743
ql/Instruments/stock.hpp (Concrete stock class ) . . . . . . . . . . . . . . . . . . . . . . . 744
ql/Instruments/swap.hpp (Interest rate swap ) . . . . . . . . . . . . . . . . . . . . . . . . 745
ql/Instruments/swaption.hpp (Swaption class ) . . . . . . . . . . . . . . . . . . . . . . . . 746
ql/Instruments/vanillaoption.hpp (Vanilla option on a single asset ) . . . . . . . . . . . . 747
ql/Lattices/binomialtree.hpp (Binomial tree class ) . . . . . . . . . . . . . . . . . . . . . . 748
ql/Lattices/bsmlattice.hpp (Binomial trees under the BSM model ) . . . . . . . . . . . . . 749
ql/Lattices/lattice.hpp (Lattice method class ) . . . . . . . . . . . . . . . . . . . . . . . . . 750
ql/Lattices/lattice2d.hpp (Two-dimensional tree class ) . . . . . . . . . . . . . . . . . . . . 751
ql/Lattices/tree.hpp (Tree class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 752
ql/Lattices/trinomialtree.hpp (Trinomial tree class ) . . . . . . . . . . . . . . . . . . . . . 753
ql/Math/array.hpp (1-D array used in linear algebra ) . . . . . . . . . . . . . . . . . . . . 755
ql/Math/beta.hpp (Beta and beta incomplete functions ) . . . . . . . . . . . . . . . . . . . 756
ql/Math/bicubicsplineinterpolation.hpp (Bicubic spline interpolation between discrete
points ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


90 QuantLib File Index

ql/Math/bilinearinterpolation.hpp (Bilinear interpolation between discrete points ) . . 758


ql/Math/binomialdistribution.hpp (Binomial distribution ) . . . . . . . . . . . . . . . . . 759
ql/Math/bivariatenormaldistribution.hpp (Bivariate cumulative normal distribution ) . 760
ql/Math/chisquaredistribution.hpp (Chi-square (central and non-central) distributions ) 761
ql/Math/choleskydecomposition.hpp (Cholesky decomposition ) . . . . . . . . . . . . . 762
ql/Math/comparison.hpp (Floating-point comparisons ) . . . . . . . . . . . . . . . . . . . 763
ql/Math/cubicspline.hpp (Cubic spline interpolation between discrete points ) . . . . . 764
ql/Math/discrepancystatistics.hpp (Statistic tool for sequences with discrepancy calcu-
lation ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
ql/Math/errorfunction.hpp (Error function ) . . . . . . . . . . . . . . . . . . . . . . . . . . 766
ql/Math/factorial.hpp (Factorial numbers calculator ) . . . . . . . . . . . . . . . . . . . . 767
ql/Math/functional.hpp (Functionals and combinators not included in the STL ) . . . . . 768
ql/Math/gammadistribution.hpp (Gamma distribution ) . . . . . . . . . . . . . . . . . . 769
ql/Math/gaussianstatistics.hpp (Statistics tool for gaussian-assumption risk measures ) 770
ql/Math/generalstatistics.hpp (Statistics tool ) . . . . . . . . . . . . . . . . . . . . . . . . . 771
ql/Math/incompletegamma.hpp (Incomplete Gamma function ) . . . . . . . . . . . . . . 772
ql/Math/incrementalstatistics.hpp (Statistics tool based on incremental accumulation ) . 773
ql/Math/interpolation.hpp (Base class for 1-D interpolations ) . . . . . . . . . . . . . . . 774
ql/Math/interpolation2D.hpp (Abstract base classes for 2-D interpolations ) . . . . . . . 775
ql/Math/interpolationtraits.hpp (Traits classes for interpolation algorithms ) . . . . . . . 776
ql/Math/kronrodintegral.hpp (Integral of a 1-dimensional function using the Gauss-
Kronrod method ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777
ql/Math/lexicographicalview.hpp (Lexicographical 2-D view of a contiguous set of data ) 778
ql/Math/linearinterpolation.hpp (Linear interpolation between discrete points ) . . . . . 779
ql/Math/loglinearinterpolation.hpp (Log-linear interpolation between discrete points ) 780
ql/Math/matrix.hpp (Matrix used in linear algebra ) . . . . . . . . . . . . . . . . . . . . . 781
ql/Math/normaldistribution.hpp (Normal, cumulative and inverse cumulative distri-
butions ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782
ql/Math/poissondistribution.hpp (Poisson distribution ) . . . . . . . . . . . . . . . . . . 783
ql/Math/primenumbers.hpp (Prime numbers calculator ) . . . . . . . . . . . . . . . . . . 784
ql/Math/pseudosqrt.hpp (Pseudo square root of a real symmetric matrix ) . . . . . . . . 785
ql/Math/riskstatistics.hpp (Empirical-distribution risk measures ) . . . . . . . . . . . . . 786
ql/Math/segmentintegral.hpp (Integral of a one-dimensional function ) . . . . . . . . . . 787
ql/Math/sequencestatistics.hpp (Statistics tools for sequence (vector, list, array) samples ) 788
ql/Math/simpsonintegral.hpp (Integral of a one-dimensional function ) . . . . . . . . . . 790
ql/Math/statistics.hpp (Statistics tool with risk measures ) . . . . . . . . . . . . . . . . . . 791
ql/Math/svd.hpp (Singular value decomposition ) . . . . . . . . . . . . . . . . . . . . . . 792
ql/Math/symmetriceigenvalues.hpp (Eigenvalues / eigenvectors of a real symmetric
matrix ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
ql/Math/symmetricschurdecomposition.hpp (Eigenvalues / eigenvectors of a real sym-
metric matrix ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794
ql/Math/trapezoidintegral.hpp (Integral of a one-dimensional function ) . . . . . . . . . 795
ql/MonteCarlo/brownianbridge.hpp (Browian bridge ) . . . . . . . . . . . . . . . . . . . 796
ql/MonteCarlo/getcovariance.hpp (Covariance matrix calculation ) . . . . . . . . . . . . 797
ql/MonteCarlo/mctraits.hpp (Monte Carlo policies ) . . . . . . . . . . . . . . . . . . . . . 798
ql/MonteCarlo/mctypedefs.hpp (Default choices for template instantiations ) . . . . . . 799
ql/MonteCarlo/montecarlomodel.hpp (General purpose Monte Carlo model ) . . . . . . 800
ql/MonteCarlo/multipath.hpp (Correlated multiple asset paths ) . . . . . . . . . . . . . . 801
ql/MonteCarlo/multipathgenerator.hpp (Generates a multi path from a random-array
generator ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802
ql/MonteCarlo/path.hpp (Single factor random walk ) . . . . . . . . . . . . . . . . . . . . 803
ql/MonteCarlo/pathgenerator.hpp (Generates random paths using a sequence generator )804
ql/MonteCarlo/pathpricer.hpp (Base class for single-path pricers ) . . . . . . . . . . . . . 805
ql/MonteCarlo/sample.hpp (Weighted sample ) . . . . . . . . . . . . . . . . . . . . . . . . 806

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


7.1 QuantLib File List 91

ql/Optimization/armijo.hpp (Armijo line-search class ) . . . . . . . . . . . . . . . . . . . 809


ql/Optimization/conjugategradient.hpp (Conjugate gradient optimization method ) . . 810
ql/Optimization/constraint.hpp (Abstract constraint class ) . . . . . . . . . . . . . . . . . 811
ql/Optimization/costfunction.hpp (Optimization cost function class ) . . . . . . . . . . . 812
ql/Optimization/criteria.hpp (Optimization criteria class ) . . . . . . . . . . . . . . . . . . 813
ql/Optimization/leastsquare.hpp (Least square cost function ) . . . . . . . . . . . . . . . 814
ql/Optimization/linesearch.hpp (Line search abstract class ) . . . . . . . . . . . . . . . . 815
ql/Optimization/method.hpp (Abstract optimization method class ) . . . . . . . . . . . . 816
ql/Optimization/problem.hpp (Abstract optimization class ) . . . . . . . . . . . . . . . . 817
ql/Optimization/simplex.hpp (Simplex optimization method ) . . . . . . . . . . . . . . . 818
ql/Optimization/steepestdescent.hpp (Steepest descent optimization method ) . . . . . 819
ql/Patterns/bridge.hpp (Bridge pattern (a.k.a. handle-body idiom) ) . . . . . . . . . . . . 821
ql/Patterns/composite.hpp (Composite pattern ) . . . . . . . . . . . . . . . . . . . . . . . 822
ql/Patterns/curiouslyrecurring.hpp (Curiously recurring template pattern ) . . . . . . . 823
ql/Patterns/lazyobject.hpp (Framework for calculation on demand and result caching ) 824
ql/Patterns/observable.hpp (Observer/observable pattern ) . . . . . . . . . . . . . . . . . 825
ql/Patterns/visitor.hpp (Degenerate base class for the Acyclic Visitor pattern ) . . . . . . 826
ql/Pricers/cliquetoption.hpp (Cliquet option ) . . . . . . . . . . . . . . . . . . . . . . . . 735
ql/Pricers/continuousgeometricapo.hpp (Continuous Geometric Average Price Option
(European exercise) ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828
ql/Pricers/discretegeometricapo.hpp (Discrete Geometric Average Price Option ) . . . . 829
ql/Pricers/discretegeometricaso.hpp (Discrete Geometric Average Strike Option ) . . . . 830
ql/Pricers/europeanoption.hpp (European option ) . . . . . . . . . . . . . . . . . . . . . . 831
ql/Pricers/fdamericanoption.hpp (American option ) . . . . . . . . . . . . . . . . . . . . 832
ql/Pricers/fdbermudanoption.hpp (Finite-difference evaluation of Bermudan option ) . 833
ql/Pricers/fdbsmoption.hpp (Common code for numerical option evaluation ) . . . . . . 834
ql/Pricers/fddividendamericanoption.hpp (American option with discrete deterministic
dividends ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
ql/Pricers/fddividendeuropeanoption.hpp (European option with discrete determinis-
tic dividends ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836
ql/Pricers/fddividendoption.hpp (Base class for option with dividends ) . . . . . . . . . 837
ql/Pricers/fddividendshoutoption.hpp (Base class for shout option with dividends ) . . 838
ql/Pricers/fdeuropean.hpp (Example of European option calculated using finite differ-
ences ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839
ql/Pricers/fdmultiperiodoption.hpp (Base class for option with events happening at
different periods ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840
ql/Pricers/fdshoutoption.hpp (Shout option ) . . . . . . . . . . . . . . . . . . . . . . . . . 841
ql/Pricers/fdstepconditionoption.hpp (Option requiring additional code to be executed
at each time step ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842
ql/Pricers/mcbasket.hpp (Simple example of multi-factor Monte Carlo pricer ) . . . . . . 843
ql/Pricers/mccliquetoption.hpp (Cliquet option priced with Monte Carlo simulation ) . 844
ql/Pricers/mcdiscretearithmeticapo.hpp (Discrete Arithmetic Average Price Option ) . . 845
ql/Pricers/mcdiscretearithmeticaso.hpp (Discrete Arithmetic Average Strike Option ) . 846
ql/Pricers/mceverest.hpp (Everest-type option pricer ) . . . . . . . . . . . . . . . . . . . . 847
ql/Pricers/mchimalaya.hpp (Himalayan-type option pricer ) . . . . . . . . . . . . . . . . 848
ql/Pricers/mcmaxbasket.hpp (Max Basket Monte Carlo pricer ) . . . . . . . . . . . . . . . 849
ql/Pricers/mcpagoda.hpp (Roofed multi asset Asian option ) . . . . . . . . . . . . . . . . 850
ql/Pricers/mcperformanceoption.hpp (Performance option priced with Monte Carlo
simulation ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851
ql/Pricers/mcpricer.hpp (Base class for Monte Carlo pricers ) . . . . . . . . . . . . . . . . 852
ql/Pricers/performanceoption.hpp (Performance option ) . . . . . . . . . . . . . . . . . . 853
ql/Pricers/singleassetoption.hpp (Common code for option evaluation ) . . . . . . . . . 854
ql/PricingEngines/americanpayoffatexpiry.hpp (Analytical formulae for american exer-
cise with payoff at expiry ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


92 QuantLib File Index

ql/PricingEngines/americanpayoffathit.hpp (Analytical formulae for american exercise


with payoff at hit ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857
ql/PricingEngines/blackformula.hpp (Black formula ) . . . . . . . . . . . . . . . . . . . . 864
ql/PricingEngines/blackmodel.hpp (Abstract class for Black-type models (market mod-
els) ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865
ql/PricingEngines/genericmodelengine.hpp (Generic option engine based on a model ) 872
ql/PricingEngines/latticeshortratemodelengine.hpp (Engine for a short-rate model spe-
cialized on a lattice ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 873
ql/PricingEngines/mcsimulation.hpp (Framework for Monte Carlo engines ) . . . . . . 874
ql/PricingEngines/Asian/analyticasianengine.hpp (Analytic Asian option engine ) . . . 858
ql/PricingEngines/Barrier/analyticbarrierengine.hpp (Analytic barrier option engines ) 859
ql/PricingEngines/Barrier/mcbarrierengine.hpp (Monte Carlo barrier option engines ) . 860
ql/PricingEngines/Basket/mcamericanbasketengine.hpp (Least-square Monte Carlo en-
gines ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861
ql/PricingEngines/Basket/mcbasketengine.hpp (European Basket MC Engine ) . . . . . 862
ql/PricingEngines/Basket/stulzengine.hpp (2D European Basket formulae, due to Stulz
(1982) ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 863
ql/PricingEngines/CapFloor/analyticalcapfloor.hpp (Analytical pricer for caps/floors ) . 866
ql/PricingEngines/CapFloor/blackcapfloor.hpp (CapFloor calculated using the Black for-
mula ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 867
ql/PricingEngines/CapFloor/capfloorpricer.hpp (Cap and floor pricer class ) . . . . . . . 868
ql/PricingEngines/CapFloor/treecapfloor.hpp (Cap/Floor calculated using a tree ) . . . . 869
ql/PricingEngines/Forward/forwardengine.hpp (Forward (strike-resetting) option en-
gine ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 870
ql/PricingEngines/Forward/forwardperformanceengine.hpp (Forward (strike-
resetting) performance option engines ) . . . . . . . . . . . . . . . . . . . . . . 871
ql/PricingEngines/Quanto/quantoengine.hpp (Quanto option engine ) . . . . . . . . . . 875
ql/PricingEngines/Swaption/blackswaption.hpp (Swaption calculated using the Black
formula ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 876
ql/PricingEngines/Swaption/jamshidianswaption.hpp (Swaption pricer using Jamshid-
ian’s decomposition ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877
ql/PricingEngines/Swaption/swaptionpricer.hpp (Swaption pricer class ) . . . . . . . . . 878
ql/PricingEngines/Swaption/treeswaption.hpp (Swaption computed using a lattice ) . . 879
ql/PricingEngines/Vanilla/analyticdigitalamericanengine.hpp (Analytic digital Ameri-
can option engine ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
ql/PricingEngines/Vanilla/analyticeuropeanengine.hpp (Analytic European engine ) . . 881
ql/PricingEngines/Vanilla/baroneadesiwhaleyengine.hpp (Barone-Adesi and Whaley
approximation engine ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 882
ql/PricingEngines/Vanilla/binomialengine.hpp (Binomial option engine ) . . . . . . . . 883
ql/PricingEngines/Vanilla/bjerksundstenslandengine.hpp (Bjerksund and Stensland
approximation engine ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884
ql/PricingEngines/Vanilla/discretizedvanillaoption.hpp (Discretized vanilla option ) . . 885
ql/PricingEngines/Vanilla/integralengine.hpp (Integral option engine ) . . . . . . . . . . 886
ql/PricingEngines/Vanilla/jumpdiffusionengine.hpp (Jump diffusion (Merton 1976) en-
gine ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 887
ql/PricingEngines/Vanilla/mcdigitalengine.hpp (Digital option Monte Carlo engine ) . . 888
ql/PricingEngines/Vanilla/mceuropeanengine.hpp (Monte Carlo European option en-
gine ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 889
ql/PricingEngines/Vanilla/mcvanillaengine.hpp (Monte Carlo vanilla option engine ) . 890
ql/RandomNumbers/boxmullergaussianrng.hpp (Box-Muller Gaussian random-
number generator ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 893
ql/RandomNumbers/centrallimitgaussianrng.hpp (Central limit Gaussian random-
number generator ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 894
ql/RandomNumbers/haltonrsg.hpp (Halton low-discrepancy sequence generator ) . . . 895

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


7.1 QuantLib File List 93

ql/RandomNumbers/inversecumgaussianrng.hpp (Inverse cumulative Gaussian


random-number generator ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 896
ql/RandomNumbers/inversecumgaussianrsg.hpp (Inverse cumulative Gaussian ran-
dom sequence generator ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 897
ql/RandomNumbers/knuthuniformrng.hpp (Knuth uniform random number generator )898
ql/RandomNumbers/lecuyeruniformrng.hpp (L’Ecuyer uniform random number gen-
erator ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 899
ql/RandomNumbers/mt19937uniformrng.hpp (Mersenne Twister uniform random
number generator ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 900
ql/RandomNumbers/randomarraygenerator.hpp (Generates random arrays from a ran-
dom number generator ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 901
ql/RandomNumbers/randomsequencegenerator.hpp (Random sequence generator
based on a pseudo-random number generator ) . . . . . . . . . . . . . . . . . 902
ql/RandomNumbers/rngtraits.hpp (Random-number generation policies ) . . . . . . . . 903
ql/RandomNumbers/rngtypedefs.hpp (Default choices for template instantiations ) . . 904
ql/RandomNumbers/sobolrsg.hpp (Sobol low-discrepancy sequence generator ) . . . . 905
ql/ShortRateModels/calibrationhelper.hpp (Calibration helper class ) . . . . . . . . . . . 908
ql/ShortRateModels/model.hpp (Abstract interest rate model class ) . . . . . . . . . . . . 911
ql/ShortRateModels/onefactormodel.hpp (Abstract one-factor interest rate model class ) 912
ql/ShortRateModels/parameter.hpp (Model parameter classes ) . . . . . . . . . . . . . . 918
ql/ShortRateModels/twofactormodel.hpp (Abstract two-factor interest rate model class ) 919
ql/ShortRateModels/CalibrationHelpers/caphelper.hpp (CapHelper calibration helper ) 909
ql/ShortRateModels/CalibrationHelpers/swaptionhelper.hpp (Swaption calibration
helper ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 910
ql/ShortRateModels/OneFactorModels/blackkarasinski.hpp (Black-Karasinski model ) 913
ql/ShortRateModels/OneFactorModels/coxingersollross.hpp (Cox-Ingersoll-Ross
model ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 914
ql/ShortRateModels/OneFactorModels/extendedcoxingersollross.hpp (Extended Cox-
Ingersoll-Ross model ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 915
ql/ShortRateModels/OneFactorModels/hullwhite.hpp (Hull & White (HW) model ) . . 916
ql/ShortRateModels/OneFactorModels/vasicek.hpp (Vasicek model class ) . . . . . . . . 917
ql/ShortRateModels/TwoFactorModels/g2.hpp (Two-factor additive Gaussian Model
G2++ ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 920
ql/Solvers1D/bisection.hpp (Bisection 1-D solver ) . . . . . . . . . . . . . . . . . . . . . . 922
ql/Solvers1D/brent.hpp (Brent 1-D solver ) . . . . . . . . . . . . . . . . . . . . . . . . . . 923
ql/Solvers1D/falseposition.hpp (False-position 1-D solver ) . . . . . . . . . . . . . . . . . 924
ql/Solvers1D/newton.hpp (Newton 1-D solver ) . . . . . . . . . . . . . . . . . . . . . . . 925
ql/Solvers1D/newtonsafe.hpp (Safe (bracketed) Newton 1-D solver ) . . . . . . . . . . . 926
ql/Solvers1D/ridder.hpp (Ridder 1-D solver ) . . . . . . . . . . . . . . . . . . . . . . . . . 927
ql/Solvers1D/secant.hpp (Secant 1-D solver ) . . . . . . . . . . . . . . . . . . . . . . . . . 928
ql/TermStructures/affinetermstructure.hpp (Affine term structure ) . . . . . . . . . . . . 932
ql/TermStructures/compoundforward.hpp (Compounded forward term structure ) . . . 933
ql/TermStructures/discountcurve.hpp (Pre-bootstrapped discount factor structure ) . . . 934
ql/TermStructures/drifttermstructure.hpp (Drift term structure ) . . . . . . . . . . . . . . 935
ql/TermStructures/extendeddiscountcurve.hpp (Discount factor structure with detailed
compound-forward calculation ) . . . . . . . . . . . . . . . . . . . . . . . . . . 936
ql/TermStructures/flatforward.hpp (Flat forward rate term structure ) . . . . . . . . . . . 937
ql/TermStructures/forwardspreadedtermstructure.hpp (Forward spreaded term struc-
ture ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 938
ql/TermStructures/impliedtermstructure.hpp (Implied term structure ) . . . . . . . . . . 939
ql/TermStructures/piecewiseflatforward.hpp (Piecewise flat forward term structure ) . . 940
ql/TermStructures/quantotermstructure.hpp (Quanto term structure ) . . . . . . . . . . . 941
ql/TermStructures/ratehelpers.hpp (Rate helpers base class ) . . . . . . . . . . . . . . . . 942
ql/TermStructures/zerocurve.hpp (Pre-bootstrapped zero curve structure ) . . . . . . . . 943

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


94 QuantLib File Index

ql/TermStructures/zerospreadedtermstructure.hpp (Zero spreaded term structure ) . . . 944


ql/Utilities/combiningiterator.hpp (Iterator mapping a function to a set of underlying
sequences ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 946
ql/Utilities/couplingiterator.hpp (Iterator mapping a function to a pair of underlying
sequences ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 947
ql/Utilities/filteringiterator.hpp (Iterator filtering undesired data ) . . . . . . . . . . . . . 948
ql/Utilities/iteratorcategories.hpp (Lowest common denominator between two iterator
categories ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 949
ql/Utilities/processingiterator.hpp (Iterator mapping a unary function to an underlying
sequence ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 950
ql/Utilities/steppingiterator.hpp (Iterator advancing in constant steps ) . . . . . . . . . . 951
ql/Volatilities/blackconstantvol.hpp (Black constant volatility, no time dependence, no
strike dependence ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 952
ql/Volatilities/blackvariancecurve.hpp (Black volatility curve modelled as variance
curve ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953
ql/Volatilities/blackvariancesurface.hpp (Black volatility surface modelled as variance
surface ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 954
ql/Volatilities/capflatvolvector.hpp (Cap/floor at-the-money flat volatility vector ) . . . . 955
ql/Volatilities/impliedvoltermstructure.hpp (Implied Black Vol Term Structure ) . . . . 956
ql/Volatilities/localconstantvol.hpp (Local constant volatility, no time dependence, no
asset dependence ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 957
ql/Volatilities/localvolcurve.hpp (Local volatility curve derived from a Black curve ) . . 958
ql/Volatilities/localvolsurface.hpp (Local volatility surface derived from a Black vol sur-
face ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 959
ql/Volatilities/swaptionvolmatrix.hpp (Swaption at-the-money volatility matrix ) . . . . 960

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


Chapter 8

QuantLib Module Documentation

8.1 Global QuantLib macros

8.1.1 Detailed Description

Global definitions and quite a few macros which help porting the code to different compilers

Defines

• #define QL_HEX_VERSION 0x000306f0


version hexadecimal number

• #define QL_VERSION "0.3.6"


version string

• #define QL_DUMMY_RETURN(x)
specific per-compiler definitions Is a dummy return statement required?

• #define QL_IO_INIT
I/O initialization.

8.1.2 Define Documentation

8.1.2.1 #define QL_DUMMY_RETURN(x)

specific per-compiler definitions Is a dummy return statement required?


Some compilers will issue a warning if it is missing even though it could never be reached during
execution, e.g., after a block like

if (condition)
return validResult;
else
QL_FAIL("whatever the reason");
96 QuantLib Module Documentation

On the other hand, other compilers will issue a warning if it is present because it cannot be
reached. For the code to be portable this macro should be used after the block.

8.1.2.2 #define QL_IO_INIT

I/O initialization.
Sometimes, programs compiled with the free Borland compiler will crash miserably upon at-
tempting to write on std::cout. Strangely enough, issuing the instruction

std::cout << std::string();

at the beginning of the program will prevent other accesses to std::cout from crashing the program.
This macro, to be called at the beginning of main(), encapsulates the above enchantment for
Borland and is defined as empty for the other compilers.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


8.2 Math functions 97

8.2 Math functions

8.2.1 Detailed Description

Some compilers still define math functions them in the global namespace. For the code to be
portable these macros should be used instead of the actual functions.

Defines
• #define QL_SQRT std::sqrt
square root

• #define QL_FABS std::fabs


absolute value

• #define QL_EXP std::exp


exponential

• #define QL_LOG std::log


logarithm

• #define QL_SIN std::sin


sine

• #define QL_COS std::cos


cosine

• #define QL_POW std::pow


power

• #define QL_MODF std::modf


floating-point module

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


98 QuantLib Module Documentation

8.3 Numeric limits

8.3.1 Detailed Description

Some compilers do not give an implementation of yet. For the code to be portable these macros
should be used instead of the corresponding method of std::numeric_limits or the corresponding
macro defined in <limits.h>.

Defines
• #define QL_MIN_INT ((std::numeric_limits<int>::min)())
• #define QL_MAX_INT ((std::numeric_limits<int>::max)())
• #define QL_MIN_DOUBLE -((std::numeric_limits<double>::max)())
• #define QL_MIN_POSITIVE_DOUBLE ((std::numeric_limits<double>::min)())
• #define QL_MAX_DOUBLE ((std::numeric_limits<double>::max)())
• #define QL_EPSILON ((std::numeric_limits<double>::epsilon)())

8.3.2 Define Documentation

8.3.2.1 #define QL_MIN_INT ((std::numeric_limits<int>::min)())

Defines the value of the largest representable negative integer value

8.3.2.2 #define QL_MAX_INT ((std::numeric_limits<int>::max)())

Defines the value of the largest representable integer value

8.3.2.3 #define QL_MIN_DOUBLE -((std::numeric_limits<double>::max)())

Defines the value of the largest representable negative double value

8.3.2.4 #define QL_MIN_POSITIVE_DOUBLE ((std::numeric_limits<double>::min)())

Defines the value of the smallest representable positive double value

8.3.2.5 #define QL_MAX_DOUBLE ((std::numeric_limits<double>::max)())

Defines the value of the largest representable double value

8.3.2.6 #define QL_EPSILON ((std::numeric_limits<double>::epsilon)())

Defines the machine precision for operations over doubles

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


8.4 Time functions 99

8.4 Time functions

8.4.1 Detailed Description

Some compilers still define time functions in the global namespace. For the code to be portable
these macros should be used instead of the actual functions.

Defines
• #define QL_CLOCK std::clock
clock value

• #define QL_TIME std::time


time value

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


100 QuantLib Module Documentation

8.5 String functions

8.5.1 Detailed Description

Some compilers still define string functions in the global namespace. For the code to be portable
these macros should be used instead of the actual functions.

Defines
• #define QL_STRLEN std::strlen
string length

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


8.6 Character functions 101

8.6 Character functions

8.6.1 Detailed Description

Some compilers still define character functions in the global namespace. For the code to be
portable these macros should be used instead of the actual functions.

Defines
• #define QL_TOUPPER std::toupper
convert to uppercase

• #define QL_TOLOWER std::tolower


convert to lowercase

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


102 QuantLib Module Documentation

8.7 Input/output functions

8.7.1 Detailed Description

Some compilers still define i/o functions in the global namespace. For the code to be portable
these macros should be used instead of the actual functions.

Defines
• #define QL_SPRINTF std::sprintf
print to string

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


8.8 Min and max functions 103

8.8 Min and max functions

8.8.1 Detailed Description

Some compilers still do not define std::min and std::max. Moreover, Visual C++ defines them but
for unfathomable reasons garble their names. For the code to be portable these macros should be
used instead of the actual functions.

Defines
• #define QL_MIN std::min
minimum between two elements

• #define QL_MAX std::max


maximum between two elements

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


104 QuantLib Module Documentation

8.9 Template capabilities

8.9.1 Detailed Description

Some compilers still do not fully implement the template syntax. These macros can be used to
select between alternate implementations of blocks of code, namely, one that takes advantage of
template programming techniques and a less efficient one which is compatible with all compilers.

Defines

• #define QL_DECLARE_TEMPLATE_SPECIALIZATIONS
Blame Microsoft for this one...

• #define QL_ALLOW_TEMPLATE_METHOD_CALLS 1
Blame Microsoft for this one...

• #define QL_TYPENAME typename


Blame Microsoft for this one...

• #define QL_TEMPLATE_METAPROGRAMMING_WORKS 1

8.9.2 Define Documentation

8.9.2.1 #define QL_DECLARE_TEMPLATE_SPECIALIZATIONS

Blame Microsoft for this one...


They decided that a declaration and a definition of a specialized template function amount to a
redefinition and should issue a linker error. For the code to be portable, template specializations
should be declared (as opposed to defined) only if this macro is defined.

8.9.2.2 #define QL_ALLOW_TEMPLATE_METHOD_CALLS 1

Blame Microsoft for this one...


Their compiler cannot cope with method calls such as

Handle<Type1> h1(whatever);
h2 = h1.downcast<Type2>();

For compatibility, a workaround should be implemented (which of course will be less solid or
more comples - as I said, blame Microsoft...)

8.9.2.3 #define QL_TYPENAME typename

Blame Microsoft for this one...


They decided that typename can only be used in template declarations and not in template
definitions.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


8.9 Template capabilities 105

8.9.2.4 #define QL_TEMPLATE_METAPROGRAMMING_WORKS 1

Template metaprogramming techniques (see T. L. Veldhuizen, Using C++ Tem-


plate Metaprograms, C++ Report, Vol 7 No. 4, May 1995, available at
http://extreme.indiana.edu/∼tveldhui/papers) are sometimes too advanced for the
template implementation of current compilers.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


106 QuantLib Module Documentation

8.10 Iterator support

8.10.1 Detailed Description

Some compilers still define the iterator struct outside the std namespace, only partially implement
it, or do not implement it at all. For the code to be portable these macros should be used instead
of the actual functions.

Defines
• #define QL_ITERATOR std::iterator
• #define QL_ITERATOR_TRAITS std::iterator_traits
• #define QL_SPECIALIZE_ITERATOR_TRAITS(T)
• #define QL_REVERSE_ITERATOR(iterator, type) std::reverse_iterator< iterator >
Blame Microsoft for this one...

• #define QL_FULL_ITERATOR_SUPPORT

8.10.2 Define Documentation

8.10.2.1 #define QL_ITERATOR std::iterator

Custom iterators should be derived from this struct for the code to be portable.

8.10.2.2 #define QL_ITERATOR_TRAITS std::iterator_traits

For the code to be portable this macro should be used instead of the actual struct.

8.10.2.3 #define QL_SPECIALIZE_ITERATOR_TRAITS(T)

When using the QuantLib implementation of iterator_traits or Visual C++ .Net, this macro might
be needed to specialize QL_ITERATOR_TRAITS for a pointer to a user-defined type.

8.10.2.4 #define QL_REVERSE_ITERATOR(iterator, type) std::reverse_iterator< iterator >

Blame Microsoft for this one...


They decided that std::reverse_iterator<iterator> needed an extra template argument. For
the code to be portable this macro should be used instead of the actual class.

8.10.2.5 #define QL_FULL_ITERATOR_SUPPORT

Some compilers (most notably, Visual C++) still do not fully support iterators in their STL
implementation. This macro can be used to select between alternate implementations of blocks
of code, namely, one that takes advantage of full iterator support and a less efficient one which is
compatible with all compilers.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


Chapter 9

QuantLib Class Documentation

9.1 Actual360 Class Reference


#include <ql/DayCounters/actual360.hpp>
Inheritance diagram for Actual360:

Bridge< DayCounter, DayCounterImpl >

DayCounter

Actual360

9.1.1 Detailed Description

Actual/360 day count convention.


108 QuantLib Class Documentation

9.2 Actual365 Class Reference


#include <ql/DayCounters/actual365.hpp>
Inheritance diagram for Actual365:

Bridge< DayCounter, DayCounterImpl >

DayCounter

Actual365

9.2.1 Detailed Description

Actual/365 day count convention.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.3 ActualActual Class Reference 109

9.3 ActualActual Class Reference


#include <ql/DayCounters/actualactual.hpp>
Inheritance diagram for ActualActual:

Bridge< DayCounter, DayCounterImpl >

DayCounter

ActualActual

9.3.1 Detailed Description

Actual/Actual day count.


The day count can be calculated according to ISMA and US Treasury convention, also known
as "Actual/Actual (Bond)"; to ISDA, also known as "Actual/Actual (Historical)"; or to AFB, also
known as "Actual/Actual (Euro)".
For more details, refer to http://www.isda.org/c_and_a/pdf/mktc1198.pdf

Public Types
• enum Convention {
ISMA, Bond, ISDA, Historical,
AFB, Euro }

Public Member Functions


• ActualActual (Convention c=ActualActual::ISMA)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


110 QuantLib Class Documentation

9.4 AcyclicVisitor Class Reference


#include <ql/Patterns/visitor.hpp>
Inheritance diagram for AcyclicVisitor:

AcyclicVisitor

BPSBasketCalculator BPSCalculator

9.4.1 Detailed Description

degenerate base class for the Acyclic Visitor pattern

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.5 AdditiveEQPBinomialTree Class Reference 111

9.5 AdditiveEQPBinomialTree Class Reference


#include <ql/Lattices/binomialtree.hpp>
Inheritance diagram for AdditiveEQPBinomialTree:

Tree

BinomialTree

EqualProbabilitiesBinomialTree

AdditiveEQPBinomialTree

9.5.1 Detailed Description

Additive equal probabilities binomial tree.

Public Member Functions


• AdditiveEQPBinomialTree (const Handle< DiffusionProcess > &process, Time end, Size
steps, double strike)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


112 QuantLib Class Documentation

9.6 AffineModel Class Reference


#include <ql/ShortRateModels/model.hpp>
Inheritance diagram for AffineModel:

Observable

AffineModel

G2 OneFactorAffineModel

CoxIngersollRoss Vasicek

ExtendedCoxIngersollRoss HullWhite

9.6.1 Detailed Description

Affine model class.


This is the base class for analytically tractable models

Public Member Functions


• virtual DiscountFactor discount (Time t) const=0
Implied discount curve.

• virtual double discountBondOption (Option::Type type, double strike, Time maturity, Time
bondMaturity) const=0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.7 AffineTermStructure Class Reference 113

9.7 AffineTermStructure Class Reference


#include <ql/TermStructures/affinetermstructure.hpp>
Inheritance diagram for AffineTermStructure:

Observable

TermStructure

DiscountStructure Observer

AffineTermStructure

9.7.1 Detailed Description

Term-structure implied by an affine model.


This class defines a term-structure that is based on an affine model, e.g. Vasicek(p. 626) or Cox-
Ingersoll-Ross. It either be instanced using a model with defined arguments, or the model can be
calibrated to a set of rate helpers. Of course, there is no point in using a term-structure consistent
affine model, since the implied term-structure will just be the initial term-structure on which the
model is based.

Public Member Functions


• AffineTermStructure (const Date &todaysDate, const Date &referenceDate, const Handle<
AffineModel > &model, const DayCounter &dayCounter)
constructor using a fixed model

• AffineTermStructure (const Date &todaysDate, const Date &referenceDate, const Handle<


AffineModel > &model, const std::vector< Handle< RateHelper > > &, const Handle<
OptimizationMethod > &method, const DayCounter &dayCounter)
constructor using a model that has to be calibrated

• DayCounter dayCounter () const


the day counter used for date/time conversion

• Date todaysDate () const


today’s date

• Date referenceDate () const


the reference date, i.e., the date at which discount = 1

• Date maxDate () const


the latest date for which the curve can return rates

• void update ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


114 QuantLib Class Documentation

Protected Member Functions


• DiscountFactor discountImpl (Time, bool extrapolate=false) const
discount calculation

9.7.2 Member Function Documentation

9.7.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.8 AmericanCondition Class Reference 115

9.8 AmericanCondition Class Reference


#include <ql/FiniteDifferences/americancondition.hpp>
Inheritance diagram for AmericanCondition:

StandardStepCondition

AmericanCondition

9.8.1 Detailed Description

American exercise condition.

Todo
Unify the intrinsicValues/Payoff thing

Public Member Functions


• AmericanCondition (Option::Type type, double strike)
• AmericanCondition (const Array &intrinsicValues)
• void applyTo (Array &a, Time t) const
• void applyTo (Handle< DiscretizedAsset > asset) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


116 QuantLib Class Documentation

9.9 AmericanExercise Class Reference


#include <ql/exercise.hpp>
Inheritance diagram for AmericanExercise:

Exercise

EarlyExercise

AmericanExercise

9.9.1 Detailed Description

American exercise.
An American option can be exercised at any time between two predefined dates

Todo
check that everywhere the American condition is applied from the earliestDate and not earlier

Public Member Functions


• AmericanExercise (Date earliestDate, Date latestDate, bool payoffAtExpiry=false)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.10 AmericanPayoffAtExpiry Class Reference 117

9.10 AmericanPayoffAtExpiry Class Reference


#include <ql/PricingEngines/americanpayoffatexpiry.hpp>

9.10.1 Detailed Description

Analytic formula for American exercise payoff at-expiry options

Todo
calculate greeks

Public Member Functions


• AmericanPayoffAtExpiry (double spot, double discount, double dividendDiscount, double
variance, const Handle< StrikedTypePayoff > &payoff)
• double value () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


118 QuantLib Class Documentation

9.11 AmericanPayoffAtHit Class Reference


#include <ql/PricingEngines/americanpayoffathit.hpp>

9.11.1 Detailed Description

Analytic formula for American exercise payoff at-hit options

Todo
calculate greeks

Public Member Functions


• AmericanPayoffAtHit (double spot, double discount, double dividendDiscount, double
variance, const Handle< StrikedTypePayoff > &payoff)
• double value () const
• double delta () const
• double gamma () const
• double rho (double maturity) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.12 AnalyticalCapFloor Class Reference 119

9.12 AnalyticalCapFloor Class Reference


#include <ql/PricingEngines/CapFloor/analyticalcapfloor.hpp>
Inheritance diagram for AnalyticalCapFloor:

Observable

PricingEngine

GenericEngine<ArgumentsType, ResultsType> Observer

GenericModelEngine< AffineModel, CapFloor::arguments, CapFloor::results >

AnalyticalCapFloor

9.12.1 Detailed Description

Analytical pricer for cap/floor.

Public Member Functions


• AnalyticalCapFloor (const Handle< AffineModel > &model)
• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


120 QuantLib Class Documentation

9.13 AnalyticBarrierEngine Class Reference


#include <ql/PricingEngines/Barrier/analyticbarrierengine.hpp>
Inheritance diagram for AnalyticBarrierEngine:

Observable

PricingEngine

GenericEngine< BarrierOption::arguments, BarrierOption::results >

BarrierEngine

AnalyticBarrierEngine

9.13.1 Detailed Description

Pricing engine for barrier options using analytical formulae.


The formulas are taken from "Option pricing formulas", E.G. Haug, McGraw-Hill, p.69 and
following.

Public Member Functions


• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.14 AnalyticDigitalAmericanEngine Class Reference 121

9.14 AnalyticDigitalAmericanEngine Class Reference


#include <ql/PricingEngines/Vanilla/analyticdigitalamericanengine.hpp>
Inheritance diagram for AnalyticDigitalAmericanEngine:

Observable

PricingEngine

GenericEngine< VanillaOption::arguments, VanillaOption::results >

VanillaEngine

AnalyticDigitalAmericanEngine

9.14.1 Detailed Description

Pricing engine for American vanilla options with digital payoff using analytic formulae

Todo
add more greeks (as of now only delta and rho available)

Public Member Functions


• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


122 QuantLib Class Documentation

9.15 AnalyticDiscreteAveragingAsianEngine Class Reference


#include <ql/PricingEngines/Asian/analyticasianengine.hpp>
Inheritance diagram for AnalyticDiscreteAveragingAsianEngine:

Observable

PricingEngine

GenericEngine< DiscreteAveragingAsianOption::arguments, DiscreteAveragingAsianOption::results >

DiscreteAveragingAsianEngine

AnalyticDiscreteAveragingAsianEngine

9.15.1 Detailed Description

Pricing engine for European discrete geometric average Asian option.


This class implements a discrete geometric average price asian option, with european exercise.
The formula is from "Asian Option", E. Levy (1997) in "Exotic Options: The State of the Art",
edited by L. Clewlow, C. Strickland, pag 65-97

Public Member Functions


• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.16 AnalyticEuropeanEngine Class Reference 123

9.16 AnalyticEuropeanEngine Class Reference


#include <ql/PricingEngines/Vanilla/analyticeuropeanengine.hpp>
Inheritance diagram for AnalyticEuropeanEngine:

Observable

PricingEngine

GenericEngine< VanillaOption::arguments, VanillaOption::results >

VanillaEngine

AnalyticEuropeanEngine

9.16.1 Detailed Description

Pricing engine for European vanilla options using analytical formulae.

Public Member Functions


• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


124 QuantLib Class Documentation

9.17 Arguments Class Reference


#include <ql/argsandresults.hpp>
Inheritance diagram for Arguments:

Arguments

arguments arguments arguments

arguments arguments arguments

arguments

9.17.1 Detailed Description

base class for generic argument groups

Public Member Functions


• virtual void validate () const=0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.18 ArmijoLineSearch Class Reference 125

9.18 ArmijoLineSearch Class Reference


#include <ql/Optimization/armijo.hpp>
Inheritance diagram for ArmijoLineSearch:

LineSearch

ArmijoLineSearch

9.18.1 Detailed Description

Armijo line search.


Let alpha and beta be 2 scalars in [0,1]. Let x be the current value of the unknow, d the search
direction and t the step. Let f be the function to minimize. The line search stop when t verifies
f(x+t∗d) - f(x) <= -alpha∗t∗f’(x+t∗d) and f(x+t/beta∗d) - f(x) > -alpha∗t∗f’(x+t∗d)/beta
(see Polak. Algorithms and consitent approximations, Optimization, volume 124 of Applied
Mathematical Sciences. Springer-Arrayerlag, N-Y, 1997)

Public Member Functions


• ArmijoLineSearch (double eps=1e-8, double alpha=0.5, double beta=0.65)
Default constructor.

• virtual ∼ArmijoLineSearch ()
Destructor.

• virtual double operator() (const Problem &P, double t_ini)


Perform line search.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


126 QuantLib Class Documentation

9.19 Array Class Reference


#include <ql/Math/array.hpp>

9.19.1 Detailed Description

1-D array used in linear algebra.


This class implements the concept of vector as used in linear algebra. As such, it is not meant to
be used as a container - std::vector should be used instead.

Public Types
• typedef double ∗ iterator
• typedef const double ∗ const_iterator

Public Member Functions


• typedef QL_REVERSE_ITERATOR (iterator, double) reverse_iterator
• typedef QL_REVERSE_ITERATOR (const_iterator, double) const _reverse_iterator

Constructors, destructor, and assignment

• Array (Size size=0)


creates the array with the given dimension

• Array (Size size, double value)


creates the array and fills it with value

• Array (Size size, double value, double increment)


creates the array and fills it according to a0 = value, ai = ai−1 + increment

• Array (const Array &)


• Array (const Disposable< Array > &)
• Array & operator= (const Array &)
• Array & operator= (const Disposable< Array > &)

Vector algebra
v += x and similar operation involving a scalar value are shortcuts for ∀i : vi = vi + x
v ∗= w and similar operation involving two vectors are shortcuts for ∀i : vi = vi × wi

Precondition:
all arrays involved in an algebraic expression must have the same size.

• const Array & operator+= (const Array &)


• const Array & operator+= (double)
• const Array & operator-= (const Array &)
• const Array & operator-= (double)
• const Array & operator ∗= (const Array &)
• const Array & operator ∗= (double)
• const Array & operator/= (const Array &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.19 Array Class Reference 127

• const Array & operator/= (double)

Element access
• double operator[ ] (Size) const
read-only

• double & operator[ ] (Size)


read-write

Inspectors
• Size size () const
dimension of the array

Iterator access
• const_iterator begin () const
• iterator begin ()
• const_iterator end () const
• iterator end ()
• const_reverse_iterator rbegin () const
• reverse_iterator rbegin ()
• const_reverse_iterator rend () const
• reverse_iterator rend ()

Utilities
• void swap (Array &)

Related Functions

(Note that these are not member functions.)

• std::ostream & operator<< (std::ostream &, const Array &)


• double DotProduct (const Array &, const Array &)
• const Disposable< Array > operator+ (const Array &v)
• const Disposable< Array > operator- (const Array &v)
• const Disposable< Array > operator+ (const Array &, const Array &)
• const Disposable< Array > operator+ (const Array &, double)
• const Disposable< Array > operator+ (double, const Array &)
• const Disposable< Array > operator- (const Array &, const Array &)
• const Disposable< Array > operator- (const Array &, double)
• const Disposable< Array > operator- (double, const Array &)
• const Disposable< Array > operator ∗ (const Array &, const Array &)
• const Disposable< Array > operator ∗ (const Array &, double)
• const Disposable< Array > operator ∗ (double, const Array &)
• const Disposable< Array > operator/ (const Array &, const Array &)
• const Disposable< Array > operator/ (const Array &, double)
• const Disposable< Array > operator/ (double, const Array &)
• const Disposable< Array > Abs (const Array &)
• const Disposable< Array > Sqrt (const Array &)
• const Disposable< Array > Log (const Array &)
• const Disposable< Array > Exp (const Array &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


128 QuantLib Class Documentation

9.20 ArrayFormatter Class Reference


#include <ql/dataformatters.hpp>

9.20.1 Detailed Description

Formats arrays for output.

Static Public Member Functions


• template<class DataIterator> std::string toString (DataIterator begin, DataIterator end, int
precision=6, int digits=0, Size elementsPerRow=QL_MAX_INT)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.21 AssertionFailedError Class Reference 129

9.21 AssertionFailedError Class Reference


#include <ql/errors.hpp>
Inheritance diagram for AssertionFailedError:

Error

AssertionFailedError

9.21.1 Detailed Description

Specialized error.
Thrown upon a failed assertion.

Public Member Functions


• AssertionFailedError (const std::string &what="")

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


130 QuantLib Class Documentation

9.22 AssetOrNothingPayoff Class Reference


#include <ql/Instruments/payoffs.hpp>
Inheritance diagram for AssetOrNothingPayoff:

Payoff

TypePayoff

StrikedTypePayoff

AssetOrNothingPayoff

9.22.1 Detailed Description

Binary asset-or-nothing payoff.

Public Member Functions


• AssetOrNothingPayoff (Option::Type type, double strike)
• double operator() (double price) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.23 AUDLibor Class Reference 131

9.23 AUDLibor Class Reference


#include <ql/Indexes/audlibor.hpp>
Inheritance diagram for AUDLibor:

Observable

Index Observer

Xibor

AUDLibor

9.23.1 Detailed Description

AUD Libor index, also known as SIBOR

Todo
check settlement days

Public Member Functions


• AUDLibor (int n, TimeUnit units, const RelinkableHandle< TermStructure > &h, const
DayCounter &dc=Actual365())

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


132 QuantLib Class Documentation

9.24 Average Struct Reference


#include <ql/Instruments/asianoption.hpp>

9.24.1 Detailed Description

placeholder for enumerated averaging types

Public Types
• enum Type { Arithmetic, Geometric }

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.25 BaroneAdesiWhaleyApproximationEngine Class Reference 133

9.25 BaroneAdesiWhaleyApproximationEngine Class Refer-


ence
#include <ql/PricingEngines/Vanilla/baroneadesiwhaleyengine.hpp>
Inheritance diagram for BaroneAdesiWhaleyApproximationEngine:

Observable

PricingEngine

GenericEngine< VanillaOption::arguments, VanillaOption::results >

VanillaEngine

BaroneAdesiWhaleyApproximationEngine

9.25.1 Detailed Description

Pricing engine for American vanilla options with Barone-Adesi and Whaley approximation (1987)

Public Member Functions


• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


134 QuantLib Class Documentation

9.26 Barrier Struct Reference


#include <ql/Instruments/barrieroption.hpp>

9.26.1 Detailed Description

Placeholder for enumerated barrier types.

Public Types
• enum Type { DownIn, UpIn, DownOut, UpOut }

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.27 BarrierEngine Class Reference 135

9.27 BarrierEngine Class Reference


#include <ql/Instruments/barrieroption.hpp>
Inheritance diagram for BarrierEngine:

Observable

PricingEngine

GenericEngine< BarrierOption::arguments, BarrierOption::results >

BarrierEngine

AnalyticBarrierEngine MCBarrierEngine

9.27.1 Detailed Description

Barrier engine base class

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


136 QuantLib Class Documentation

9.28 BarrierOption Class Reference

#include <ql/Instruments/barrieroption.hpp>
Inheritance diagram for BarrierOption:

Observable Observer

LazyObject

Instrument

Option

OneAssetOption

OneAssetStrikedOption

BarrierOption

9.28.1 Detailed Description

Barrier option on a single asset.


The analytic pricing engine will be used if none if passed.

Public Member Functions

• BarrierOption (Barrier::Type barrierType, double barrier, double rebate, const Handle<


BlackScholesStochasticProcess > &stochProc, const Handle< StrikedTypePayoff > &payoff,
const Handle< Exercise > &exercise, const Handle< PricingEngine > &engine=Handle<
PricingEngine >())
• void setupArguments (Arguments ∗) const

Protected Member Functions

• void performCalculations () const

Protected Attributes

• Barrier::Type barrierType_
• double barrier_
• double rebate_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.28 BarrierOption Class Reference 137

9.28.2 Member Function Documentation

9.28.2.1 void setupArguments (Arguments ∗) const [virtual]

When a derived argument structure is defined for an instrument, this method should be overrid-
den to fill it. This is mandatory in case a pricing engine is used.
Reimplemented from OneAssetStrikedOption (p. 482).

9.28.2.2 void performCalculations () const [protected, virtual]

In case a pricing engine is not used, this method must be overridden to perform the actual calcu-
lations and set any needed results. In case a pricing engine is used, the default implementation
can be used.
Reimplemented from OneAssetStrikedOption (p. 482).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


138 QuantLib Class Documentation

9.29 BarrierOption::arguments Class Reference


#include <ql/Instruments/barrieroption.hpp>

9.29.1 Detailed Description

Arguments for barrier option calculation

Public Member Functions


• void validate () const

Public Attributes
• Barrier::Type barrierType
• double barrier
• double rebate

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.30 BasketEngine Class Reference 139

9.30 BasketEngine Class Reference


#include <ql/Instruments/basketoption.hpp>
Inheritance diagram for BasketEngine:

Observable

PricingEngine

GenericEngine< BasketOption::arguments, BasketOption::results >

BasketEngine

MCAmericanBasketEngine MCBasketEngine StulzEngine

9.30.1 Detailed Description

Basket option engine base class

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


140 QuantLib Class Documentation

9.31 BasketOption Class Reference


#include <ql/Instruments/basketoption.hpp>
Inheritance diagram for BasketOption:

Observable Observer

LazyObject

Instrument

Option

MultiAssetOption

BasketOption

9.31.1 Detailed Description

Basket option on a number of assets.

Public Types
• enum BasketType { Min, Max }

Public Member Functions


• BasketOption (const BasketType basketType, const std::vector< Handle< BlackScholes-
StochasticProcess > > &stochProcs, const Handle< PlainVanillaPayoff > &payoff, const
Handle< Exercise > &exercise, const Matrix &correlation, const Handle< PricingEngine >
&engine=Handle< PricingEngine >())
• void setupArguments (Arguments ∗) const

Protected Member Functions


• void performCalculations () const

9.31.2 Member Function Documentation

9.31.2.1 void setupArguments (Arguments ∗) const [virtual]

When a derived argument structure is defined for an instrument, this method should be overrid-
den to fill it. This is mandatory in case a pricing engine is used.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.31 BasketOption Class Reference 141

Reimplemented from MultiAssetOption (p. 452).

9.31.2.2 void performCalculations () const [protected, virtual]

In case a pricing engine is not used, this method must be overridden to perform the actual calcu-
lations and set any needed results. In case a pricing engine is used, the default implementation
can be used.
Reimplemented from MultiAssetOption (p. 452).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


142 QuantLib Class Documentation

9.32 BasketOption::arguments Class Reference


#include <ql/Instruments/basketoption.hpp>
Inheritance diagram for BasketOption::arguments:

Arguments

arguments

arguments

BasketOption::arguments

9.32.1 Detailed Description

Arguments for basket option calculation

Public Member Functions


• void validate () const

Public Attributes
• BasketType basketType

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.33 BermudanExercise Class Reference 143

9.33 BermudanExercise Class Reference


#include <ql/exercise.hpp>
Inheritance diagram for BermudanExercise:

Exercise

EarlyExercise

BermudanExercise

9.33.1 Detailed Description

Bermudan exercise.
A Bermudan option can only be exercised at a set of fixed dates.

Todo
it would be nice to have a way for making a Bermudan with one exercise date equivalent to
an European

Public Member Functions


• BermudanExercise (const std::vector< Date > &dates, bool payoffAtExpiry=false)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


144 QuantLib Class Documentation

9.34 BicubicSpline Class Reference


#include <ql/Math/bicubicsplineinterpolation.hpp>
Inheritance diagram for BicubicSpline:

Bridge< Interpolation2D, Interpolation2DImpl >

Interpolation2D

BicubicSpline

9.34.1 Detailed Description

bicubic spline interpolation between discrete points

Todo
revise end conditions

Public Member Functions


• template<class I1, class I2, class M> BicubicSpline (const I1 &xBegin, const I1 &xEnd, const
I2 &yBegin, const I2 &yEnd, const M &zData)

9.34.2 Constructor & Destructor Documentation

9.34.2.1 BicubicSpline (const I1 & xBegin, const I1 & xEnd, const I2 & yBegin, const I2 &
yEnd, const M & zData)

Precondition:
the x and y values must be sorted.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.35 BicubicSpline::Impl Class Template Reference 145

9.35 BicubicSpline::Impl Class Template Reference


#include <ql/Math/bicubicsplineinterpolation.hpp>
Inheritance diagram for BicubicSpline::Impl:

Interpolation2DImpl

templateImpl<I1,I2,M>

BicubicSpline::Impl

9.35.1 Detailed Description

template<class I1, class I2, class M> class QuantLib::BicubicSpline::Impl< I1, I2, M >

bicubic spline implementation

Public Member Functions


• Impl (const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, const I2 &yEnd, const M &zData)
• double value (double x, double y) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


146 QuantLib Class Documentation

9.36 BilinearInterpolation Class Reference


#include <ql/Math/bilinearinterpolation.hpp>
Inheritance diagram for BilinearInterpolation:

Bridge< Interpolation2D, Interpolation2DImpl >

Interpolation2D

BilinearInterpolation

9.36.1 Detailed Description

bilinear interpolation between discrete points

Public Member Functions


• template<class I1, class I2, class M> BilinearInterpolation (const I1 &xBegin, const I1 &x-
End, const I2 &yBegin, const I2 &yEnd, const M &zData)

9.36.2 Constructor & Destructor Documentation

9.36.2.1 BilinearInterpolation (const I1 & xBegin, const I1 & xEnd, const I2 & yBegin, const I2
& yEnd, const M & zData)

Precondition:
the x and y values must be sorted.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.37 BilinearInterpolation::Impl Class Template Reference 147

9.37 BilinearInterpolation::Impl Class Template Reference


#include <ql/Math/bilinearinterpolation.hpp>
Inheritance diagram for BilinearInterpolation::Impl:

Interpolation2DImpl

templateImpl<I1,I2,M>

BilinearInterpolation::Impl

9.37.1 Detailed Description

template<class I1, class I2, class M> class QuantLib::BilinearInterpolation::Impl< I1, I2, M >

bilinear interpolation implementation

Public Member Functions


• Impl (const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, const I2 &yEnd, const M &zData)
• double value (double x, double y) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


148 QuantLib Class Documentation

9.38 BinomialDistribution Class Reference


#include <ql/Math/binomialdistribution.hpp>

9.38.1 Detailed Description

Binomial probability distribution function.


formula here ... Given an integer k it returns its probability in a Binomial distribution with
parameters p and n.

Public Member Functions


• BinomialDistribution (double p, unsigned long n)
• double operator() (unsigned long k) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.39 BinomialTree Class Reference 149

9.39 BinomialTree Class Reference


#include <ql/Lattices/binomialtree.hpp>
Inheritance diagram for BinomialTree:

Tree

BinomialTree

EqualJumpsBinomialTree EqualProbabilitiesBinomialTree LeisenReimer Tian

CoxRossRubinstein Trigeorgis AdditiveEQPBinomialTree JarrowRudd

9.39.1 Detailed Description

Binomial tree base class.

Public Member Functions


• BinomialTree (const Handle< DiffusionProcess > &process, Time end, Size steps)
• Size size (Size i) const
• Size descendant (Size i, Size index, Size branch) const
• virtual double underlying (Size i, Size index) const=0
• virtual double probability (Size i, Size index, Size branch) const=0

Protected Attributes
• double x0_
• double driftPerStep_
• Time dt_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


150 QuantLib Class Documentation

9.40 BinomialVanillaEngine Class Template Reference


#include <ql/PricingEngines/Vanilla/binomialengine.hpp>
Inheritance diagram for BinomialVanillaEngine:

Observable

PricingEngine

GenericEngine< VanillaOption::arguments, VanillaOption::results >

VanillaEngine

BinomialVanillaEngine

9.40.1 Detailed Description

template<class TreeType> class QuantLib::BinomialVanillaEngine< TreeType >

Pricing engine for vanilla options using binomial trees.

Public Member Functions


• BinomialVanillaEngine (Size timeSteps)
• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.41 Bisection Class Reference 151

9.41 Bisection Class Reference


#include <ql/Solvers1D/bisection.hpp>
Inheritance diagram for Bisection:

CuriouslyRecurringTemplate< Bisection >

Solver1D< Bisection >

Bisection

9.41.1 Detailed Description

Bisection 1-D solver

Public Member Functions


• template<class F> double solveImpl (const F &f, double xAccuracy) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


152 QuantLib Class Documentation

9.42 BivariateCumulativeNormalDistribution Class Reference


#include <ql/Math/bivariatenormaldistribution.hpp>

9.42.1 Detailed Description

Cumulative bivariate normal distribution function.


Drezner (1978) algorithm, six decimal places accuracy.
For this implementation see "Option pricing formulas", E.G. Haug, McGraw-Hill 1998

Todo
check accuracy of this algorithm and compare with: 1) Drezner, Z, (1978), Computation of the
bivariate normal integral, Mathematics of Computation 32, pp. 277-279. 2) Drezner, Z. and
Wesolowsky, G. O. (1990) ‘On the Computation of the Bivariate Normal Integral’, Journal of
Statistical Computation and Simulation 35, pp. 101-107. 3) Drezner, Z (1992) Computation
of the Multivariate Normal Integral, ACM Transactions on Mathematics Software 18, pp.
450-460. 4) Drezner, Z (1994) Computation of the Trivariate Normal Integral, Mathematics of
Computation 62, pp. 289-294. 5) Genz, A. (1992) ‘Numerical Computation of the Multivariate
Normal Probabilities’, J. Comput. Graph. Stat. 1, pp. 141-150.

Public Member Functions


• BivariateCumulativeNormalDistribution (double rho)
• double operator() (double a, double b) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.43 BjerksundStenslandApproximationEngine Class Reference 153

9.43 BjerksundStenslandApproximationEngine Class Refer-


ence
#include <ql/PricingEngines/Vanilla/bjerksundstenslandengine.hpp>
Inheritance diagram for BjerksundStenslandApproximationEngine:

Observable

PricingEngine

GenericEngine< VanillaOption::arguments, VanillaOption::results >

VanillaEngine

BjerksundStenslandApproximationEngine

9.43.1 Detailed Description

Pricing engine for American vanilla options with Bjerksund and Stensland approximation (1993)

Public Member Functions


• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


154 QuantLib Class Documentation

9.44 BlackCapFloor Class Reference


#include <ql/PricingEngines/CapFloor/blackcapfloor.hpp>
Inheritance diagram for BlackCapFloor:

Observable

PricingEngine

GenericEngine<ArgumentsType, ResultsType> Observer

GenericModelEngine< BlackModel, CapFloor::arguments, CapFloor::results >

BlackCapFloor

9.44.1 Detailed Description

Cap/floor priced by means of the Black formula.

Public Member Functions


• BlackCapFloor (const Handle< BlackModel > &mod)
• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.45 BlackConstantVol Class Reference 155

9.45 BlackConstantVol Class Reference


#include <ql/Volatilities/blackconstantvol.hpp>
Inheritance diagram for BlackConstantVol:

Observable

BlackVolTermStructure

BlackVolatilityTermStructure Observer

BlackConstantVol

9.45.1 Detailed Description

Constant Black volatility, no time-strike dependence.


This class implements the BlackVolatilityTermStructure(p. 169) interface for a constant Black
volatility (no time/strike dependence).

Public Member Functions


• BlackConstantVol (const Date &referenceDate, double volatility, const DayCounter &day-
Counter=Actual365())
• BlackConstantVol (const Date &referenceDate, const RelinkableHandle< Quote >
&volatility, const DayCounter &dayCounter=Actual365())

BlackVolTermStructure interface

• Date referenceDate () const


returns the reference date for which t=0

• DayCounter dayCounter () const


returns the day counter

• Date maxDate () const


the latest date for which the term structure can return vols

• double blackForwardVol (Time t1, Time t2, double strike, bool extrapolate=false) const
future (a.k.a. forward) volatility

Observer interface

• void update ()

Visitability

• virtual void accept (AcyclicVisitor &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


156 QuantLib Class Documentation

Protected Member Functions


• virtual double blackVolImpl (Time t, double, bool extrapolate=false) const
implements the actual Black vol calculation in derived classes

9.45.2 Member Function Documentation

9.45.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.46 BlackKarasinski Class Reference 157

9.46 BlackKarasinski Class Reference


#include <ql/ShortRateModels/OneFactorModels/blackkarasinski.hpp>
Inheritance diagram for BlackKarasinski:

Observer Observable

ShortRateModel

OneFactorModel TermStructureConsistentModel

BlackKarasinski

9.46.1 Detailed Description

Standard Black-Karasinski model class.


This class implements the standard Black-Karasinski model defined by

d ln rt = (θ(t) − α ln rt )dt + σdWt ,

where alpha and si1ma are constants.

Public Member Functions


• BlackKarasinski (const RelinkableHandle< TermStructure > &termStructure, double
a=0.1, double sigma=0.1)
• Handle< ShortRateDynamics > dynamics () const
returns the short-rate dynamics

• Handle< Lattice > tree (const TimeGrid &grid) const


Return by default a trinomial recombining tree.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


158 QuantLib Class Documentation

9.47 BlackKarasinski::Dynamics Class Reference


#include <ql/ShortRateModels/OneFactorModels/blackkarasinski.hpp>

9.47.1 Detailed Description

Short-rate dynamics in the Black-Karasinski model.


The short-rate is here
rt = eϕ(t)+xt
where ϕ(t) is the deterministic time-dependent parameter (which can not be determined analyti-
cally) used for term-structure fitting and xt is the state variable following an Ornstein-Uhlenbeck
process.

Public Member Functions


• Dynamics (const Parameter &fitting, double alpha, double sigma)
• double variable (Time t, Rate r) const
• double shortRate (Time t, double x) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.48 BlackModel Class Reference 159

9.48 BlackModel Class Reference


#include <ql/PricingEngines/blackmodel.hpp>
Inheritance diagram for BlackModel:

Observable Observer

BlackModel

9.48.1 Detailed Description

Black-model for vanilla interest-rate derivatives.

Public Member Functions


• BlackModel (const RelinkableHandle< Quote > &volatility, const RelinkableHandle<
TermStructure > &termStructure)
• void update ()
• double volatility () const
• const RelinkableHandle< TermStructure > & termStructure () const

Static Public Member Functions


• double formula (double f, double k, double v, double w)
General Black formula.

• double itmProbability (double f, double k, double v, double w)


In-the-money cash probability.

9.48.2 Member Function Documentation

9.48.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

9.48.2.2 double formula (double f, double k, double v, double w) [static]

General Black formula.


Returns
Black( f, k, v, w) = f wΦ(wd1 ( f, k, v)) − kwΦ(wd2 ( f, k, v)),

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


160 QuantLib Class Documentation

where
ln( f /k) + v2 /2
d1 ( f, k, v) =
v
and
d2 ( f, k, v) = d1 ( f, k, v) − v.

9.48.2.3 double itmProbability (double f, double k, double v, double w) [static]

In-the-money cash probability.


Returns
P( f, k, v, w) = Φ(wd2 ( f, k, v)),
where
ln( f /k) + v2 /2
d1 ( f, k, v) =
v
and
d2 ( f, k, v) = d1 ( f, k, v) − v.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.49 BlackScholesLattice Class Reference 161

9.49 BlackScholesLattice Class Reference


#include <ql/Lattices/bsmlattice.hpp>
Inheritance diagram for BlackScholesLattice:

NumericalMethod

Lattice

BlackScholesLattice

9.49.1 Detailed Description

Simple binomial lattice approximating the Black-Scholes model.

Public Member Functions


• BlackScholesLattice (const Handle< Tree > &tree, Rate riskFreeRate, Time end, Size steps)
• Size size (Size i) const
• DiscountFactor discount (Size i, Size j) const
Discount factor at time t_i and node indexed by index.

• const Handle< Tree > & tree () const

Protected Member Functions


• void stepback (Size i, const Array &values, Array &newValues) const
• Size descendant (Size i, Size index, Size branch) const
Tree(p. 607) properties.

• double probability (Size i, Size index, Size branch) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


162 QuantLib Class Documentation

9.50 BlackScholesProcess Class Reference


#include <ql/diffusionprocess.hpp>
Inheritance diagram for BlackScholesProcess:

DiffusionProcess

BlackScholesProcess

9.50.1 Detailed Description

Black-Scholes diffusion process class.


This class describes the stochastic process governed by

σ(t, S)2
dS(t, S) = (r(t) − q(t) − )dt + σdWt .
2

Todo
revise extrapolation

Public Member Functions


• BlackScholesProcess (const RelinkableHandle< TermStructure > &riskFreeTS, const
RelinkableHandle< TermStructure > &dividendTS, const RelinkableHandle< BlackVol-
TermStructure > &blackVolTS, double s0)
• double drift (Time t, double x) const
returns the drift part of the equation, i.e. µ(t, xt )

• double diffusion (Time t, double x) const

9.50.2 Member Function Documentation

9.50.2.1 double diffusion (Time t, double x) const [virtual]

returns the diffusion part of the equation, i.e. σ(t, xt )


Implements DiffusionProcess (p. 246).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.51 BlackSwaption Class Reference 163

9.51 BlackSwaption Class Reference


#include <ql/PricingEngines/Swaption/blackswaption.hpp>
Inheritance diagram for BlackSwaption:

Observable

PricingEngine

GenericEngine<ArgumentsType, ResultsType> Observer

GenericModelEngine< BlackModel, Swaption::arguments, Swaption::results >

BlackSwaption

9.51.1 Detailed Description

Swaption priced by means of the Black formula

Public Member Functions


• BlackSwaption (const Handle< BlackModel > &mod)
• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


164 QuantLib Class Documentation

9.52 BlackVarianceCurve Class Reference


#include <ql/Volatilities/blackvariancecurve.hpp>
Inheritance diagram for BlackVarianceCurve:

Observable

BlackVolTermStructure

BlackVarianceTermStructure Observer

BlackVarianceCurve

9.52.1 Detailed Description

Black volatility curve modelled as variance curve.


This class calculates time-dependent Black volatilities using as input a vector of (ATM) Black
volatilities observed in the market.
The calculation is performed interpolating on the variance curve. Linear(p. 400) interpolation is
used as default; this can be changed by the setInterpolation() method.
For strike dependence, see BlackVarianceSurface(p. 166).

Todo
check time extrapolation

Public Member Functions


• BlackVarianceCurve (const Date &referenceDate, const std::vector< Date > &dates, const
std::vector< double > &blackVolCurve, const DayCounter &dayCounter=Actual365())

BlackVolTermStructure interface

• Date referenceDate () const


returns the reference date for which t=0

• DayCounter dayCounter () const


returns the day counter

• Date maxDate () const


the latest date for which the term structure can return vols

Modifiers

• template<class Traits> void setInterpolation ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.52 BlackVarianceCurve Class Reference 165

Observer interface

• void update ()

Visitability

• virtual void accept (AcyclicVisitor &)

Protected Member Functions


• virtual double blackVarianceImpl (Time t, double, bool extrapolate=false) const
implements the actual Black variance calculation in derived classes

9.52.2 Member Function Documentation

9.52.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


166 QuantLib Class Documentation

9.53 BlackVarianceSurface Class Reference


#include <ql/Volatilities/blackvariancesurface.hpp>
Inheritance diagram for BlackVarianceSurface:

Observable

BlackVolTermStructure

BlackVarianceTermStructure Observer

BlackVarianceSurface

9.53.1 Detailed Description

Black volatility surface modelled as variance surface.


This class calculates time/strike dependent Black volatilities using as input a matrix of Black
volatilities observed in the market.
The calculation is performed interpolating on the variance surface. Bilinear interpolation is used
as default; this can be changed by the setInterpolation() method.

Todo
check time extrapolation

Public Types
• enum Extrapolation { ConstantExtrapolation, InterpolatorDefaultExtrapolation }

Public Member Functions


• BlackVarianceSurface (const Date &referenceDate, const std::vector< Date >
&dates, const std::vector< double > &strikes, const Matrix &blackVolMatrix, Ex-
trapolation lowerExtrapolation=InterpolatorDefaultExtrapolation, Extrapolation
upperExtrapolation=InterpolatorDefaultExtrapolation, const DayCounter &day-
Counter=Actual365())

BlackVolTermStructure interface

• Date referenceDate () const


returns the reference date for which t=0

• DayCounter dayCounter () const


returns the day counter

• Date maxDate () const


the latest date for which the term structure can return vols

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.53 BlackVarianceSurface Class Reference 167

Modifiers

• template<class Traits> void setInterpolation ()

Observer interface

• void update ()

Visitability

• virtual void accept (AcyclicVisitor &)

Protected Member Functions


• virtual double blackVarianceImpl (Time t, double strike, bool extrapolate=false) const
implements the actual Black variance calculation in derived classes

9.53.2 Member Function Documentation

9.53.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


168 QuantLib Class Documentation

9.54 BlackVarianceTermStructure Class Reference


#include <ql/voltermstructure.hpp>
Inheritance diagram for BlackVarianceTermStructure:

Observable

BlackVolTermStructure

BlackVarianceTermStructure

BlackVarianceCurve BlackVarianceSurface ImpliedVolTermStructure

9.54.1 Detailed Description

Black variance term structure.


This abstract class acts as an adapter to VolTermStructure allowing the programmer to implement
only the blackVarianceImpl(Time, double, bool) method in derived classes.
Volatility are assumed to be expressed on an annual basis.

Public Member Functions


Visitability

• virtual void accept (AcyclicVisitor &)

Protected Member Functions


• double blackVolImpl (Time maturity, double strike, bool extrapolate=false) const

9.54.2 Member Function Documentation

9.54.2.1 double blackVolImpl (Time maturity, double strike, bool extrapolate = false) const
[protected, virtual]

Returns the volatility for the given strike and date calculating it from the variance.
Implements BlackVolTermStructure (p. 171).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.55 BlackVolatilityTermStructure Class Reference 169

9.55 BlackVolatilityTermStructure Class Reference


#include <ql/voltermstructure.hpp>
Inheritance diagram for BlackVolatilityTermStructure:

Observable

BlackVolTermStructure

BlackVolatilityTermStructure

BlackConstantVol

9.55.1 Detailed Description

Black-volatility term structure.


This abstract class acts as an adapter to BlackVolTermStructure(p. 170) allowing the programmer
to implement only the blackVolImpl(Time, double, bool) method in derived classes.
Volatility are assumed to be expressed on an annual basis.

Public Member Functions


Visitability

• virtual void accept (AcyclicVisitor &)

Protected Member Functions


• double blackVarianceImpl (Time maturity, double strike, bool extrapolate=false) const

9.55.2 Member Function Documentation

9.55.2.1 double blackVarianceImpl (Time maturity, double strike, bool extrapolate = false)
const [protected, virtual]

Returns the variance for the given strike and date calculating it from the volatility.
Implements BlackVolTermStructure (p. 171).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


170 QuantLib Class Documentation

9.56 BlackVolTermStructure Class Reference


#include <ql/voltermstructure.hpp>
Inheritance diagram for BlackVolTermStructure:

Observable

BlackVolTermStructure

BlackVarianceTermStructure BlackVolatilityTermStructure

BlackVarianceCurve BlackVarianceSurface ImpliedVolTermStructure BlackConstantVol

9.56.1 Detailed Description

Black-volatility term structure.


This abstract class defines the interface of concrete Black-volatility term structures which will be
derived from this one.
Volatilities are assumed to be expressed on an annual basis.

Public Member Functions


Black Volatility

• double blackVol (const Date &maturity, double strike, bool extrapolate=false) const
present (a.k.a spot) volatility

• double blackVol (Time maturity, double strike, bool extrapolate=false) const


present (a.k.a spot) volatility

• double blackVariance (const Date &maturity, double strike, bool extrapolate=false) const

present (a.k.a spot) variance

• double blackVariance (Time maturity, double strike, bool extrapolate=false) const


present (a.k.a spot) variance

• double blackForwardVol (const Date &date1, const Date &date2, double strike, bool
extrapolate=false) const
future (a.k.a. forward) volatility

• double blackForwardVol (Time time1, Time time2, double strike, bool extrapolate=false)
const
future (a.k.a. forward) volatility

• double blackForwardVariance (const Date &date1, const Date &date2, double strike,
bool extrapolate=false) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.56 BlackVolTermStructure Class Reference 171

future (a.k.a. forward) variance

• double blackForwardVariance (Time time1, Time time2, double strike, bool extrapo-
late=false) const
future (a.k.a. forward) variance

Dates

• virtual Date referenceDate () const=0


returns the reference date for which t=0

• virtual DayCounter dayCounter () const=0


returns the day counter

• virtual Date maxDate () const=0


the latest date for which the term structure can return vols

• Time maxTime () const


the latest time for which the term structure can return vols

Visitability

• virtual void accept (AcyclicVisitor &)

Protected Member Functions


• virtual double blackVarianceImpl (Time t, double strike, bool extrapolate=false) const=0
implements the actual Black variance calculation in derived classes

• virtual double blackVolImpl (Time t, double strike, bool extrapolate=false) const=0


implements the actual Black vol calculation in derived classes

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


172 QuantLib Class Documentation

9.57 BoundaryCondition Class Template Reference


#include <ql/FiniteDifferences/boundarycondition.hpp>

9.57.1 Detailed Description

template<class Operator> class QuantLib::BoundaryCondition< Operator >

Abstract boundary condition class for finite difference problems.

Public Types
• typedef Operator operatorType
• typedef Operator::arrayType arrayType
• enum Side { None, Upper, Lower }

Public Member Functions


• virtual void applyBeforeApplying (operatorType &) const=0
• virtual void applyAfterApplying (arrayType &) const=0
• virtual void applyBeforeSolving (operatorType &, arrayType &rhs) const=0
• virtual void applyAfterSolving (arrayType &) const=0
• virtual void setTime (Time t)=0

9.57.2 Member Enumeration Documentation

9.57.2.1 enum Side

Todo
Generalize for n-dimensional conditions

9.57.3 Member Function Documentation

9.57.3.1 virtual void applyBeforeApplying (operatorType &) const [pure virtual]

This method modifies an operator L before it is applied to an array u so that v = Lu will satisfy
the given condition.

9.57.3.2 virtual void applyAfterApplying (arrayType &) const [pure virtual]

This method modifies an array u so that it satisfies the given condition.

9.57.3.3 virtual void applyBeforeSolving (operatorType &, arrayType & rhs) const [pure
virtual]

This method modifies an operator L before the linear system Lu0 = u is solved so that u0 will
satisfy the given condition.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.57 BoundaryCondition Class Template Reference 173

9.57.3.4 virtual void applyAfterSolving (arrayType &) const [pure virtual]

This method modifies an array u so that it satisfies the given condition.

9.57.3.5 virtual void setTime (Time t) [pure virtual]

This method sets the current time for time-dependent boundary conditions.
Implemented in NeumannBC (p. 460), and DirichletBC (p. 248).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


174 QuantLib Class Documentation

9.58 BoundaryConstraint Class Reference


#include <ql/Optimization/constraint.hpp>
Inheritance diagram for BoundaryConstraint:

Bridge< Constraint, ConstraintImpl >

Constraint

BoundaryConstraint

9.58.1 Detailed Description

Constraint imposing all arguments to be in [low,high]

Public Member Functions


• BoundaryConstraint (double low, double high)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.59 BoxMullerGaussianRng Class Template Reference 175

9.59 BoxMullerGaussianRng Class Template Reference


#include <ql/RandomNumbers/boxmullergaussianrng.hpp>

9.59.1 Detailed Description

template<class RNG> class QuantLib::BoxMullerGaussianRng< RNG >

Gaussian random number generator.


It uses the well-known Box-Muller transformation to return a normal distributed Gaussian deviate
with average 0.0 and standard deviation of 1.0, from a uniform deviate in (0,1) supplied by RNG.
Class RNG must implement the following interface:

RNG::sample_type RNG::next() const;

Public Types
• typedef Sample< double > sample_type

Public Member Functions


• BoxMullerGaussianRng (const RNG &uniformGenerator)
• BoxMullerGaussianRng (long seed=0)
• sample_type next () const
returns next sample from the Gaussian distribution

9.59.2 Constructor & Destructor Documentation

9.59.2.1 BoxMullerGaussianRng (long seed = 0) [explicit]

Deprecated
initialize with a random number generator instead.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


176 QuantLib Class Documentation

9.60 BPSBasketCalculator Class Reference


#include <ql/CashFlows/basispointsensitivity.hpp>
Inheritance diagram for BPSBasketCalculator:

AcyclicVisitor Visitor< CashFlow > Visitor< Coupon > Visitor< FixedRateCoupon >

BPSBasketCalculator

9.60.1 Detailed Description


Bug
This class must still be checked. It is not guaranteed to yield the right results.

Public Member Functions


• BPSBasketCalculator (const RelinkableHandle< TermStructure > &ts, int basis)
• const TimeBasket & result () const

Visitor interface

• double sensfactor (const Date &date) const


• virtual void visit (Coupon &)
• virtual void visit (FixedRateCoupon &)
• virtual void visit (CashFlow &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.61 BPSCalculator Class Reference 177

9.61 BPSCalculator Class Reference


#include <ql/CashFlows/basispointsensitivity.hpp>
Inheritance diagram for BPSCalculator:

AcyclicVisitor Visitor< CashFlow > Visitor< Coupon >

BPSCalculator

9.61.1 Detailed Description

basis point sensitivity (BPS) calculator


Instances of this class accumulate the BPS of each cash flow they visit, returning the sum through
their result() method.

Public Member Functions


• BPSCalculator (const RelinkableHandle< TermStructure > &ts)
• double result () const

Visitor interface

• virtual void visit (Coupon &)


• virtual void visit (CashFlow &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


178 QuantLib Class Documentation

9.62 Brent Class Reference


#include <ql/Solvers1D/brent.hpp>
Inheritance diagram for Brent:

CuriouslyRecurringTemplate< Brent >

Solver1D< Brent >

Brent

9.62.1 Detailed Description

Brent 1-D solver

Public Member Functions


• template<class F> double solveImpl (const F &f, double xAccuracy) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.63 Bridge Class Template Reference 179

9.63 Bridge Class Template Reference


#include <ql/Patterns/bridge.hpp>

9.63.1 Detailed Description

template<class T, class T_impl> class QuantLib::Bridge< T, T_impl >

The Bridge pattern made explicit.


The typical use of this class is:

class FooImpl;
class Foo : public Bridge<Foo,FooImpl> {
...
};

which makes it possible to pass instances of class Foo by value while retaining polymorphic
behavior.

Public Types
• typedef T_impl Impl

Public Member Functions


• bool isNull () const

Protected Member Functions


• Bridge (const Handle< Impl > &impl=Handle< Impl >())

Protected Attributes
• Handle< Impl > impl_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


180 QuantLib Class Documentation

9.64 BrownianBridge Class Template Reference


#include <ql/MonteCarlo/brownianbridge.hpp>

9.64.1 Detailed Description

template<class GSG> class QuantLib::BrownianBridge< GSG >

Builds Wiener process paths using Gaussian variates.


For more details: "Monte Carlo Methods in Finance" by P. Jäckel, section 10.8.3

Public Types
• typedef Sample< std::vector< double > > sample_type

Public Member Functions


• BrownianBridge (const GSG &generator)
normalised (unit time, unit variance) Wiener process paths

• BrownianBridge (Time length, Size timeSteps, const GSG &generator)


unit variance Wiener process paths

• BrownianBridge (const TimeGrid &timeGrid, const GSG &generator)


unit variance Wiener process paths

• BrownianBridge (const std::vector< double > &sigma, const TimeGrid &timeGrid, const
GSG &generator)
general Wiener process paths

• BrownianBridge (const Handle< BlackVolTermStructure > &blackVol, const TimeGrid


&timeGrid, const GSG &generator)
• BrownianBridge (const Handle< DiffusionProcess > &diffProcess, const TimeGrid &time-
Grid, const GSG &generator)

inspectors

• const sample_type & next () const


• const sample_type & last () const
• Size size () const
• const TimeGrid & timeGrid () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.65 BSMOperator Class Reference 181

9.65 BSMOperator Class Reference


#include <ql/FiniteDifferences/bsmoperator.hpp>
Inheritance diagram for BSMOperator:

TridiagonalOperator

BSMOperator

9.65.1 Detailed Description

Black-Scholes-Merton differential operator.

Public Member Functions


• BSMOperator (Size size, double dx, double r, double q, double sigma)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


182 QuantLib Class Documentation

9.66 Budapest Class Reference


#include <ql/Calendars/budapest.hpp>
Inheritance diagram for Budapest:

Bridge< Calendar, CalendarImpl >

Calendar

Budapest

9.66.1 Detailed Description

Budapest calendar
Holidays:

• Saturdays
• Sundays
• Easter Monday
• Whit(Pentecost) Monday
• New Year’s Day, January 1st
• National Day, March 15th
• Labour Day, May 1st
• Constitution Day, August 20th
• Republic Day, October 23rd
• All Saints Day, November 1st
• Christmas, December 25th
• 2nd Day of Christmas, December 26th

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.67 CADLibor Class Reference 183

9.67 CADLibor Class Reference


#include <ql/Indexes/cadlibor.hpp>
Inheritance diagram for CADLibor:

Observable

Index Observer

Xibor

CADLibor

9.67.1 Detailed Description

CAD Libor index, also known as CDOR

Todo
check settlement days

Public Member Functions


• CADLibor (int n, TimeUnit units, const RelinkableHandle< TermStructure > &h, const
DayCounter &dc=Actual365())

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


184 QuantLib Class Documentation

9.68 Calendar Class Reference


#include <ql/calendar.hpp>
Inheritance diagram for Calendar:

Budapest

Copenhagen

Frankfurt

Helsinki

Johannesburg

JointCalendar

London

Milan

NewYork

Bridge< Calendar, CalendarImpl > Calendar NullCalendar

Oslo

Stockholm

Sydney

TARGET

Tokyo

Toronto

Warsaw

Wellington

Zurich

9.68.1 Detailed Description

calendar class
This class provides methods for determining whether a date is a business day or a holiday for a
given market, and for incrementing/decrementing a date of a given number of business days.
The Bridge(p. 179) pattern is used to provide the base behavior of the calendar, namely, to
determine whether a date is a business day.

Public Member Functions


• Calendar ()

Calendar interface

• std::string name () const


Returns the name of the calendar.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.68 Calendar Class Reference 185

• bool isBusinessDay (const Date &d) const


• bool isEndOfMonth (const Date &d) const
• bool isHoliday (const Date &d) const
• Date roll (const Date &, RollingConvention convention=Following, const Date &ori-
gin=Date()) const
• Date advance (const Date &, int n, TimeUnit unit, RollingConvention conven-
tion=Following) const
• Date advance (const Date &date, const Period &period, RollingConvention convention)
const

Protected Member Functions


• Calendar (const Handle< CalendarImpl > &impl)

Related Functions

(Note that these are not member functions.)

• bool operator== (const Calendar &, const Calendar &)


• bool operator!= (const Calendar &, const Calendar &)

9.68.2 Constructor & Destructor Documentation

9.68.2.1 Calendar ()

This default constructor returns a calendar with a null implementation, which is therefore unus-
able except as a placeholder.

9.68.2.2 Calendar (const Handle< CalendarImpl > & impl) [protected]

This protected constructor will only be invoked by derived classes which define a given Calen-
dar(p. 184) implementation

9.68.3 Member Function Documentation

9.68.3.1 std::string name () const

Returns the name of the calendar.

Warning:
This method is used for output and comparison between calendars. It is not meant to be
used for writing switch-on-type code.

9.68.3.2 bool isBusinessDay (const Date & d) const

Returns true iff the date is a business day for the given market.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


186 QuantLib Class Documentation

9.68.3.3 bool isEndOfMonth (const Date & d) const

Returns true iff the date is last business day for the month in given market.

9.68.3.4 bool isHoliday (const Date & d) const

Returns true iff the date is a holiday for the given market.

9.68.3.5 Date roll (const Date &, RollingConvention convention = Following, const Date &
origin = Date()) const

Returns the next business day on the given market with respect to the given date and convention.

9.68.3.6 Date advance (const Date &, int n, TimeUnit unit, RollingConvention convention =
Following) const

Advances the given date of the given number of business days and returns the result.

Note:
The input date is not modified.

9.68.3.7 Date advance (const Date & date, const Period & period, RollingConvention
convention) const

Advances the given date as specified by the given period and returns the result.

Note:
The input date is not modified.

9.68.4 Friends And Related Function Documentation

9.68.4.1 bool operator== (const Calendar &, const Calendar &) [related]

Returns true iff the two calendars belong to the same derived class.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.69 Calendar::WesternImpl Class Reference 187

9.69 Calendar::WesternImpl Class Reference


#include <ql/calendar.hpp>
Inheritance diagram for Calendar::WesternImpl:

CalendarImpl

Calendar::WesternImpl

9.69.1 Detailed Description

partial calendar implementation


This class provides the means of determining the Easter Monday for a given year.

Static Protected Member Functions


• Day easterMonday (Year y)
expressed relative to first day of year

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


188 QuantLib Class Documentation

9.70 CalendarImpl Class Reference


#include <ql/calendar.hpp>
Inheritance diagram for CalendarImpl:

CalendarImpl

WesternImpl

9.70.1 Detailed Description

abstract base class for calendar implementations

Public Member Functions


• virtual std::string name () const=0
• virtual bool isBusinessDay (const Date &) const=0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.71 CalibrationHelper Class Reference 189

9.71 CalibrationHelper Class Reference

#include <ql/ShortRateModels/calibrationhelper.hpp>
Inheritance diagram for CalibrationHelper:

Observer Observable

CalibrationHelper

9.71.1 Detailed Description

liquid market instrument used during calibration

Public Member Functions

• CalibrationHelper (const RelinkableHandle< Quote > &volatility, const Relinkable-


Handle< TermStructure > &termStructure)
• void update ()
• double marketValue ()
returns the actual price of the instrument (from volatility)

• virtual double modelValue ()=0


returns the price of the instrument according to the model

• virtual double calibrationError ()


returns the error resulting from the model valuation

• virtual void addTimesTo (std::list< Time > &times) const=0


• double impliedVolatility (double targetValue, double accuracy, Size maxEvaluations, dou-
ble minVol, double maxVol) const
Black volatility implied by the model.

• virtual double blackPrice (double volatility) const=0


Black price given a volatility.

• void setPricingEngine (const Handle< PricingEngine > &engine)

Protected Attributes

• double marketValue_
• RelinkableHandle< Quote > volatility_
• RelinkableHandle< TermStructure > termStructure_
• Handle< BlackModel > blackModel_
• Handle< PricingEngine > engine_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


190 QuantLib Class Documentation

9.71.2 Member Function Documentation

9.71.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.72 CalibrationSet Class Reference 191

9.72 CalibrationSet Class Reference


#include <ql/ShortRateModels/calibrationhelper.hpp>

9.72.1 Detailed Description

Set of calibration instruments.


For the moment, this is just here to facilitate the assignment of a pricing engine to a set of
calibration helpers

Public Member Functions


• void setPricingEngine (const Handle< PricingEngine > &engine)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


192 QuantLib Class Documentation

9.73 Cap Class Reference


#include <ql/Instruments/capfloor.hpp>
Inheritance diagram for Cap:

Observable Observer

LazyObject

Instrument

CapFloor

Cap

9.73.1 Detailed Description

Concrete cap class.

Public Member Functions


• Cap (const std::vector< Handle< CashFlow > > &floatingLeg, const std::vector< Rate
> &exerciseRates, const RelinkableHandle< TermStructure > &termStructure, const
Handle< PricingEngine > &engine)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.74 CapFlatVolatilityStructure Class Reference 193

9.74 CapFlatVolatilityStructure Class Reference


#include <ql/capvolstructures.hpp>
Inheritance diagram for CapFlatVolatilityStructure:

Observable

CapFlatVolatilityStructure

CapFlatVolatilityVector

9.74.1 Detailed Description

Cap/floor flat volatility structure.


This class is purely abstract and defines the interface of concrete structures which will be derived
from this one.

Public Member Functions


• virtual Date todaysDate () const=0
returns today’s date

• virtual Date settlementDate () const=0


returns the settlement date

• virtual DayCounter dayCounter () const=0


returns the day counter used for internal date/time conversions

• double volatility (const Date &end, Rate strike) const


returns the volatility for a given end date and strike rate

• double volatility (const Period &length, Rate strike) const


returns the volatility for a given cap/floor length and strike rate

• double volatility (Time t, Rate strike) const


returns the volatility for a given end time and strike rate

Protected Member Functions


• virtual double volatilityImpl (Time length, Rate strike) const=0
implements the actual volatility calculation in derived classes

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


194 QuantLib Class Documentation

9.75 CapFlatVolatilityVector Class Reference


#include <ql/Volatilities/capflatvolvector.hpp>
Inheritance diagram for CapFlatVolatilityVector:

Observable

CapFlatVolatilityStructure

CapFlatVolatilityVector

9.75.1 Detailed Description

Cap/floor at-the-money flat volatility vector.


This class provides the at-the-money volatility for a given cap by interpolating a volatility vector
whose elements are the market volatilities of a set of caps/floors with given length.

Todo
Either add correct copy behavior or inhibit copy. Right now, a copied instance would end up
with its own copy of the length vector but an interpolation pointing to the original ones.

Public Member Functions


• CapFlatVolatilityVector (const Date &todaysDate, const Calendar &calendar, int
settlementDays, const std::vector< Period > &lengths, const std::vector< double > &volatil-
ities, const DayCounter &dayCounter=Thirty360())
• Date todaysDate () const
returns today’s date

• Date settlementDate () const


returns the settlement date

• DayCounter dayCounter () const


returns the day counter used for internal date/time conversions

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.76 CapFloor Class Reference 195

9.76 CapFloor Class Reference


#include <ql/Instruments/capfloor.hpp>
Inheritance diagram for CapFloor:

Observable Observer

LazyObject

Instrument

CapFloor

Cap Collar Floor

9.76.1 Detailed Description

Base class for cap-like instruments.

Public Types
• enum Type { Cap, Floor, Collar }

Public Member Functions


• CapFloor (Type type, const std::vector< Handle< CashFlow > > &floatingLeg, const
std::vector< Rate > &capRates, const std::vector< Rate > &floorRates, const Relinkable-
Handle< TermStructure > &termStructure, const Handle< PricingEngine > &engine)
• void setupArguments (Arguments ∗) const
• double impliedVolatility (double price, double accuracy=1.0e-4, Size maxEvaluations=100,
double minVol=QL_MIN_VOLATILITY, double maxVol=QL_MAX_VOLATILITY) const
implied term volatility

Instrument interface

• bool isExpired () const


returns whether the instrument is still tradable.

Inspectors

• Type type () const


• const std::vector< Handle< CashFlow > > & leg () const
• const std::vector< Rate > & capRates () const
• const std::vector< Rate > & floorRates () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


196 QuantLib Class Documentation

9.76.2 Member Function Documentation

9.76.2.1 void setupArguments (Arguments ∗) const [virtual]

When a derived argument structure is defined for an instrument, this method should be overrid-
den to fill it. This is mandatory in case a pricing engine is used.
Reimplemented from Instrument (p. 368).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.77 CapFloor::arguments Class Reference 197

9.77 CapFloor::arguments Class Reference


#include <ql/Instruments/capfloor.hpp>
Inheritance diagram for CapFloor::arguments:

Arguments

CapFloor::arguments

9.77.1 Detailed Description

Arguments for cap/floor calculation

Public Member Functions


• void validate () const

Public Attributes
• CapFloor::Type type
• std::vector< Time > startTimes
• std::vector< Time > fixingTimes
• std::vector< Time > endTimes
• std::vector< Time > accrualTimes
• std::vector< Rate > capRates
• std::vector< Rate > floorRates
• std::vector< Rate > forwards
• std::vector< double > nominals

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


198 QuantLib Class Documentation

9.78 CapFloor::results Class Reference


#include <ql/Instruments/capfloor.hpp>
Inheritance diagram for CapFloor::results:

Results

Value

CapFloor::results

9.78.1 Detailed Description

Results from cap/floor calculation

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.79 CapletForwardVolatilityStructure Class Reference 199

9.79 CapletForwardVolatilityStructure Class Reference


#include <ql/capvolstructures.hpp>
Inheritance diagram for CapletForwardVolatilityStructure:

Observable

CapletForwardVolatilityStructure

9.79.1 Detailed Description

Caplet/floorlet forward volatility structure.


This class is purely abstract and defines the interface of concrete structures which will be derived
from this one.

Public Member Functions


• virtual Date todaysDate () const=0
returns today’s date

• virtual Date settlementDate () const=0


returns the settlement date

• virtual DayCounter dayCounter () const=0


returns the day counter used for internal date/time conversions

• double volatility (const Date &start, Rate strike) const


returns the volatility for a given start date and strike rate

• double volatility (Time t, Rate strike) const


returns the volatility for a given start time and strike rate

Protected Member Functions


• virtual double volatilityImpl (Time length, Rate strike) const=0
implements the actual volatility calculation in derived classes

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


200 QuantLib Class Documentation

9.80 CashFlow Class Reference


#include <ql/cashflow.hpp>
Inheritance diagram for CashFlow:

Observable

CashFlow

Coupon SimpleCashFlow

FixedRateCoupon FloatingRateCoupon

IndexedCoupon ParCoupon

InArrearIndexedCoupon UpFrontIndexedCoupon ShortFloatingRateCoupon

9.80.1 Detailed Description

Base class for cash flows.


This class is purely virtual and acts as a base class for the actual cash flow implementations.

Public Member Functions


CashFlow interface
• virtual double amount () const=0
returns the amount of the cash flow

• virtual Date date () const=0


returns the date at which the cash flow is settled

Visitability
• virtual void accept (AcyclicVisitor &)

9.80.2 Member Function Documentation

9.80.2.1 virtual double amount () const [pure virtual]

returns the amount of the cash flow


Note:
The amount is not discounted, i.e., it is the actual amount paid at the cash flow date.

Implemented in FixedRateCoupon (p. 304), IndexedCoupon (p. 365), ParCoupon (p. 500), Short-
FloatingRateCoupon (p. 549), and SimpleCashFlow (p. 553).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.81 CashOrNothingPayoff Class Reference 201

9.81 CashOrNothingPayoff Class Reference


#include <ql/Instruments/payoffs.hpp>
Inheritance diagram for CashOrNothingPayoff:

Payoff

TypePayoff

StrikedTypePayoff

CashOrNothingPayoff

9.81.1 Detailed Description

Binary cash-or-nothing payoff.

Public Member Functions


• CashOrNothingPayoff (Option::Type type, double strike, double cashPayoff)
• double operator() (double price) const
• double cashPayoff () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


202 QuantLib Class Documentation

9.82 CHFLibor Class Reference


#include <ql/Indexes/chflibor.hpp>
Inheritance diagram for CHFLibor:

Observable

Index Observer

Xibor

CHFLibor

9.82.1 Detailed Description

CHF Libor index, also known as ZIBOR

Todo
check settlement days and day-count

Public Member Functions


• CHFLibor (int n, TimeUnit units, const RelinkableHandle< TermStructure > &h, const
DayCounter &dc=Actual360())

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.83 CLGaussianRng Class Template Reference 203

9.83 CLGaussianRng Class Template Reference


#include <ql/RandomNumbers/centrallimitgaussianrng.hpp>

9.83.1 Detailed Description

template<class RNG> class QuantLib::CLGaussianRng< RNG >

Gaussian random number generator.


It uses the well-known fact that the sum of 12 uniform deviate in (-.5,.5) is approximately a
Gaussian deviate with average 0 and standard deviation 1. The uniform deviate is supplied by
RNG.
Class RNG must implement the following interface:

RNG::sample_type RNG::next() const;

Public Types
• typedef Sample< double > sample_type

Public Member Functions


• CLGaussianRng (const RNG &uniformGenerator)
• CLGaussianRng (long seed=0)
• sample_type next () const
returns next sample from the Gaussian distribution

9.83.2 Constructor & Destructor Documentation

9.83.2.1 CLGaussianRng (long seed = 0) [explicit]

Deprecated
initialize with a random number generator instead.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


204 QuantLib Class Documentation

9.84 CliquetEngine Class Reference


#include <ql/Instruments/cliquetoption.hpp>
Inheritance diagram for CliquetEngine:

Observable

PricingEngine

GenericEngine< CliquetOption::arguments, VanillaOption::results >

CliquetEngine

9.84.1 Detailed Description

Cliquet engine base class.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.85 CliquetOption::arguments Class Reference 205

9.85 CliquetOption::arguments Class Reference


#include <ql/Instruments/cliquetoption.hpp>

9.85.1 Detailed Description

Arguments for cliquet option calculation

Public Member Functions


• void validate () const

Public Attributes
• double moneyness
• double accruedCoupon
• double lastFixing
• double localCap
• double localFloor
• double globalCap
• double globalFloor
• std::vector< Date > resetDates

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


206 QuantLib Class Documentation

9.86 CliquetOptionPricer Class Reference


#include <ql/Pricers/cliquetoption.hpp>

9.86.1 Detailed Description

cliquet (Ratchet) option


A cliquet option, also known as Ratchet option, is a series of forward-starting (a.k.a. deferred
strike) options where the strike for each forward start option is set equal to a fixed percentage of
the spot price at the beginning of each period.
In the particular case in which only two dates are given the cliquet option is the same as a
forward-starting option starting at the first date and expiring at the second date.

Public Member Functions


• CliquetOptionPricer (Option::Type type, double underlying, double moneyness, const
std::vector< Spread > &dividendYield, const std::vector< Rate > &riskFreeRate, const
std::vector< Time > &times, const std::vector< double > &volatility)
• double value () const
• double delta () const
• double gamma () const
• double theta () const
• double vega () const
• double rho () const
• double dividendRho () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.87 Collar Class Reference 207

9.87 Collar Class Reference


#include <ql/Instruments/capfloor.hpp>
Inheritance diagram for Collar:

Observable Observer

LazyObject

Instrument

CapFloor

Collar

9.87.1 Detailed Description

Concrete collar class.

Public Member Functions


• Collar (const std::vector< Handle< CashFlow > > &floatingLeg, const std::vector< Rate
> &capRates, const std::vector< Rate > &floorRates, const RelinkableHandle< Term-
Structure > &termStructure, const Handle< PricingEngine > &engine)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


208 QuantLib Class Documentation

9.88 combining_iterator Class Template Reference


#include <ql/Utilities/combiningiterator.hpp>

9.88.1 Detailed Description

template<class Iterator, class Function> class QuantLib::combining_iterator< Iterator, Func-


tion >

Iterator mapping a function to a set of underlying sequences.


This iterator advances a set of underlying iterators and returns the values obtained by applying
a function to the sets of values such iterators point to.
This class was implemented based on Christopher Baus and Thomas Becker, Custom Iterators
for the STL, included in the proceedings of the First Workshop on C++ Template Programming,
Erfurt, Germany, 2000 (http://www.oonumerics.org/tmpw00/)

Public Types
• typedef Function::result_type value_type
• typedef const Function::result_type ∗ pointer
• typedef const Function::result_type & reference

Public Member Functions


• template<class IteratorCollectionIterator> combining_iterator (IteratorCollectionIterator
it1, IteratorCollectionIterator it2, Function f)

Dereferencing

• reference operator ∗ () const


• pointer operator → () const

Random access

• value_type operator[ ] (difference_type n) const

Increment and decrement

• combining_iterator & operator++ ()


• combining_iterator operator++ (int)
• combining_iterator & operator– ()
• combining_iterator operator– (int)
• combining_iterator & operator+= (difference_type n)
• combining_iterator & operator-= (difference_type n)
• combining_iterator operator+ (difference_type n) const
• combining_iterator operator- (difference_type n) const

Difference

• difference_type operator- (const combining_iterator< Iterator, Function > &rhs) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.88 combining_iterator Class Template Reference 209

Comparisons

• bool operator== (const combining_iterator< Iterator, Function > &rhs) const


• bool operator!= (const combining_iterator< Iterator, Function > &rhs) const

Public Attributes
• typedef< Iterator >::difference_type difference_type

Related Functions

(Note that these are not member functions.)

• combining_iterator< typename 1< It >::value_type, Function > make_combining_iterator


(It it1, It it2, Function f)
helper function to create combining iterators

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


210 QuantLib Class Documentation

9.89 Composite Class Template Reference


#include <ql/Patterns/composite.hpp>

9.89.1 Detailed Description

template<class T> class QuantLib::Composite< T >

Composite pattern.
The typical use of this class is:

class CompositeFoo : public Composite<Foo> {


...
};

which causes CompositeFoo to inherit from Foo and provides it with methods for adding com-
ponents. Of course, any abstract Foo interface must still be implemented.

Protected Types
• typedef std::list< Handle< T > >::iterator iterator
• typedef std::list< Handle< T > >::const_iterator const_iterator

Protected Member Functions


• void add (const Handle< T > &c)

Protected Attributes
• std::list< Handle< T > > components_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.90 CompositeConstraint Class Reference 211

9.90 CompositeConstraint Class Reference


#include <ql/Optimization/constraint.hpp>
Inheritance diagram for CompositeConstraint:

Bridge< Constraint, ConstraintImpl >

Constraint

CompositeConstraint

9.90.1 Detailed Description

Constraint enforcing both given sub-constraints

Public Member Functions


• CompositeConstraint (const Constraint &c1, const Constraint &c2)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


212 QuantLib Class Documentation

9.91 CompositeQuote Class Template Reference


#include <ql/marketelement.hpp>
Inheritance diagram for CompositeQuote:

Observable

Quote Observer

CompositeQuote

9.91.1 Detailed Description

template<class BinaryFunction> class QuantLib::CompositeQuote< BinaryFunction >

market element whose value depends on two other market element

Public Member Functions


• CompositeQuote (const RelinkableHandle< Quote > &element1, const Relinkable-
Handle< Quote > &element2, const BinaryFunction &f)

Quote interface

• double value () const


returns the current value

Observer interface

• void update ()

9.91.2 Member Function Documentation

9.91.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.92 ConjugateGradient Class Reference 213

9.92 ConjugateGradient Class Reference


#include <ql/Optimization/conjugategradient.hpp>
Inheritance diagram for ConjugateGradient:

OptimizationMethod

ConjugateGradient

9.92.1 Detailed Description

Multi-dimensional Conjugate Gradient class.


User has to provide line-search method and optimization end criteria
search direction di = − f 0 (xi ) + ci ∗ di−1 where ci = || f 0 (xi )||2 /|| f 0 (xi−1 )||2 and d1 = − f 0 (x1 )

Public Member Functions


• ConjugateGradient ()
default constructor

• ConjugateGradient (const Handle< LineSearch > &lineSearch)


• virtual ∼ConjugateGradient ()
destructor

• virtual void minimize (const Problem &P) const


minimize the optimization problem P

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


214 QuantLib Class Documentation

9.93 ConstantParameter Class Reference


#include <ql/ShortRateModels/parameter.hpp>
Inheritance diagram for ConstantParameter:

Bridge< Parameter, ParameterImpl >

Parameter

ConstantParameter

9.93.1 Detailed Description

Standard constant parameter a(t) = a.

Public Member Functions


• ConstantParameter (const Constraint &constraint)
• ConstantParameter (double value, const Constraint &constraint)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.94 Constraint Class Reference 215

9.94 Constraint Class Reference


#include <ql/Optimization/constraint.hpp>
Inheritance diagram for Constraint:

Bridge< Constraint, ConstraintImpl >

Constraint

BoundaryConstraint CompositeConstraint NoConstraint PositiveConstraint

9.94.1 Detailed Description

Base constraint class.

Public Member Functions


• bool test (const Array &p) const
• double update (Array &p, const Array &direction, double beta)
• Constraint (const Handle< ConstraintImpl > &impl=Handle< ConstraintImpl >())

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


216 QuantLib Class Documentation

9.95 ConstraintImpl Class Reference


#include <ql/Optimization/constraint.hpp>

9.95.1 Detailed Description

Base class for constraint implementations.

Public Member Functions


• virtual bool test (const Array &params) const=0
Tests if params satisfy the constraint.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.96 ContinuousGeometricAPO Class Reference 217

9.96 ContinuousGeometricAPO Class Reference


#include <ql/Pricers/continuousgeometricapo.hpp>
Inheritance diagram for ContinuousGeometricAPO:

SingleAssetOption

EuropeanOption

ContinuousGeometricAPO

9.96.1 Detailed Description

Continuous geometric average-price option (European exercise).


This class implements a continuous geometric average price asian option with european exercise.
The formula is from "Option Pricing Formulas", E. G. Haug (1997) pag 96-97

Todo
add Average(p. 132) Strike version and make it backward starting

Public Member Functions


• ContinuousGeometricAPO (Option::Type type, double underlying, double strike, Spread
dividendYield, Rate riskFreeRate, Time residualTime, double volatility)
• double vega () const
• double rho () const
• Handle< SingleAssetOption > clone () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


218 QuantLib Class Documentation

9.97 Copenhagen Class Reference


#include <ql/Calendars/copenhagen.hpp>
Inheritance diagram for Copenhagen:

Bridge< Calendar, CalendarImpl >

Calendar

Copenhagen

9.97.1 Detailed Description

Copenhagen calendar
Holidays:

• Saturdays
• Sundays
• Maunday Thursday
• Good Friday
• Easter Monday
• General Prayer Day, 25 days after Easter Monday
• Ascension
• Whit (Pentecost) Monday
• New Year’s Day, January 1st
• Constitution Day, June 5th
• Christmas, December 25th
• Boxing Day, December 26th

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.98 CostFunction Class Reference 219

9.98 CostFunction Class Reference


#include <ql/Optimization/costfunction.hpp>
Inheritance diagram for CostFunction:

CostFunction

LeastSquareFunction

9.98.1 Detailed Description

Cost function abstract class for optimization problem.

Public Member Functions


• virtual double value (const Array &x) const=0
method to overload to compute the cost functon value in x

• virtual void gradient (Array &grad, const Array &x) const


method to overload to compute grad_f, the first derivative of

• virtual double valueAndGradient (Array &grad, const Array &x) const


method to overload to compute grad_f, the first derivative of

• virtual double finiteDifferenceEpsilon () const


Default epsilon for finite difference method :.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


220 QuantLib Class Documentation

9.99 coupling_iterator Class Template Reference


#include <ql/Utilities/couplingiterator.hpp>

9.99.1 Detailed Description

template<class Iterator1, class Iterator2, class Function> class QuantLib::coupling_iterator<


Iterator1, Iterator2, Function >

Iterator mapping a function to a pair of underlying sequences.


This iterator advances two underlying iterators and returns the values obtained by applying a
function to the two values such iterators point to.

Public Types
• typedef Function::result_type value_type
• typedef const Function::result_type ∗ pointer
• typedef const Function::result_type & reference

Public Member Functions


• coupling_iterator (Iterator1 it1, Iterator2 it2, Function f)

Dereferencing

• reference operator ∗ () const


• pointer operator → () const

Random access

• value_type operator[ ] (difference_type n) const

Increment and decrement

• coupling_iterator & operator++ ()


• coupling_iterator operator++ (int)
• coupling_iterator & operator– ()
• coupling_iterator operator– (int)
• coupling_iterator & operator+= (difference_type n)
• coupling_iterator & operator-= (difference_type n)
• coupling_iterator operator+ (difference_type n) const
• coupling_iterator operator- (difference_type n) const

Difference

• difference_type operator- (const coupling_iterator &rhs) const

Comparisons

• bool operator== (const coupling_iterator &rhs) const


• bool operator!= (const coupling_iterator &rhs) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.99 coupling_iterator Class Template Reference 221

Public Attributes
• typedef< Iterator1 >::difference_type difference_type

Related Functions

(Note that these are not member functions.)

• coupling_iterator< It1, It2, Function > make_coupling_iterator (It1 it1, It2 it2, Function f)
helper function to create combining iterators

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


222 QuantLib Class Documentation

9.100 Coupon Class Reference


#include <ql/CashFlows/coupon.hpp>
Inheritance diagram for Coupon:

Observable

CashFlow

Coupon

FixedRateCoupon FloatingRateCoupon

IndexedCoupon ParCoupon

InArrearIndexedCoupon UpFrontIndexedCoupon ShortFloatingRateCoupon

9.100.1 Detailed Description

coupon accruing over a fixed period


This class implements part of the CashFlow(p. 200) interface but it is still abstract and provides
derived classes with methods for accrual period calculations.

Public Member Functions


• Coupon (double nominal, const Date &paymentDate, const Date &accrualStartDate,
const Date &accrualEndDate, const Date &refPeriodStart=Date(), const Date &refPeriod-
End=Date())

Partial CashFlow interface

• Date date () const


returns the date at which the cash flow is settled

Inspectors

• double nominal () const


• const Date & accrualStartDate () const
start of the accrual period

• const Date & accrualEndDate () const


end of the accrual period

• Time accrualPeriod () const


accrual period as fraction of year

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.100 Coupon Class Reference 223

• int accrualDays () const


accrual period in days

• virtual DayCounter dayCounter () const=0


day counter for accrual calculation

• virtual double accruedAmount (const Date &) const=0


accrued amount at the given date

Visitability

• virtual void accept (AcyclicVisitor &)

Protected Attributes
• double nominal_
• Date paymentDate_
• Date accrualStartDate_
• Date accrualEndDate_
• Date refPeriodStart_
• Date refPeriodEnd_

9.100.2 Constructor & Destructor Documentation

9.100.2.1 Coupon (double nominal, const Date & paymentDate, const Date &
accrualStartDate, const Date & accrualEndDate, const Date & refPeriodStart =
Date(), const Date & refPeriodEnd = Date())

Warning:
the coupon does not roll the payment date which must already be a business day.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


224 QuantLib Class Documentation

9.101 CoxIngersollRoss Class Reference


#include <ql/ShortRateModels/OneFactorModels/coxingersollross.hpp>
Inheritance diagram for CoxIngersollRoss:

Observer Observable

ShortRateModel

OneFactorModel AffineModel

OneFactorAffineModel

CoxIngersollRoss

ExtendedCoxIngersollRoss

9.101.1 Detailed Description

Cox-Ingersoll-Ross model class.


This class implements the Cox-Ingersoll-Ross model defined by

drt = k(θ − rt )dt + rt σdWt .

Bug
This class was not tested enough to guarantee its functionality.

Public Member Functions


• CoxIngersollRoss (Rate r0=0.05, double theta=0.1, double k=0.1, double sigma=0.1)
• virtual double discountBondOption (Option::Type type, double strike, Time maturity, Time
bondMaturity) const
• virtual Handle< ShortRateDynamics > dynamics () const
returns the short-rate dynamics

• virtual Handle< Lattice > tree (const TimeGrid &grid) const


Return by default a trinomial recombining tree.

Protected Member Functions


• double A (Time t, Time T) const
• double B (Time t, Time T) const
• double theta () const
• double k () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.101 CoxIngersollRoss Class Reference 225

• double sigma () const


• double x0 () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


226 QuantLib Class Documentation

9.102 CoxIngersollRoss::Dynamics Class Reference


#include <ql/ShortRateModels/OneFactorModels/coxingersollross.hpp>
Inheritance diagram for CoxIngersollRoss::Dynamics:

CoxIngersollRoss::Dynamics

Dynamics

9.102.1 Detailed Description

Dynamics of the short-rate under the Cox-Ingersoll-Ross model


The state variable yt will here be the square-root of the short-rate. It satisfies the following
stochastic equation
kθ σ2 1 σ
" #
k
dyt = ( + ) − yt dt + dWt
2 8 yt 2 2
.

Public Member Functions


• Dynamics (double theta, double k, double sigma, double x0)
• virtual double variable (Time t, Rate r) const
• virtual double shortRate (Time t, double y) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.103 CoxRossRubinstein Class Reference 227

9.103 CoxRossRubinstein Class Reference


#include <ql/Lattices/binomialtree.hpp>
Inheritance diagram for CoxRossRubinstein:

Tree

BinomialTree

EqualJumpsBinomialTree

CoxRossRubinstein

9.103.1 Detailed Description

Cox-Ross-Rubinstein (multiplicative) equal jumps binomial tree.

Public Member Functions


• CoxRossRubinstein (const Handle< DiffusionProcess > &process, Time end, Size steps,
double strike)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


228 QuantLib Class Documentation

9.104 CrankNicolson Class Template Reference


#include <ql/FiniteDifferences/cranknicolson.hpp>
Inheritance diagram for CrankNicolson:

MixedScheme<Operator>

CrankNicolson

9.104.1 Detailed Description

template<class Operator> class QuantLib::CrankNicolson< Operator >

Crank-Nicolson scheme for finite difference methods.


See sect. The finite differences framework(p. 37) for details on the method.
In this implementation, the passed operator must be derived from either TimeConstantOperator
or TimeDependentOperator. Also, it must implement at least the following interface:

typedef ... arrayType;

// copy constructor/assignment
// (these will be provided by the compiler if none is defined)
Operator(const Operator&);
Operator& operator=(const Operator&);

// inspectors
Size size();

// modifiers
void setTime(Time t);

// operator interface
arrayType applyTo(const arrayType&);
arrayType solveFor(const arrayType&);
static Operator identity(Size size);

// operator algebra
Operator operator*(double, const Operator&);
Operator operator+(const Operator&, const Operator&);
Operator operator+(const Operator&, const Operator&);

Warning:
The differential operator must be linear for this evolver to work.

Friends
• class FiniteDifferenceModel< CrankNicolson< Operator > >

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.105 Cubic Class Reference 229

9.105 Cubic Class Reference


#include <ql/Math/interpolationtraits.hpp>

9.105.1 Detailed Description

Cubic-spline interpolation traits.

Static Public Member Functions


• template<class I1, class I2> Interpolation make_interpolation (const I1 &xBegin, const I1
&xEnd, const I2 &yBegin)
• template<class I1, class I2, class M> Interpolation2D make_interpolation (const I1 &x-
Begin, const I1 &xEnd, const I2 &yBegin, const I2 &yEnd, const M &z)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


230 QuantLib Class Documentation

9.106 CubicSpline Class Reference

#include <ql/Math/cubicspline.hpp>
Inheritance diagram for CubicSpline:

Bridge< Interpolation, InterpolationImpl >

Interpolation

CubicSpline

MonotonicCubicSpline NaturalCubicSpline NaturalMonotonicCubicSpline

9.106.1 Detailed Description

Cubic spline interpolation between discrete points.


It implements different type of end conditions: not-a-knot, first derivative value, second derivative
value.
It also implements Hyman’s monotonicity constraint filter which ensures that the interpolating
spline remains monotonic at the expense of the second derivative of the curve which will no
longer be continuous where the filter has been applied. If the interpolating spline is already
monotonic, the Hyman filter leaves it unchanged.
See R. L. Dougherty, A. Edelman, and J. M. Hyman, "Nonnegativity-, Monotonicity-, or Convexity-
Preserving Cubic(p. 229) and Quintic Hermite Interpolation" Mathematics Of Computation, v. 52,
n. 186, April 1989, pp. 471-494.

Public Types

• enum BoundaryCondition {
NotAKnot, FirstDerivative, SecondDerivative, Periodic,
Lagrange }

Public Member Functions

• template<class I1, class I2> CubicSpline (const I1 &xBegin, const I1 &xEnd, const
I2 &yBegin, CubicSpline::BoundaryCondition leftCondition, double leftConditionValue,
CubicSpline::BoundaryCondition rightCondition, double rightConditionValue, bool
monotonicityConstraint)
• const std::vector< double > & aCoefficients () const
• const std::vector< double > & bCoefficients () const
• const std::vector< double > & cCoefficients () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.106 CubicSpline Class Reference 231

9.106.2 Member Enumeration Documentation

9.106.2.1 enum BoundaryCondition

Enumeration values:
NotAKnot Make second(-last) point an inactive knot.
FirstDerivative Match value of end-slope.
SecondDerivative Match value of second derivative at end.
Periodic Match first and second derivative at either end.
Lagrange Match end-slope to the slope of the cubic that matches the first four data at the
respective end

9.106.3 Constructor & Destructor Documentation

9.106.3.1 CubicSpline (const I1 & xBegin, const I1 & xEnd, const I2 & yBegin,
CubicSpline::BoundaryCondition leftCondition, double leftConditionValue,
CubicSpline::BoundaryCondition rightCondition, double rightConditionValue,
bool monotonicityConstraint)

Precondition:
the x values must be sorted.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


232 QuantLib Class Documentation

9.107 CumulativeBinomialDistribution Class Reference


#include <ql/Math/binomialdistribution.hpp>

9.107.1 Detailed Description

Cumulative binomial distribution function.


Given an integer k it provides the cumulative probability of observing kk<=k: formula here ...

Public Member Functions


• CumulativeBinomialDistribution (double p, unsigned long n)
• double operator() (unsigned long k) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.108 CumulativeNormalDistribution Class Reference 233

9.108 CumulativeNormalDistribution Class Reference


#include <ql/Math/normaldistribution.hpp>

9.108.1 Detailed Description

Cumulative normal distribution function.


Given x it provides an approximation to the integral of the gaussian normal distribution: formula
here ...
For this implementation see M. Abramowitz and I. Stegun, Handbook of Mathematical Functions,
Dover Publications, New York (1972)

Public Member Functions


• CumulativeNormalDistribution (double average=0.0, double sigma=1.0)
• double operator() (double x) const
• double derivative (double x) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


234 QuantLib Class Documentation

9.109 CumulativePoissonDistribution Class Reference


#include <ql/Math/poissondistribution.hpp>

9.109.1 Detailed Description

Cumulative Poisson distribution function.


Given x it provides an approximation to the integral of the Poisson distribution: formula here ...
For this implementation see "Numerical Recipes in C", 2nd edition, Press, Teukolsky, Vetterling,
Flannery, chapter 6

Public Member Functions


• CumulativePoissonDistribution (double mu)
• double operator() (unsigned long k) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.110 CuriouslyRecurringTemplate Class Template Reference 235

9.110 CuriouslyRecurringTemplate Class Template Reference


#include <ql/Patterns/curiouslyrecurring.hpp>
Inheritance diagram for CuriouslyRecurringTemplate:

CuriouslyRecurringTemplate

Solver1D< Impl >

9.110.1 Detailed Description

template<class Impl> class QuantLib::CuriouslyRecurringTemplate< Impl >

Support for the curiously recurring template pattern.


See James O. Coplien. A Curiously Recurring Template Pattern. In Stanley B. Lippman, editor,
C++ Gems, 135-144. Cambridge University Press, New York, New York, 1996.

Protected Member Functions


• Impl & impl ()
• const Impl & impl () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


236 QuantLib Class Documentation

9.111 CurrencyFormatter Class Reference


#include <ql/dataformatters.hpp>

9.111.1 Detailed Description

Formats currencies for output.

Static Public Member Functions


• std::string toString (Currency c)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.112 Date Class Reference 237

9.112 Date Class Reference


#include <ql/date.hpp>

9.112.1 Detailed Description

Concrete date class.


This class provides methods to inspect dates as well as methods and operators which implement
a limited date algebra (increasing and decreasing dates, and calculating their difference).

Public Member Functions


constructors

• Date ()
Default constructor returning a null date.

• Date (long serialNumber)


Constructor taking a serial number as given by Applix or Excel.

• Date (Day d, Month m, Year y)


More traditional constructor.

inspectors

• Weekday weekday () const


• Day dayOfMonth () const
• bool isEndOfMonth () const
• Day lastDayOfMonth () const
• Day dayOfYear () const
One-based (Jan 1st = 1).

• Month month () const


• Year year () const
• long serialNumber () const

date algebra

• Date & operator+= (int days)


increments date in place

• Date & operator-= (int days)


decrement date in place

• Date & operator++ ()


1-day pre-increment

• Date operator++ (int)


1-day post-increment

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


238 QuantLib Class Documentation

• Date & operator– ()


1-day pre-decrement

• Date operator– (int)


1-day post-decrement

• Date operator+ (int days) const


returns a new incremented date

• Date operator- (int days) const


returns a new decremented date

other methods to increment/decrement dates

• Date plusDays (int days) const


• Date plusWeeks (int weeks) const
• Date plusMonths (int months) const
• Date plusYears (int years) const
• Date plus (int units, TimeUnit) const
• Date plus (const Period &) const

Static Public Member Functions


static methods

• bool isLeap (Year y)


• Date minDate ()
earliest allowed date

• Date maxDate ()
latest allowed date

• Date todaysDate ()
today’s date.

Related Functions

(Note that these are not member functions.)

• std::ostream & operator<< (std::ostream &, const Date &)


• long operator- (const Date &, const Date &)
Difference in days between dates.

• bool operator== (const Date &, const Date &)


• bool operator!= (const Date &, const Date &)
• bool operator< (const Date &, const Date &)
• bool operator<= (const Date &, const Date &)
• bool operator> (const Date &, const Date &)
• bool operator>= (const Date &, const Date &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.113 DateFormatter Class Reference 239

9.113 DateFormatter Class Reference


#include <ql/dataformatters.hpp>

9.113.1 Detailed Description

Formats dates for output.


Formatting can be in short (mm/dd/yyyy) or long (Month ddth, yyyy) form.

Public Types
• enum Format { Long, Short, ISO }

Static Public Member Functions


• std::string toString (const Date &d, Format f=Long)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


240 QuantLib Class Documentation

9.114 DayCounter Class Reference


#include <ql/daycounter.hpp>
Inheritance diagram for DayCounter:

Bridge< DayCounter, DayCounterImpl >

DayCounter

Actual360 Actual365 ActualActual SimpleDayCounter Thirty360

9.114.1 Detailed Description

day counter class


This class provides methods for determining the length of a time period according to given market
convention, both as a number of days and as a year fraction.
The Bridge(p. 179) pattern is used to provide the base behavior of the day counter.

Public Member Functions


• DayCounter ()

DayCounter interface

• std::string name () const


Returns the name of the day counter.

• int dayCount (const Date &, const Date &) const


Returns the number of days between two dates.

• Time yearFraction (const Date &, const Date &, const Date &refPeriodStart=Date(), const
Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.

Protected Member Functions


• DayCounter (const Handle< DayCounterImpl > &impl)

Related Functions

(Note that these are not member functions.)

• bool operator== (const DayCounter &, const DayCounter &)


• bool operator!= (const DayCounter &, const DayCounter &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.114 DayCounter Class Reference 241

9.114.2 Constructor & Destructor Documentation

9.114.2.1 DayCounter ()

This default constructor returns a day counter with a null implementation, which is therefore
unusable except as a placeholder.

9.114.2.2 DayCounter (const Handle< DayCounterImpl > & impl) [protected]

This protected constructor will only be invoked by derived classes which define a given Day-
Counter(p. 240) implementation

9.114.3 Member Function Documentation

9.114.3.1 std::string name () const

Returns the name of the day counter.

Warning:
This method is used for output and comparison between day counters. It is not meant to be
used for writing switch-on-type code.

9.114.4 Friends And Related Function Documentation

9.114.4.1 bool operator== (const DayCounter &, const DayCounter &) [related]

Returns true iff the two day counters belong to the same derived class.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


242 QuantLib Class Documentation

9.115 DayCounterImpl Class Reference


#include <ql/daycounter.hpp>

9.115.1 Detailed Description

abstract base class for day counter implementations

Public Member Functions


• virtual std::string name () const=0
• virtual int dayCount (const Date &, const Date &) const=0
• virtual Time yearFraction (const Date &, const Date &, const Date &refPeriodStart, const
Date &refPeriodEnd) const=0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.116 DepositRateHelper Class Reference 243

9.116 DepositRateHelper Class Reference


#include <ql/TermStructures/ratehelpers.hpp>
Inheritance diagram for DepositRateHelper:

Observer Observable

RateHelper

DepositRateHelper

9.116.1 Detailed Description

Deposit rate.

Warning:
This class assumes that the reference date does not change between calls of setTerm-
Structure()(p. 243).

Public Member Functions


• DepositRateHelper (const RelinkableHandle< Quote > &rate, int n, TimeUnit units, int
settlementDays, const Calendar &calendar, RollingConvention convention, const Day-
Counter &dayCounter)
• DepositRateHelper (double rate, int n, TimeUnit units, int settlementDays, const Calendar
&calendar, RollingConvention convention, const DayCounter &dayCounter)
• double impliedQuote () const
• DiscountFactor discountGuess () const
• void setTermStructure (TermStructure ∗)
sets the term structure to be used for pricing

• Date maturity () const


maturity date

9.116.2 Member Function Documentation

9.116.2.1 void setTermStructure (TermStructure ∗) [virtual]

sets the term structure to be used for pricing

Warning:
Being a pointer and not a Handle(p. 339), the term structure is not guaranteed to remain
allocated for the whole life of the rate helper. It is responsibility of the programmer to ensure
that the pointer remains valid. It is advised that rate helpers be used only in term structure
constructors, setting the term structure to this, i.e., the one being constructed.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


244 QuantLib Class Documentation

Reimplemented from RateHelper (p. 537).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.117 DerivedQuote Class Template Reference 245

9.117 DerivedQuote Class Template Reference


#include <ql/marketelement.hpp>
Inheritance diagram for DerivedQuote:

Observable

Quote Observer

DerivedQuote

9.117.1 Detailed Description

template<class UnaryFunction> class QuantLib::DerivedQuote< UnaryFunction >

market element whose value depends on another market element

Public Member Functions


• DerivedQuote (const RelinkableHandle< Quote > &element, const UnaryFunction &f)

Market element interface

• double value () const


returns the current value

Observer interface

• void update ()

9.117.2 Member Function Documentation

9.117.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


246 QuantLib Class Documentation

9.118 DiffusionProcess Class Reference


#include <ql/diffusionprocess.hpp>
Inheritance diagram for DiffusionProcess:

DiffusionProcess

BlackScholesProcess OrnsteinUhlenbeckProcess SquareRootProcess

9.118.1 Detailed Description

Diffusion process class.


This class describes a stochastic process governed by

dxt = µ(t, xt )dt + σ(t, xt )dWt .

Public Member Functions


• DiffusionProcess (double x0)
• double x0 () const
• virtual double drift (Time t, double x) const=0
returns the drift part of the equation, i.e. µ(t, xt )

• virtual double diffusion (Time t, double x) const=0


• virtual double expectation (Time t0, double x0, Time dt) const
returns the expectation of the process after a time interval

• virtual double variance (Time t0, double x0, Time dt) const
returns the variance of the process after a time interval

9.118.2 Member Function Documentation

9.118.2.1 virtual double diffusion (Time t, double x) const [pure virtual]

returns the diffusion part of the equation, i.e. σ(t, xt )


Implemented in BlackScholesProcess (p. 162), OrnsteinUhlenbeckProcess (p. 493), and Square-
RootProcess (p. 567).

9.118.2.2 virtual double expectation (Time t0, double x0, Time dt) const [virtual]

returns the expectation of the process after a time interval


returns E(xt0 +∆t |xt0 = x0 ). By default, it returns the Euler approximation defined by x0 + µ(t0 , x0 )∆t.
Reimplemented in OrnsteinUhlenbeckProcess (p. 493).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.118 DiffusionProcess Class Reference 247

9.118.2.3 virtual double variance (Time t0, double x0, Time dt) const [virtual]

returns the variance of the process after a time interval


returns Var(xt0 +∆t |xt0 = x0 ). By default, it returns the Euler approximation defined by σ(t0 , x0 )2 ∆t.
Reimplemented in OrnsteinUhlenbeckProcess (p. 494).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


248 QuantLib Class Documentation

9.119 DirichletBC Class Reference


#include <ql/FiniteDifferences/boundarycondition.hpp>
Inheritance diagram for DirichletBC:

BoundaryCondition< TridiagonalOperator >

DirichletBC

9.119.1 Detailed Description

Neumann boundary condition (i.e., constant value).

Todo
generalize to time-dependent conditions.

Public Member Functions


• DirichletBC (double value, Side side)
• void applyBeforeApplying (TridiagonalOperator &) const
• void applyAfterApplying (Array &) const
• void applyBeforeSolving (TridiagonalOperator &, Array &rhs) const
• void applyAfterSolving (Array &) const
• void setTime (Time t)

9.119.2 Member Function Documentation

9.119.2.1 void setTime (Time t) [virtual]

This method sets the current time for time-dependent boundary conditions.
Implements BoundaryCondition< TridiagonalOperator > (p. 173).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.120 DiscountCurve Class Reference 249

9.120 DiscountCurve Class Reference


#include <ql/TermStructures/discountcurve.hpp>
Inheritance diagram for DiscountCurve:

Observable

TermStructure

DiscountStructure

DiscountCurve

ExtendedDiscountCurve

9.120.1 Detailed Description

Term structure based on loglinear interpolation of discount factors.


Loglinear interpolation guarantees piecewise constant forward rates.
Rates are assumed to be annual continuos compounding.

Public Member Functions


• DiscountCurve (const Date &todaysDate, const std::vector< Date > &dates, const
std::vector< DiscountFactor > &dfs, const DayCounter &dayCounter=Actual365())
• Date todaysDate () const
today’s date

• Date referenceDate () const


the reference date, i.e., the date at which discount = 1

• DayCounter dayCounter () const


the day counter used for date/time conversion

• Date maxDate () const


the latest date for which the curve can return rates

• Time maxTime () const


the latest time for which the curve can return rates

• const std::vector< Time > & times () const


• const std::vector< Date > & dates () const
• const std::vector< DiscountFactor > & discounts () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


250 QuantLib Class Documentation

Protected Member Functions


• DiscountFactor discountImpl (Time, bool extrapolate=false) const
discount calculation

• int referenceNode (Time, bool extrapolate=false) const

Protected Attributes
• Date todaysDate_
• Date referenceDate_
• DayCounter dayCounter_
• std::vector< Date > dates_
• std::vector< DiscountFactor > discounts_
• std::vector< Time > times_
• Interpolation interpolation_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.121 DiscountStructure Class Reference 251

9.121 DiscountStructure Class Reference

#include <ql/termstructure.hpp>
Inheritance diagram for DiscountStructure:

Observable

TermStructure

DiscountStructure

AffineTermStructure DiscountCurve ImpliedTermStructure

ExtendedDiscountCurve

9.121.1 Detailed Description

Discount factor term structure.


This abstract class acts as an adapter to TermStructure(p. 594) allowing the programmer to im-
plement only the discountImpl(const Date&, bool) method in derived classes.
Rates are assumed to be annual continuos compounding.

Protected Member Functions

• Rate zeroYieldImpl (Time, bool extrapolate=false) const


• Rate forwardImpl (Time, bool extrapolate=false) const
• Rate compoundForwardImpl (Time, int, bool extrapolate=false) const

9.121.2 Member Function Documentation

9.121.2.1 Rate zeroYieldImpl (Time, bool extrapolate = false) const [protected, virtual]

Returns the zero yield rate for the given date calculating it from the discount.
Implements TermStructure (p. 595).

9.121.2.2 Rate forwardImpl (Time, bool extrapolate = false) const [protected, virtual]

Returns the instantaneous forward rate for the given date calculating it from the discount.
Implements TermStructure (p. 595).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


252 QuantLib Class Documentation

9.121.2.3 Rate compoundForwardImpl (Time, int, bool extrapolate = false) const


[protected, virtual]

Returns the forward rate at a specified compound frequency for the given date calculating it from
the zero yield.
Implements TermStructure (p. 595).
Reimplemented in ExtendedDiscountCurve (p. 289).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.122 DiscrepancyStatistics Class Reference 253

9.122 DiscrepancyStatistics Class Reference


#include <ql/Math/discrepancystatistics.hpp>
Inheritance diagram for DiscrepancyStatistics:

SequenceStatistics< Statistics >

DiscrepancyStatistics

9.122.1 Detailed Description

Statistic tool for sequences with discrepancy calculation.


It inherit from SequenceStatistics<Statistics>(p. 546) and adds L2 discrepancy calculation

Public Member Functions


• DiscrepancyStatistics (Size dimension)
• template<class Sequence> void add (const Sequence &sample, double weight=1.0)
• template<class Iterator> void add (Iterator begin, Iterator end, double weight=1.0)
• void reset (Size dimension=0)

1-dimensional inspectors

• double discrepancy () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


254 QuantLib Class Documentation

9.123 DiscreteAveragingAsianEngine Class Reference


#include <ql/Instruments/asianoption.hpp>
Inheritance diagram for DiscreteAveragingAsianEngine:

Observable

PricingEngine

GenericEngine< DiscreteAveragingAsianOption::arguments, DiscreteAveragingAsianOption::results >

DiscreteAveragingAsianEngine

AnalyticDiscreteAveragingAsianEngine

9.123.1 Detailed Description

Discrete averaging asian engine base class.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.124 DiscreteAveragingAsianOption Class Reference 255

9.124 DiscreteAveragingAsianOption Class Reference

#include <ql/Instruments/asianoption.hpp>
Inheritance diagram for DiscreteAveragingAsianOption:

Observable Observer

LazyObject

Instrument

Option

OneAssetOption

OneAssetStrikedOption

DiscreteAveragingAsianOption

9.124.1 Detailed Description

Asian option.

Public Member Functions

• DiscreteAveragingAsianOption (Average::Type averageType, double runningProduct,


Size pastFixings, std::vector< Date > fixingDates, const Handle< BlackScholesStochastic-
Process > &stochProc, const Handle< StrikedTypePayoff > &payoff, const Handle< Exer-
cise > &exercise, const Handle< PricingEngine > &engine=Handle< PricingEngine >())
• void setupArguments (Arguments ∗) const

Protected Member Functions

• void performCalculations () const

Protected Attributes

• Average::Type averageType_
• double runningProduct_
• Size pastFixings_
• std::vector< Date > fixingDates_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


256 QuantLib Class Documentation

9.124.2 Member Function Documentation

9.124.2.1 void setupArguments (Arguments ∗) const [virtual]

When a derived argument structure is defined for an instrument, this method should be overrid-
den to fill it. This is mandatory in case a pricing engine is used.
Reimplemented from OneAssetStrikedOption (p. 482).

9.124.2.2 void performCalculations () const [protected, virtual]

In case a pricing engine is not used, this method must be overridden to perform the actual calcu-
lations and set any needed results. In case a pricing engine is used, the default implementation
can be used.
Reimplemented from OneAssetStrikedOption (p. 482).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.125 DiscreteAveragingAsianOption::arguments Class Reference 257

9.125 DiscreteAveragingAsianOption::arguments Class Refer-


ence
#include <ql/Instruments/asianoption.hpp>

9.125.1 Detailed Description

extra arguments for single asset asian option calculation

Public Member Functions


• void validate () const

Public Attributes
• Average::Type averageType
• double runningProduct
• Size pastFixings
• std::vector< Date > fixingDates

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


258 QuantLib Class Documentation

9.126 DiscreteGeometricAPO Class Reference


#include <ql/Pricers/discretegeometricapo.hpp>
Inheritance diagram for DiscreteGeometricAPO:

SingleAssetOption

DiscreteGeometricAPO

9.126.1 Detailed Description

Discrete geometric average-price Asian option (European style).


This class implements a discrete geometric average price asian option, with european exercise.
The formula is from "Asian Option", E. Levy (1997) in "Exotic Options: The State of the Art",
edited by L. Clewlow, C. Strickland, pag65-97

Todo
add analytical greeks

Public Member Functions


• DiscreteGeometricAPO (Option::Type type, double underlying, double strike, Spread
dividendYield, Rate riskFreeRate, const std::vector< Time > &times, double volatility)
• double value () const
• double delta () const
• double gamma () const
• double theta () const
• Handle< SingleAssetOption > clone () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.127 DiscreteGeometricASO Class Reference 259

9.127 DiscreteGeometricASO Class Reference


#include <ql/Pricers/discretegeometricaso.hpp>
Inheritance diagram for DiscreteGeometricASO:

SingleAssetOption

DiscreteGeometricASO

9.127.1 Detailed Description

Discrete geometric average-strike Asian option (European style).


This class implements a discrete geometric average strike asian option, with european exercise.
The formula is from "Asian Option", E. Levy (1997) in "Exotic Options: The State of the Art",
edited by L. Clewlow, C. Strickland, pag65-97

Todo
add analytical greeks

Public Member Functions


• DiscreteGeometricASO (Option::Type type, double underlying, Spread dividendYield,
Rate riskFreeRate, const std::vector< Time > &times, double volatility)
• double value () const
• double delta () const
• double gamma () const
• double theta () const
• Handle< SingleAssetOption > clone () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


260 QuantLib Class Documentation

9.128 DiscretizedAsset Class Reference

#include <ql/discretizedasset.hpp>
Inheritance diagram for DiscretizedAsset:

DiscretizedAsset

DiscretizedDiscountBond DiscretizedOption

9.128.1 Detailed Description

Discretized asset class used by numerical methods.

Public Member Functions

• DiscretizedAsset (const Handle< NumericalMethod > &method)


• virtual void reset (Size size)=0
• Time time () const
• Time & time ()
• const Array & values () const
• Array & values ()
• const Handle< NumericalMethod > & method () const
• virtual void preAdjustValues ()
• virtual void postAdjustValues ()
• void adjustValues ()
• virtual void addTimesTo (std::list< Time > &times) const

Protected Member Functions

• bool isOnTime (Time t) const

Protected Attributes

• Time time_
• Array values_

9.128.2 Member Function Documentation

9.128.2.1 virtual void preAdjustValues () [virtual]

This method will be invoked after rollback and before any other asset (i.e., an option on this one)
has any chance to look at the values. For instance, payments happening at times already spanned
by the rollback will be added here.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.128 DiscretizedAsset Class Reference 261

9.128.2.2 virtual void postAdjustValues () [virtual]

This method will be invoked after rollback and after any other asset had their chance to look at
the values. For instance, payments happening at the present time (and therefore not included in
an option to be exercised at this time) will be added here.
Reimplemented in DiscretizedOption (p. 263).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


262 QuantLib Class Documentation

9.129 DiscretizedDiscountBond Class Reference


#include <ql/discretizedasset.hpp>
Inheritance diagram for DiscretizedDiscountBond:

DiscretizedAsset

DiscretizedDiscountBond

9.129.1 Detailed Description

Useful discretized discount bond asset.

Public Member Functions


• DiscretizedDiscountBond (const Handle< NumericalMethod > &method)
• void reset (Size size)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.130 DiscretizedOption Class Reference 263

9.130 DiscretizedOption Class Reference


#include <ql/discretizedasset.hpp>
Inheritance diagram for DiscretizedOption:

DiscretizedAsset

DiscretizedOption

9.130.1 Detailed Description

Discretized option on another asset.

Precondition:
The underlying asset must be initialized

Public Member Functions


• DiscretizedOption (const Handle< DiscretizedAsset > &underlying, Exercise::Type
exerciseType, const std::vector< Time > &exerciseTimes)
• void reset (Size size)
• void postAdjustValues ()
• void addTimesTo (std::list< Time > &times) const

Protected Member Functions


• void applyExerciseCondition ()

Protected Attributes
• Handle< DiscretizedAsset > underlying_
• Exercise::Type exerciseType_
• std::vector< Time > exerciseTimes_

9.130.2 Member Function Documentation

9.130.2.1 void postAdjustValues () [virtual]

This method will be invoked after rollback and after any other asset had their chance to look at
the values. For instance, payments happening at the present time (and therefore not included in
an option to be exercised at this time) will be added here.
Reimplemented from DiscretizedAsset (p. 261).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


264 QuantLib Class Documentation

9.131 Disposable Class Template Reference


#include <ql/disposable.hpp>

9.131.1 Detailed Description

template<class T> class QuantLib::Disposable< T >

generic disposable object with move semantics


This class can be used for returning a value by copy. It relies on the returned object exposing a
swap(T&) method through which the copy constructor and assignment operator are implemented,
thus resulting in actual move semantics. Typical use of this class is along the following lines:

Disposable<Foo> bar(int i) {
Foo f(i*2);
return f;
}

Warning:
In order to avoid copies in code such as shown above, the conversion from T to Dispos-
able(p. 264)<T> is destructive, i.e., it does not preserve the state of the original object. There-
fore, it is necessary for the developer to avoid code such as
Disposable<Foo> bar(Foo& f) {
return f;
}

which would likely render the passed object unusable. The correct way to obtain the desired
behavior would be:
Disposable<Foo> bar(Foo& f) {
Foo temp = f;
return temp;
}

Public Member Functions


• Disposable (T &t)
• Disposable (const Disposable< T > &t)
• Disposable< T > & operator= (const Disposable< T > &t)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.132 DMinus Class Reference 265

9.132 DMinus Class Reference


#include <ql/FiniteDifferences/dminus.hpp>
Inheritance diagram for DMinus:

TridiagonalOperator

DMinus

9.132.1 Detailed Description

D− matricial representation
The differential operator D− discretizes the first derivative with the first-order formula

∂ui ui − ui−1
≈ = D− ui
∂x h

Public Member Functions


• DMinus (Size gridPoints, double h)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


266 QuantLib Class Documentation

9.133 DoubleFormatter Class Reference


#include <ql/dataformatters.hpp>

9.133.1 Detailed Description

Formats doubles for output.

Static Public Member Functions


• std::string toString (double x, int precision=6, int digits=0)
• std::string toExponential (double x, int precision=6, int digits=0)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.134 DPlus Class Reference 267

9.134 DPlus Class Reference


#include <ql/FiniteDifferences/dplus.hpp>
Inheritance diagram for DPlus:

TridiagonalOperator

DPlus

9.134.1 Detailed Description

D+ matricial representation
The differential operator D+ discretizes the first derivative with the first-order formula

∂ui ui+1 − ui
≈ = D+ ui
∂x h

Public Member Functions


• DPlus (Size gridPoints, double h)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


268 QuantLib Class Documentation

9.135 DPlusDMinus Class Reference


#include <ql/FiniteDifferences/dplusdminus.hpp>
Inheritance diagram for DPlusDMinus:

TridiagonalOperator

DPlusDMinus

9.135.1 Detailed Description

D+ D− matricial representation
The differential operator D+ D− discretizes the second derivative with the second-order formula

∂2 ui ui+1 − 2ui + ui−1


≈ = D+ D− ui
∂x 2 h2

Public Member Functions


• DPlusDMinus (Size gridPoints, double h)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.136 DriftTermStructure Class Reference 269

9.136 DriftTermStructure Class Reference


#include <ql/TermStructures/drifttermstructure.hpp>
Inheritance diagram for DriftTermStructure:

Observable

TermStructure

ZeroYieldStructure Observer

DriftTermStructure

9.136.1 Detailed Description

Drift term structure.


Drift term structure for modelling the common drift term: riskFreeRate - dividendYield -
0.5∗vol∗vol

Note:
This term structure will remain linked to the original structures, i.e., any changes in the latters
will be reflected in this structure as well.

Public Member Functions


• DriftTermStructure (const RelinkableHandle< TermStructure > &riskFreeTS, const
RelinkableHandle< TermStructure > &dividendTS, const RelinkableHandle< BlackVol-
TermStructure > &blackVolTS)

TermStructure interface

• DayCounter dayCounter () const


the day counter used for date/time conversion

• Date todaysDate () const


today’s date

• Date referenceDate () const


the reference date, i.e., the date at which discount = 1

• Date maxDate () const


the latest date for which the curve can return rates

Observer interface

• void update ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


270 QuantLib Class Documentation

Protected Member Functions


• Rate zeroYieldImpl (Time, bool extrapolate=false) const
returns the discount factor as seen from the evaluation date

9.136.2 Member Function Documentation

9.136.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.137 DZero Class Reference 271

9.137 DZero Class Reference


#include <ql/FiniteDifferences/dzero.hpp>
Inheritance diagram for DZero:

TridiagonalOperator

DZero

9.137.1 Detailed Description

D0 matricial representation
The differential operator D0 discretizes the first derivative with the second-order formula

∂ui ui+1 − ui−1


≈ = D0 ui
∂x 2h

Public Member Functions


• DZero (Size gridPoints, double h)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


272 QuantLib Class Documentation

9.138 EarlyExercise Class Reference


#include <ql/exercise.hpp>
Inheritance diagram for EarlyExercise:

Exercise

EarlyExercise

AmericanExercise BermudanExercise

9.138.1 Detailed Description

Early-exercise base class.


The payoff can be at exercise (default case) or at expiry

Todo
derive a plain American Exercise(p. 283) class (no earliestDate, no payoffAtExpiry)

Public Member Functions


• EarlyExercise (bool payoffAtExpiry=false)
• bool payoffAtExpiry () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.139 EndCriteria Class Reference 273

9.139 EndCriteria Class Reference


#include <ql/Optimization/criteria.hpp>

9.139.1 Detailed Description

Criteria to end optimization process.

• stationary point
– stationary gradient
– maximum number of iterations ....

Public Types
• enum Type { maxIter, statPt, statGd }

Public Member Functions


• EndCriteria ()
default constructor

• EndCriteria (int maxIteration, double epsilon)


initialization constructor

• void setPositiveOptimization ()
• bool checkIterationNumber (int iteration)
• bool checkStationaryValue (double fold, double fnew)
• bool checkAccuracyValue (double f)
• bool checkStationaryGradientNorm (double normDiff)
• bool checkAccuracyGradientNorm (double norm)
• bool operator() (int iteration, double fold, double normgold, double fnew, double nor-
mgnew, double normdiff)
test if the number of iteration is not too big and if we don’t

• int criteria () const


return the end criteria type

Protected Attributes
• int maxIteration_
Maximum number of iterations.

• double functionEpsilon_
function and gradient epsilons

• double gradientEpsilon_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


274 QuantLib Class Documentation

function and gradient epsilons

• int maxIterStatPt_
Maximun number of iterations in stationary state.

• int statState_
Maximun number of iterations in stationary state.

• int endCriteria_
• bool positiveOptimization_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.140 EqualJumpsBinomialTree Class Reference 275

9.140 EqualJumpsBinomialTree Class Reference


#include <ql/Lattices/binomialtree.hpp>
Inheritance diagram for EqualJumpsBinomialTree:

Tree

BinomialTree

EqualJumpsBinomialTree

CoxRossRubinstein Trigeorgis

9.140.1 Detailed Description

Base class for equal jumps binomial tree.

Public Member Functions


• EqualJumpsBinomialTree (const Handle< DiffusionProcess > &process, Time end, Size
steps)
• double underlying (Size i, Size index) const
• double probability (Size, Size, Size branch) const

Protected Attributes
• double dx_
• double pu_
• double pd_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


276 QuantLib Class Documentation

9.141 EqualProbabilitiesBinomialTree Class Reference


#include <ql/Lattices/binomialtree.hpp>
Inheritance diagram for EqualProbabilitiesBinomialTree:

Tree

BinomialTree

EqualProbabilitiesBinomialTree

AdditiveEQPBinomialTree JarrowRudd

9.141.1 Detailed Description

Base class for equal probabilities binomial tree.

Public Member Functions


• EqualProbabilitiesBinomialTree (const Handle< DiffusionProcess > &process, Time end,
Size steps)
• double underlying (Size i, Size index) const
• double probability (Size, Size, Size) const

Protected Attributes
• double up_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.142 Error Class Reference 277

9.142 Error Class Reference


#include <ql/errors.hpp>
Inheritance diagram for Error:

AssertionFailedError

IllegalArgumentError

IllegalResultError

Error IndexError

OutOfMemoryError

PostconditionNotSatisfiedError

PreconditionNotSatisfiedError

9.142.1 Detailed Description

Base error class.

Public Member Functions


• Error (const std::string &what="")
• const char ∗ what () const throw ()
returns the error message.

Static Public Member Functions


• std::string where (const char ∗file, long line)

9.142.2 Constructor & Destructor Documentation

9.142.2.1 Error (const std::string & what = "") [explicit]

The explicit use of this constructor is not advised. Use the QL_FAIL macro instead.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


278 QuantLib Class Documentation

9.143 ErrorFunction Class Reference


#include <ql/Math/errorfunction.hpp>

9.143.1 Detailed Description

Error function
formula here ... Used to calculate the cumulative normal distribution function

Public Member Functions


• double operator() (double x) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.144 Euribor Class Reference 279

9.144 Euribor Class Reference


#include <ql/Indexes/euribor.hpp>
Inheritance diagram for Euribor:

Observable

Index Observer

Xibor

Euribor

9.144.1 Detailed Description

Euribor index

Public Member Functions


• Euribor (int n, TimeUnit units, const RelinkableHandle< TermStructure > &h, const Day-
Counter &dc=Actual360())

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


280 QuantLib Class Documentation

9.145 EuroFormatter Class Reference


#include <ql/dataformatters.hpp>

9.145.1 Detailed Description

Formats amounts in Euro for output.


Formatting follows Euro convention (x,xxx,xxx.xx)

Static Public Member Functions


• std::string toString (double amount)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.146 EuropeanExercise Class Reference 281

9.146 EuropeanExercise Class Reference


#include <ql/exercise.hpp>
Inheritance diagram for EuropeanExercise:

Exercise

EuropeanExercise

9.146.1 Detailed Description

European exercise.
A European option can only be exercised at one (expiry) date.

Public Member Functions


• EuropeanExercise (Date date)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


282 QuantLib Class Documentation

9.147 EuropeanOption Class Reference


#include <ql/Pricers/europeanoption.hpp>
Inheritance diagram for EuropeanOption:

SingleAssetOption

EuropeanOption

ContinuousGeometricAPO FdDividendEuropeanOption

9.147.1 Detailed Description

Black-Scholes-Merton European option.

Deprecated
use VanillaOption(p. 624) with EuropeanAnalyticEngine

Public Member Functions


• EuropeanOption (Option::Type type, double underlying, double strike, Spread dividend-
Yield, Rate riskFreeRate, Time residualTime, double volatility)
• double value () const
• double delta () const
• double gamma () const
• double theta () const
• double vega () const
• double rho () const
• double dividendRho () const
• Handle< SingleAssetOption > clone () const
• void setVolatility (double newVolatility)
• void setRiskFreeRate (Rate newRate)
• void setDividendYield (Rate newDividendYield)
• double beta () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.148 Exercise Class Reference 283

9.148 Exercise Class Reference


#include <ql/exercise.hpp>
Inheritance diagram for Exercise:

Exercise

EarlyExercise EuropeanExercise

AmericanExercise BermudanExercise

9.148.1 Detailed Description

Base exercise class.

Public Types
• enum Type { American, Bermudan, European }

Public Member Functions


• bool isNull () const
• Type type () const
• Date date (Size index) const
• const std::vector< Date > & dates () const
• Date lastDate () const

Protected Attributes
• std::vector< Date > dates_
• Type type_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


284 QuantLib Class Documentation

9.149 ExplicitEuler Class Template Reference


#include <ql/FiniteDifferences/expliciteuler.hpp>
Inheritance diagram for ExplicitEuler:

MixedScheme<Operator>

ExplicitEuler

9.149.1 Detailed Description

template<class Operator> class QuantLib::ExplicitEuler< Operator >

Forward Euler scheme for finite difference methods.


See sect. The finite differences framework(p. 37) for details on the method.
In this implementation, the passed operator must be derived from either TimeConstantOperator
or TimeDependentOperator. Also, it must implement at least the following interface:

typedef ... arrayType;

// copy constructor/assignment
// (these will be provided by the compiler if none is defined)
Operator(const Operator&);
Operator& operator=(const Operator&);

// inspectors
Size size();

// modifiers
void setTime(Time t);

// operator interface
arrayType applyTo(const arrayType&);
static Operator identity(Size size);

// operator algebra
Operator operator*(double, const Operator&);
Operator operator-(const Operator&, const Operator&);

Todo
add Richardson extrapolation

Friends
• class FiniteDifferenceModel< ExplicitEuler< Operator > >

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.150 ExtendedCoxIngersollRoss Class Reference 285

9.150 ExtendedCoxIngersollRoss Class Reference


#include <ql/ShortRateModels/OneFactorModels/extendedcoxingersollross.hpp>
Inheritance diagram for ExtendedCoxIngersollRoss:

Observer Observable

ShortRateModel

OneFactorModel AffineModel

OneFactorAffineModel TermStructureConsistentModel

CoxIngersollRoss

ExtendedCoxIngersollRoss

9.150.1 Detailed Description

Extended Cox-Ingersoll-Ross model class.


This class implements the extended Cox-Ingersoll-Ross model defined by

drt = (θ(t) − αrt )dt + rt σdWt .

Bug
This class was not tested enough to guarantee its functionality.

Public Member Functions


• ExtendedCoxIngersollRoss (const RelinkableHandle< TermStructure > &termStructure,
double theta=0.1, double k=0.1, double sigma=0.1, double x0=0.05)
• Handle< Lattice > tree (const TimeGrid &grid) const
Return by default a trinomial recombining tree.

• Handle< ShortRateDynamics > dynamics () const


returns the short-rate dynamics

• double discountBondOption (Option::Type type, double strike, Time maturity, Time bond-
Maturity) const

Protected Member Functions


• void generateArguments ()
• double A (Time t, Time T) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


286 QuantLib Class Documentation

9.151 ExtendedCoxIngersollRoss::Dynamics Class Reference


#include <ql/ShortRateModels/OneFactorModels/extendedcoxingersollross.hpp>
Inheritance diagram for ExtendedCoxIngersollRoss::Dynamics:

Dynamics

ExtendedCoxIngersollRoss::Dynamics

9.151.1 Detailed Description

Short-rate dynamics in the extended Cox-Ingersoll-Ross model.


The short-rate is here
rt = ϕ(t) + y2t
where ϕ(t) is the deterministic time-dependent parameter used for term-structure fitting and yt
is the state variable, the square-root of a standard CIR process.

Public Member Functions


• Dynamics (const Parameter &phi, double theta, double k, double sigma, double x0)
• virtual double variable (Time t, Rate r) const
• virtual double shortRate (Time t, double y) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.152 ExtendedCoxIngersollRoss::FittingParameter Class Reference 287

9.152 ExtendedCoxIngersollRoss::FittingParameter Class Refer-


ence
#include <ql/ShortRateModels/OneFactorModels/extendedcoxingersollross.hpp>
Inheritance diagram for ExtendedCoxIngersollRoss::FittingParameter:

Bridge< Parameter, ParameterImpl >

Parameter

TermStructureFittingParameter

ExtendedCoxIngersollRoss::FittingParameter

9.152.1 Detailed Description

Analytical term-structure fitting parameter ϕ(t).


ϕ(t) is analytically defined by

2kθ(eth − 1) 4x0 h2 eth


ϕ(t) = f (t) − − ,
2h + (k + h)(eth − 1) (2h + (k + h)(eth − 1))1

where f (t) is the instantaneous forward rate at t and h = k2 + 2σ2 .

Public Member Functions


• FittingParameter (const RelinkableHandle< TermStructure > &termStructure, double
theta, double k, double sigma, double x0)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


288 QuantLib Class Documentation

9.153 ExtendedDiscountCurve Class Reference

#include <ql/TermStructures/extendeddiscountcurve.hpp>
Inheritance diagram for ExtendedDiscountCurve:

Observable

TermStructure

DiscountStructure

DiscountCurve Observer

ExtendedDiscountCurve

9.153.1 Detailed Description

Term structure based on loglinear interpolation of discount factors.


Loglinear interpolation guarantees piecewise constant forward rates.
Rates are assumed to be annual continuos compounding.

Public Member Functions

• ExtendedDiscountCurve (const Date &todaysDate, const std::vector< Date > &dates, const
std::vector< DiscountFactor > &dfs, const Calendar &calendar, const RollingConvention
roll, const DayCounter &dayCounter=Actual365())
• Calendar calendar () const
• RollingConvention roll () const

Observer interface

• void update ()

Protected Member Functions

• void calibrateNodes () const


• Handle< TermStructure > reversebootstrap (int) const
• Rate compoundForwardImpl (Time, int, bool extrapolate=false) const
• Handle< TermStructure > forwardCurve (int) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.153 ExtendedDiscountCurve Class Reference 289

9.153.2 Member Function Documentation

9.153.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

9.153.2.2 Rate compoundForwardImpl (Time, int, bool extrapolate = false) const


[protected, virtual]

Returns the forward rate at a specified compound frequency for the given date calculating it from
the zero yield.
Reimplemented from DiscountStructure (p. 252).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


290 QuantLib Class Documentation

9.154 Factorial Class Reference


#include <ql/Math/factorial.hpp>

9.154.1 Detailed Description

Factorial numbers calculator

Static Public Member Functions


• double get (unsigned int n)
• double ln (unsigned int n)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.155 FalsePosition Class Reference 291

9.155 FalsePosition Class Reference


#include <ql/Solvers1D/falseposition.hpp>
Inheritance diagram for FalsePosition:

CuriouslyRecurringTemplate< FalsePosition >

Solver1D< FalsePosition >

FalsePosition

9.155.1 Detailed Description

False position 1-D solver.

Public Member Functions


• template<class F> double solveImpl (const F &f, double xAccuracy) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


292 QuantLib Class Documentation

9.156 FdAmericanOption Class Reference


#include <ql/Pricers/fdamericanoption.hpp>
Inheritance diagram for FdAmericanOption:

SingleAssetOption

FdBsmOption

FdStepConditionOption

FdAmericanOption

9.156.1 Detailed Description

American option.

Public Member Functions


• FdAmericanOption (Option::Type type, double underlying, double strike, Spread
dividendYield, Rate riskFreeRate, Time residualTime, double volatility, int timeSteps, int
gridPoints)
• void initializeStepCondition () const
• Handle< SingleAssetOption > clone () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.157 FdBermudanOption Class Reference 293

9.157 FdBermudanOption Class Reference


#include <ql/Pricers/fdbermudanoption.hpp>

9.157.1 Detailed Description

Bermudan option.

Public Member Functions


• FdBermudanOption (Option::Type type, double underlying, double strike, Spread
dividendYield, Rate riskFreeRate, Time residualTime, double volatility, const std::vector<
Time > &dates=std::vector< Time >(), int timeSteps=100, int gridPoints=100)
• Handle< SingleAssetOption > clone () const

Protected Member Functions


• void initializeStepCondition () const
• void executeIntermediateStep (int) const

Protected Attributes
• double extraTermInBermudan

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


294 QuantLib Class Documentation

9.158 FdBsmOption Class Reference


#include <ql/Pricers/fdbsmoption.hpp>
Inheritance diagram for FdBsmOption:

SingleAssetOption

FdBsmOption

FdEuropean FdStepConditionOption

FdAmericanOption

9.158.1 Detailed Description

Black-Scholes-Merton option priced numerically.

Public Member Functions


• FdBsmOption (Option::Type type, double underlying, double strike, Spread dividendYield,
Rate riskFreeRate, Time residualTime, double volatility, Size gridPoints)
• virtual void calculate () const=0
• double value () const
• double delta () const
• double gamma () const
• const Array & getGrid () const

Protected Types
• typedef BoundaryCondition< TridiagonalOperator > BoundaryCondition

Protected Member Functions


• virtual void setGridLimits (double center, double timeDelay) const
• virtual void initializeGrid () const
• virtual void initializeInitialCondition () const
• virtual void initializeOperator () const

Protected Attributes
• Size gridPoints_
• double value_
• double delta_
• double gamma_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.158 FdBsmOption Class Reference 295

• Array grid_
• BSMOperator finiteDifferenceOperator_
• Array intrinsicValues_
• std::vector< Handle< BoundaryCondition > > BCs_
• double sMin_
• double center_
• double sMax_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


296 QuantLib Class Documentation

9.159 FdDividendAmericanOption Class Reference


#include <ql/Pricers/fddividendamericanoption.hpp>

9.159.1 Detailed Description

American option with discrete dividends.

Bug
sometimes yields negative vega when deeply in-the-money
method impliedVolatility() utterly fails

Public Member Functions


• FdDividendAmericanOption (Option::Type type, double underlying, double strike,
Spread dividendYield, Rate riskFreeRate, Time residualTime, double volatility, const
std::vector< double > &dividends=std::vector< double >(), const std::vector< Time >
&exdivdates=std::vector< Time >(), int timeSteps=100, int gridPoints=100)
• Handle< SingleAssetOption > clone () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.160 FdDividendEuropeanOption Class Reference 297

9.160 FdDividendEuropeanOption Class Reference


#include <ql/Pricers/fddividendeuropeanoption.hpp>
Inheritance diagram for FdDividendEuropeanOption:

SingleAssetOption

EuropeanOption

FdDividendEuropeanOption

9.160.1 Detailed Description

European option with dividends.

Public Member Functions


• FdDividendEuropeanOption (Option::Type type, double underlying, double strike, Spread
dividendYield, Rate riskFreeRate, Time residualTime, double volatility, const std::vector<
double > &dividends, const std::vector< Time > &exdivdates)
• double theta () const
• double rho () const
• double dividendRho () const
• Handle< SingleAssetOption > clone () const
• double riskless (Rate r, std::vector< double > divs, std::vector< Time > divDates) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


298 QuantLib Class Documentation

9.161 FdDividendShoutOption Class Reference


#include <ql/Pricers/fddividendshoutoption.hpp>

9.161.1 Detailed Description

Shout option with dividends.

Public Member Functions


• FdDividendShoutOption (Option::Type type, double underlying, double strike,
Spread dividendYield, Rate riskFreeRate, Time residualTime, double volatility, const
std::vector< double > &dividends=std::vector< double >(), const std::vector< Time >
&exdivdates=std::vector< Time >(), int timeSteps=100, int gridPoints=100)
• Handle< SingleAssetOption > clone () const
• double dividendRho () const

Protected Member Functions


• void initializeStepCondition () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.162 FdEuropean Class Reference 299

9.162 FdEuropean Class Reference


#include <ql/Pricers/fdeuropean.hpp>
Inheritance diagram for FdEuropean:

SingleAssetOption

FdBsmOption

FdEuropean

9.162.1 Detailed Description

Example of European option calculated using finite differences.

Public Member Functions


• FdEuropean (Option::Type type, double underlying, double strike, Spread dividendYield,
Rate riskFreeRate, Time residualTime, double volatility, Size timeSteps=200, Size grid-
Points=800)
• const Array & getPrices () const
• Handle< SingleAssetOption > clone () const

Protected Member Functions


• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


300 QuantLib Class Documentation

9.163 FdStepConditionOption Class Reference


#include <ql/Pricers/fdstepconditionoption.hpp>
Inheritance diagram for FdStepConditionOption:

SingleAssetOption

FdBsmOption

FdStepConditionOption

FdAmericanOption

9.163.1 Detailed Description

option executing additional code at each time step

Protected Member Functions


• FdStepConditionOption (Option::Type type, double underlying, double strike, Spread
dividendYield, Rate riskFreeRate, Time residualTime, double volatility, int timeSteps, int
gridPoints)
• void calculate () const
• virtual void initializeStepCondition () const=0

Protected Attributes
• Handle< StandardStepCondition > stepCondition_
• int timeSteps_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.164 filtering_iterator Class Template Reference 301

9.164 filtering_iterator Class Template Reference


#include <ql/Utilities/filteringiterator.hpp>

9.164.1 Detailed Description

template<class Iterator, class UnaryPredicate> class QuantLib::filtering_iterator< Iterator,


UnaryPredicate >

Iterator filtering undesired data.


This iterator advances an underlying iterator returning only those data satisfying a given condi-
tion.

Public Member Functions


• filtering_iterator (const Iterator &, const UnaryPredicate &, const Iterator &beforeBegin,
const Iterator &end)

Dereferencing

• reference operator ∗ () const


• pointer operator → () const

Increment and decrement

• filtering_iterator & operator++ ()


• filtering_iterator operator++ (int)
• filtering_iterator & operator– ()
• filtering_iterator operator– (int)

Comparisons

• bool operator== (const filtering_iterator< Iterator, UnaryPredicate > &)


• bool operator!= (const filtering_iterator< Iterator, UnaryPredicate > &)

Public Attributes
• typedef< Iterator >::pointer pointer
• typedef< Iterator >::reference reference

Related Functions

(Note that these are not member functions.)

• filtering_iterator< Iterator, UnaryPredicate > make_filtering_iterator (Iterator it, Unary-


Predicate p, Iterator beforeBegin, Iterator end)
helper function to create filtering iterators

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


302 QuantLib Class Documentation

9.165 FiniteDifferenceModel Class Template Reference


#include <ql/FiniteDifferences/finitedifferencemodel.hpp>

9.165.1 Detailed Description

template<class Evolver> class QuantLib::FiniteDifferenceModel< Evolver >

Generic finite difference model.


See sect. The finite differences framework(p. 37)

Public Types
• typedef Evolver::arrayType arrayType
• typedef Evolver::operatorType operatorType
• typedef BoundaryCondition< operatorType > bcType
• typedef StepCondition< arrayType > conditionType

Public Member Functions


• FiniteDifferenceModel (const operatorType &L, const std::vector< Handle< bcType > >
&bcs, const std::vector< Time > &stoppingTimes=std::vector< Time >())
• FiniteDifferenceModel (const Evolver &evolver, const std::vector< Time > &stopping-
Times=std::vector< Time >())
• void rollback (arrayType &a, Time from, Time to, Size steps, const Handle< conditionType
> &condition=Handle< conditionType >())
• const Evolver & evolver () const

9.165.2 Member Function Documentation

9.165.2.1 void rollback (arrayType & a, Time from, Time to, Size steps, const Handle<
conditionType > & condition = Handle< conditionType >())

solves the problem between the given times, possibly applying a condition at every step.

Warning:
being this a rollback, from must be a later time than to.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.166 FixedRateCoupon Class Reference 303

9.166 FixedRateCoupon Class Reference


#include <ql/CashFlows/fixedratecoupon.hpp>
Inheritance diagram for FixedRateCoupon:

Observable

CashFlow

Coupon

FixedRateCoupon

9.166.1 Detailed Description

Coupon paying a fixed interest rate

Public Member Functions


• FixedRateCoupon (double nominal, const Date &paymentDate, Rate rate, const Day-
Counter &dayCounter, const Date &startDate, const Date &endDate, const Date &ref-
PeriodStart=Date(), const Date &refPeriodEnd=Date())

CashFlow interface

• double amount () const


returns the amount of the cash flow

Coupon interface

• DayCounter dayCounter () const


day counter for accrual calculation

• double accruedAmount (const Date &) const


accrued amount at the given date

Inspectors

• Rate rate () const

Visitability

• virtual void accept (AcyclicVisitor &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


304 QuantLib Class Documentation

9.166.2 Member Function Documentation

9.166.2.1 double amount () const [virtual]

returns the amount of the cash flow

Note:
The amount is not discounted, i.e., it is the actual amount paid at the cash flow date.

Implements CashFlow (p. 200).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.167 FloatingRateCoupon Class Reference 305

9.167 FloatingRateCoupon Class Reference


#include <ql/CashFlows/floatingratecoupon.hpp>
Inheritance diagram for FloatingRateCoupon:

Observable

CashFlow

Coupon

FloatingRateCoupon

IndexedCoupon ParCoupon

InArrearIndexedCoupon UpFrontIndexedCoupon ShortFloatingRateCoupon

9.167.1 Detailed Description

Coupon at par on a term structure

Warning:
This class does not perform any date adjustment, i.e., the start and end date passed upon
construction should be already rolled to a business day.

Public Member Functions


• FloatingRateCoupon (double nominal, const Date &paymentDate, const Date &start-
Date, const Date &endDate, int fixingDays, Spread spread=0.0, const Date &refPeriod-
Start=Date(), const Date &refPeriodEnd=Date())

Coupon interface

• double accruedAmount (const Date &) const


accrued amount at the given date

Inspectors

• int fixingDays () const


• virtual Spread spread () const
• virtual Rate fixing () const=0
• virtual Date fixingDate () const=0

Visitability

• virtual void accept (AcyclicVisitor &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


306 QuantLib Class Documentation

Protected Attributes
• int fixingDays_
• Spread spread_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.168 Floor Class Reference 307

9.168 Floor Class Reference


#include <ql/Instruments/capfloor.hpp>
Inheritance diagram for Floor:

Observable Observer

LazyObject

Instrument

CapFloor

Floor

9.168.1 Detailed Description

Concrete floor class.

Public Member Functions


• Floor (const std::vector< Handle< CashFlow > > &floatingLeg, const std::vector< Rate
> &exerciseRates, const RelinkableHandle< TermStructure > &termStructure, const
Handle< PricingEngine > &engine)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


308 QuantLib Class Documentation

9.169 ForwardEngine Class Template Reference


#include <ql/PricingEngines/Forward/forwardengine.hpp>
Inheritance diagram for ForwardEngine:

Observable

PricingEngine

GenericEngine< ForwardOptionArguments< ArgumentsType >, ResultsType >

ForwardEngine

ForwardPerformanceEngine< ArgumentsType, ResultsType >

9.169.1 Detailed Description

template<class ArgumentsType, class ResultsType> class QuantLib::ForwardEngine<


ArgumentsType, ResultsType >

Forward engine base class.

Public Member Functions


• ForwardEngine (const Handle< GenericEngine< ArgumentsType, ResultsType > > &)
• void setOriginalArguments () const
• void calculate () const
• void getOriginalResults () const

Protected Attributes
• Handle< GenericEngine< ArgumentsType, ResultsType > > originalEngine_
• ArgumentsType ∗ originalArguments_
• const ResultsType ∗ originalResults_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.170 ForwardOptionArguments Class Template Reference 309

9.170 ForwardOptionArguments Class Template Reference


#include <ql/Instruments/forwardvanillaoption.hpp>

9.170.1 Detailed Description

template<class ArgumentsType> class QuantLib::ForwardOptionArguments< Arguments-


Type >

Arguments for forward (strike-resetting) option calculation

Public Member Functions


• void validate () const

Public Attributes
• double moneyness
• Date resetDate

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


310 QuantLib Class Documentation

9.171 ForwardPerformanceEngine Class Template Reference


#include <ql/PricingEngines/Forward/forwardperformanceengine.hpp>
Inheritance diagram for ForwardPerformanceEngine:

Observable

PricingEngine

GenericEngine< ForwardOptionArguments< ArgumentsType >, ResultsType >

ForwardEngine<ArgumentsType, ResultsType>

ForwardPerformanceEngine

9.171.1 Detailed Description

template<class ArgumentsType, class ResultsType> class QuantLib::ForwardPerformance-


Engine< ArgumentsType, ResultsType >

Forward performance engine.

Public Member Functions


• ForwardPerformanceEngine (const Handle< GenericEngine< ArgumentsType, Results-
Type > > &)
• void calculate () const
• void getOriginalResults () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.172 ForwardRateStructure Class Reference 311

9.172 ForwardRateStructure Class Reference


#include <ql/termstructure.hpp>
Inheritance diagram for ForwardRateStructure:

Observable

TermStructure

ForwardRateStructure

ForwardSpreadedTermStructure

9.172.1 Detailed Description

Forward rate term structure.


This abstract class acts as an adapter to TermStructure(p. 594) allowing the programmer to im-
plement only the forwardImpl(const Date&, bool) method in derived classes.
Rates are assumed to be annual continuos compounding.

Protected Member Functions


• Rate zeroYieldImpl (Time, bool extrapolate=false) const
• DiscountFactor discountImpl (Time, bool extrapolate=false) const
• Rate compoundForwardImpl (Time, int, bool extrapolate=false) const

9.172.2 Member Function Documentation

9.172.2.1 Rate zeroYieldImpl (Time, bool extrapolate = false) const [protected, virtual]

Returns the zero yield rate for the given date calculating it from the instantaneous forward rate.

Warning:
This is just a default, highly inefficient implementation. Derived classes should implement
their own zeroYield method.

Implements TermStructure (p. 595).


Reimplemented in ForwardSpreadedTermStructure (p. 314).

9.172.2.2 DiscountFactor discountImpl (Time, bool extrapolate = false) const [protected,


virtual]

Returns the discount factor for the given date calculating it from the instantaneous forward rate.
Implements TermStructure (p. 595).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


312 QuantLib Class Documentation

9.172.2.3 Rate compoundForwardImpl (Time, int, bool extrapolate = false) const


[protected, virtual]

Returns the forward rate at a specified compound frequency for the given date calculating it from
the zero yield.
Implements TermStructure (p. 595).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.173 ForwardSpreadedTermStructure Class Reference 313

9.173 ForwardSpreadedTermStructure Class Reference


#include <ql/TermStructures/forwardspreadedtermstructure.hpp>
Inheritance diagram for ForwardSpreadedTermStructure:

Observable

TermStructure

ForwardRateStructure Observer

ForwardSpreadedTermStructure

9.173.1 Detailed Description

Term structure with added spread on the instantaneous forward rate.

Note:
This term structure will remain linked to the original structure, i.e., any changes in the latter
will be reflected in this structure as well.

Public Member Functions


• ForwardSpreadedTermStructure (const RelinkableHandle< TermStructure > &, const
RelinkableHandle< Quote > &spread)

TermStructure interface

• DayCounter dayCounter () const


the day counter used for date/time conversion

• Date todaysDate () const


today’s date

• Date referenceDate () const


the reference date, i.e., the date at which discount = 1

• Date maxDate () const


the latest date for which the curve can return rates

• Time maxTime () const


the latest time for which the curve can return rates

Observer interface

• void update ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


314 QuantLib Class Documentation

Protected Member Functions


• Rate forwardImpl (Time, bool extrapolate=false) const
returns the spreaded forward rate

• Rate zeroYieldImpl (Time, bool extrapolate=false) const


returns the spreaded zero yield rate

9.173.2 Member Function Documentation

9.173.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

9.173.2.2 Rate zeroYieldImpl (Time, bool extrapolate = false) const [protected, virtual]

returns the spreaded zero yield rate

Warning:
This method must disappear should the spread become a curve

Reimplemented from ForwardRateStructure (p. 311).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.174 ForwardVanillaOption Class Reference 315

9.174 ForwardVanillaOption Class Reference

#include <ql/Instruments/forwardvanillaoption.hpp>
Inheritance diagram for ForwardVanillaOption:

Observable Observer

LazyObject

Instrument

Option

OneAssetOption

OneAssetStrikedOption

VanillaOption

ForwardVanillaOption

9.174.1 Detailed Description

Forward version of a vanilla option.

Public Types

• typedef ForwardOptionArguments< VanillaOption::arguments > arguments


• typedef VanillaOption::results results

Public Member Functions

• ForwardVanillaOption (double moneyness, Date resetDate, const Handle< BlackScholes-


StochasticProcess > &stochProc, const Handle< StrikedTypePayoff > &payoff, const
Handle< Exercise > &exercise, const Handle< PricingEngine > &engine)
• void setupArguments (Arguments ∗) const

Protected Member Functions

• void performCalculations () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


316 QuantLib Class Documentation

9.174.2 Member Function Documentation

9.174.2.1 void setupArguments (Arguments ∗) const [virtual]

When a derived argument structure is defined for an instrument, this method should be overrid-
den to fill it. This is mandatory in case a pricing engine is used.
Reimplemented from OneAssetStrikedOption (p. 482).

9.174.2.2 void performCalculations () const [protected, virtual]

In case a pricing engine is not used, this method must be overridden to perform the actual calcu-
lations and set any needed results. In case a pricing engine is used, the default implementation
can be used.
Reimplemented from VanillaOption (p. 624).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.175 Frankfurt Class Reference 317

9.175 Frankfurt Class Reference


#include <ql/Calendars/frankfurt.hpp>
Inheritance diagram for Frankfurt:

Bridge< Calendar, CalendarImpl >

Calendar

Frankfurt

9.175.1 Detailed Description

Frankfurt calendar
Holidays:

• Saturdays
• Sundays
• New Year’s Day, January 1st
• Good Friday
• Easter Monday
• Ascension Thursday
• Whit Monday
• Corpus Christi
• Labour Day, May 1st
• National Day, October 3rd
• Christmas Eve, December 24th
• Christmas, December 25th
• Boxing Day, December 26th

• New Year’s Eve, December 31st

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


318 QuantLib Class Documentation

9.176 FraRateHelper Class Reference

#include <ql/TermStructures/ratehelpers.hpp>
Inheritance diagram for FraRateHelper:

Observer Observable

RateHelper

FraRateHelper

9.176.1 Detailed Description

Forward rate agreement.

Warning:
This class assumes that the reference date does not change between calls of setTerm-
Structure()(p. 318).

Todo
convexity adjustment should be implemented.

Public Member Functions

• FraRateHelper (const RelinkableHandle< Quote > &rate, int monthsToStart, int months-
ToEnd, int settlementDays, const Calendar &calendar, RollingConvention convention, const
DayCounter &dayCounter)
• FraRateHelper (double rate, int monthsToStart, int monthsToEnd, int settlementDays, const
Calendar &calendar, RollingConvention convention, const DayCounter &dayCounter)
• double impliedQuote () const
• DiscountFactor discountGuess () const
• void setTermStructure (TermStructure ∗)
sets the term structure to be used for pricing

• Date maturity () const


maturity date

9.176.2 Member Function Documentation

9.176.2.1 void setTermStructure (TermStructure ∗) [virtual]

sets the term structure to be used for pricing

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.176 FraRateHelper Class Reference 319

Warning:
Being a pointer and not a Handle(p. 339), the term structure is not guaranteed to remain
allocated for the whole life of the rate helper. It is responsibility of the programmer to ensure
that the pointer remains valid. It is advised that rate helpers be used only in term structure
constructors, setting the term structure to this, i.e., the one being constructed.

Reimplemented from RateHelper (p. 537).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


320 QuantLib Class Documentation

9.177 FuturesRateHelper Class Reference


#include <ql/TermStructures/ratehelpers.hpp>
Inheritance diagram for FuturesRateHelper:

Observer Observable

RateHelper

FuturesRateHelper

9.177.1 Detailed Description

Interest-rate futures.

Warning:
This class assumes that the reference date does not change between calls of setTerm-
Structure()(p. 537).

Public Member Functions


• FuturesRateHelper (const RelinkableHandle< Quote > &price, const Date &ImmDate,
int nMonths, const Calendar &calendar, RollingConvention convention, const DayCounter
&dayCounter)
• FuturesRateHelper (const RelinkableHandle< Quote > &price, const Date &ImmDate,
const Date &MatDate, const Calendar &calendar, RollingConvention convention, const
DayCounter &dayCounter)
• FuturesRateHelper (double price, const Date &ImmDate, int nMonths, const Calendar
&calendar, RollingConvention convention, const DayCounter &dayCounter)
• double impliedQuote () const
• DiscountFactor discountGuess () const
• Date maturity () const
maturity date

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.178 G2 Class Reference 321

9.178 G2 Class Reference


#include <ql/ShortRateModels/TwoFactorModels/g2.hpp>
Inheritance diagram for G2:

Observer Observable

ShortRateModel TermStructureConsistentModel

TwoFactorModel AffineModel

G2

9.178.1 Detailed Description

Two-additive-factor gaussian model class.


This class implements a two-additive-factor model defined by
drt = ϕ(t) + xt + yt
where xt and yt are defined by
dxt = −axt dt + σdWt1 , x0 = 0
dyt = −byt dt + σdWt2 , y0 = 0
and dWt1 dWt2 = ρdt.

Bug
This class was not tested enough to guarantee its functionality.

Public Member Functions


• G2 (const RelinkableHandle< TermStructure > &termStructure, double a=0.1, double
sigma=0.01, double b=0.1, double eta=0.01, double rho=0.9)
• Handle< ShortRateDynamics > dynamics () const
Returns the short-rate dynamics.

• double discountBondOption (Option::Type type, double strike, Time maturity, Time bond-
Maturity) const
• double swaption (const Swaption::arguments &arguments) const
• DiscountFactor discount (Time t) const
Implied discount curve.

Protected Member Functions


• void generateArguments ()
• double A (Time t, Time T) const
• double B (double x, Time t) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


322 QuantLib Class Documentation

Friends
• class SwaptionPricingFunction

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.179 G2::FittingParameter Class Reference 323

9.179 G2::FittingParameter Class Reference


#include <ql/ShortRateModels/TwoFactorModels/g2.hpp>
Inheritance diagram for G2::FittingParameter:

Bridge< Parameter, ParameterImpl >

Parameter

TermStructureFittingParameter

G2::FittingParameter

9.179.1 Detailed Description

Analytical term-structure fitting parameter ϕ(t).


ϕ(t) is analytically defined by

1 σ(1 − e−at ) 2 1 η(1 − e−bt ) 2 σ(1 − e−at ) η(1 − e−bt )


ϕ(t) = f (t) + ( ) + ( ) +ρ ,
2 a 2 b a b
where f (t) is the instantaneous forward rate at t.

Public Member Functions


• FittingParameter (const RelinkableHandle< TermStructure > &termStructure, double a,
double sigma, double b, double eta, double rho)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


324 QuantLib Class Documentation

9.180 GammaFunction Class Reference


#include <ql/Math/gammadistribution.hpp>

9.180.1 Detailed Description

Gamma function class.


This is a function defined by Z ∞
Γ(z) = tz−1 e−t dt
0

The implementation of the algorithm was inspired by "Numerical Recipes in C", 2nd edition,
Press, Teukolsky, Vetterling, Flannery, chapter 6

Public Member Functions


• double logValue (double x) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.181 GapPayoff Class Reference 325

9.181 GapPayoff Class Reference


#include <ql/Instruments/payoffs.hpp>
Inheritance diagram for GapPayoff:

Payoff

TypePayoff

StrikedTypePayoff

GapPayoff

9.181.1 Detailed Description

Binary gap payoff.

Public Member Functions


• GapPayoff (Option::Type type, double strike, double strikePayoff)
• double operator() (double price) const
• double strikePayoff () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


326 QuantLib Class Documentation

9.182 GaussianStatistics Class Template Reference

#include <ql/Math/gaussianstatistics.hpp>

9.182.1 Detailed Description

template<class Stat> class QuantLib::GaussianStatistics< Stat >

Statistics tool for gaussian-assumption risk measures.


It can calculate gaussian assumption risk measures (e.g.: value-at-risk, expected shortfall, etc.)
based on the mean and variance provided by the template class

Public Member Functions

• GaussianStatistics (const Stat &s)

Gaussian risk measures

• double gaussianDownsideVariance () const


• double gaussianDownsideDeviation () const
• double gaussianRegret (double target) const
• double gaussianPercentile (double percentile) const
• double gaussianPotentialUpside (double percentile) const
gaussian-assumption Potential-Upside at a given percentile

• double gaussianValueAtRisk (double percentile) const


gaussian-assumption Value-At-Risk at a given percentile

• double gaussianExpectedShortfall (double percentile) const


gaussian-assumption Expected Shortfall at a given percentile

• double gaussianShortfall (double target) const


gaussian-assumption Shortfall (observations below target)

• double gaussianAverageShortfall (double target) const


gaussian-assumption Average(p. 132) Shortfall (averaged shortfallness)

9.182.2 Member Function Documentation

9.182.2.1 double gaussianDownsideVariance () const

returns the downside variance, defined as


PN
N i=1 θ × x2i
× PN
N−1 i=1 wi

, where θ = 0 if x > 0 and θ =1 if x <0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.182 GaussianStatistics Class Template Reference 327

9.182.2.2 double gaussianDownsideDeviation () const

returns the downside deviation, defined as the square root of the downside variance.

9.182.2.3 double gaussianRegret (double target) const

returns the variance of observations below target

wi (min(0, xi − tar1et))2
P
P .
wi

See Dembo, Freeman "The Rules Of Risk", Wiley (2001)

9.182.2.4 double gaussianPercentile (double percentile) const

gaussian-assumption y-th percentile, defined as the value x such that


Z x
1
y= √ exp(−u2 /2)du
2π −∞

9.182.2.5 double gaussianPotentialUpside (double percentile) const

gaussian-assumption Potential-Upside at a given percentile

Precondition:
percentile must be in range [90%-100%)

9.182.2.6 double gaussianValueAtRisk (double percentile) const

gaussian-assumption Value-At-Risk at a given percentile

Precondition:
percentile must be in range [90%-100%)

9.182.2.7 double gaussianExpectedShortfall (double percentile) const

gaussian-assumption Expected Shortfall at a given percentile

Precondition:
percentile must be in range 90%-100%

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


328 QuantLib Class Documentation

9.183 GBPLibor Class Reference


#include <ql/Indexes/gbplibor.hpp>
Inheritance diagram for GBPLibor:

Observable

Index Observer

Xibor

GBPLibor

9.183.1 Detailed Description

GBP Libor index

Public Member Functions


• GBPLibor (int n, TimeUnit units, const RelinkableHandle< TermStructure > &h, const
DayCounter &dc=Actual365())

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.184 GeneralStatistics Class Reference 329

9.184 GeneralStatistics Class Reference


#include <ql/Math/generalstatistics.hpp>

9.184.1 Detailed Description

Statistics tool.
This class accumulates a set of data and returns their statistics (e.g: mean, variance, skewness,
kurtosis, error estimation, percentile, etc.) based on the empirical distribution (no gaussian
assumption)
It doesn’t suffer the numerical instability problem of IncrementalStatistics(p. 360). The downside
is that it stores all samples, thus increasing the memory requirements.

Public Member Functions


Inspectors

• Size samples () const


number of samples collected

• const std::vector< std::pair< double, double > > & data () const
collected data

• double weightSum () const


sum of data weights

• double mean () const


• double variance () const
• double standardDeviation () const
• double errorEstimate () const
• double skewness () const
• double kurtosis () const
• double min () const
• double max () const
• template<class Func, class Predicate> std::pair< double, Size > expectationValue (const
Func &f, const Predicate &inRange) const
• double percentile (double y) const
• double topPercentile (double y) const

Modifiers

• void add (double value, double weight=1.0)


adds a datum to the set, possibly with a weight

• template<class DataIterator> void addSequence (DataIterator begin, DataIterator end)


adds a sequence of data to the set, with default weight

• template<class DataIterator, class WeightIterator> void addSequence (DataIterator be-


gin, DataIterator end, WeightIterator wbegin)
adds a sequence of data to the set, each with its weight

• void reset ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


330 QuantLib Class Documentation

resets the data to a null set

• void sort () const


sort the data set in increasing order

9.184.2 Member Function Documentation

9.184.2.1 double mean () const

returns the mean, defined as P


wi xi
hxi = P .
wi

9.184.2.2 double variance () const

returns the variance, defined as


N D E
σ2 = (x − hxi)2 .
N−1

9.184.2.3 double standardDeviation () const

returns the standard deviation σ, defined as the square root of the variance.

9.184.2.4 double errorEstimate () const



returns the error estimate on the mean value, defined as  = σ/ N.

9.184.2.5 double skewness () const

returns the skewness, defined as


D E
N2 (x − hxi)3
.
(N − 1)(N − 2) σ3

The above evaluates to 0 for a Gaussian distribution.

9.184.2.6 double kurtosis () const

returns the excess kurtosis, defined as


D E
N2 (N + 1) (x − hxi)4 3(N − 1)2
− .
(N − 1)(N − 2)(N − 3) σ4 (N − 2)(N − 3)

The above evaluates to 0 for a Gaussian distribution.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.184 GeneralStatistics Class Reference 331

9.184.2.7 double min () const

returns the minimum sample value

9.184.2.8 double max () const

returns the maximum sample value

9.184.2.9 std::pair<double,Size> expectationValue (const Func & f, const Predicate &


inRange) const

Expectation value of a function f on a given range R, i.e.,


P
xi ∈R f (xi )wi
E f |R = P .
 
xi ∈R wi

The range is passed as a boolean function returning true if the argument belongs to the range or
false otherwise.
The function returns a pair made of the result and the number of observations in the given range.

9.184.2.10 double percentile (double y) const

y-th percentile, defined as the value x̄ such that


P
x <x̄ wi
y = Pi
i wi

Precondition:
y must be in the range (0 − 1].

9.184.2.11 double topPercentile (double y) const

y-th top percentile, defined as the value x̄ such that


P
x >x̄ wi
y = Pi
i wi

Precondition:
y must be in the range (0 − 1].

9.184.2.12 void add (double value, double weight = 1.0)

adds a datum to the set, possibly with a weight

Precondition:
weights must be positive or null

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


332 QuantLib Class Documentation

9.185 GenericEngine Class Template Reference


#include <ql/pricingengine.hpp>
Inheritance diagram for GenericEngine:

BarrierEngine< BarrierOption::arguments, BarrierOption::results >

BasketEngine< BasketOption::arguments, BasketOption::results >

CliquetEngine< CliquetOption::arguments, VanillaOption::results >

DiscreteAveragingAsianEngine< DiscreteAveragingAsianOption::arguments, DiscreteAveragingAsianOption::results >

GenericModelEngine< ArgumentsType, ResultsType >

GenericModelEngine< AffineModel, CapFloor::arguments, CapFloor::results >


PricingEngine GenericEngine
GenericModelEngine< BlackModel, CapFloor::arguments, CapFloor::results >

GenericModelEngine< BlackModel, Swaption::arguments, Swaption::results >

GenericModelEngine< OneFactorAffineModel, Swaption::arguments, Swaption::results >

GenericModelEngine< ShortRateModel, CapFloor::arguments, CapFloor::results >

GenericModelEngine< ShortRateModel, Swaption::arguments, Swaption::results >

VanillaEngine< VanillaOption::arguments, VanillaOption::results >

9.185.1 Detailed Description

template<class ArgumentsType, class ResultsType> class QuantLib::GenericEngine<


ArgumentsType, ResultsType >

template base class for option pricing engines


Derived engines only need to implement the calculate() method.

Public Member Functions


• Arguments ∗ arguments () const
• const Results ∗ results () const
• void reset () const

Protected Attributes
• ArgumentsType arguments_
• ResultsType results_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.186 GenericModelEngine Class Template Reference 333

9.186 GenericModelEngine Class Template Reference


#include <ql/PricingEngines/genericmodelengine.hpp>
Inheritance diagram for GenericModelEngine:

AnalyticalCapFloor< AffineModel, CapFloor::arguments, CapFloor::results >

BlackCapFloor< BlackModel, CapFloor::arguments, CapFloor::results >

GenericEngine<ArgumentsType, ResultsType> BlackSwaption< BlackModel, Swaption::arguments, Swaption::results >


GenericModelEngine
Observer JamshidianSwaption< OneFactorAffineModel, Swaption::arguments, Swaption::results >

LatticeShortRateModelEngine< CapFloor::arguments, CapFloor::results >

LatticeShortRateModelEngine< Swaption::arguments, Swaption::results >

9.186.1 Detailed Description

template<class ModelType, class ArgumentsType, class ResultsType> class Quant-


Lib::GenericModelEngine< ModelType, ArgumentsType, ResultsType >

Base class for some pricing engine on a particular model.


Derived engines only need to implement the calculate() method

Public Member Functions


• GenericModelEngine (const Handle< ModelType > &model)
• void validateArguments () const
• void setModel (const Handle< ModelType > &model)
• virtual void update ()

Protected Attributes
• Handle< ModelType > model_

9.186.2 Member Function Documentation

9.186.2.1 virtual void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).
Reimplemented in LatticeShortRateModelEngine (p. 389), LatticeShortRateModelEngine<
CapFloor::arguments, CapFloor::results > (p. 389), and LatticeShortRateModelEngine< Swap-
tion::arguments, Swaption::results > (p. 389).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


334 QuantLib Class Documentation

9.187 GenericRiskStatistics Class Template Reference


#include <ql/Math/riskstatistics.hpp>

9.187.1 Detailed Description

template<class S> class QuantLib::GenericRiskStatistics< S >

empirical-distribution risk measures


This class wraps a somewhat generic statistic tool and adds a number of risk measures (e.g.: value-
at-risk, expected shortfall, etc.) based on the data distribution as reported by the underlying tool.

Todo
add historical annualized volatility

Public Member Functions


• double semiVariance () const
• double semiDeviation () const
• double downsideVariance () const
• double downsideDeviation () const
• double regret (double target) const
• double potentialUpside (double percentile) const
potential upside (the reciprocal of VAR) at a given percentile

• double valueAtRisk (double percentile) const


value-at-risk at a given percentile

• double expectedShortfall (double percentile) const


expected shortfall at a given percentile

• double shortfall (double target) const


• double averageShortfall (double target) const

9.187.2 Member Function Documentation

9.187.2.1 double semiVariance () const

returns the variance of observations below the mean,


N h i
E (x − hxi)2 | x < hxi .
N−1

See Markowitz (1959).

9.187.2.2 double semiDeviation () const

returns the semi deviation, defined as the square root of the semi variance.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.187 GenericRiskStatistics Class Template Reference 335

9.187.2.3 double downsideVariance () const

returns the variance of observations below 0.0,


N h i
E x2 | x < 0 .
N−1

9.187.2.4 double downsideDeviation () const

returns the downside deviation, defined as the square root of the downside variance.

9.187.2.5 double regret (double target) const

returns the variance of observations below target,

N h i
E (x − t)2 | x < t .
N−1

See Dembo and Freeman, "The Rules Of Risk", Wiley (2001).

9.187.2.6 double potentialUpside (double centile) const

potential upside (the reciprocal of VAR) at a given percentile

Precondition:
percentile must be in range [90%-100%)

9.187.2.7 double valueAtRisk (double centile) const

value-at-risk at a given percentile

Precondition:
percentile must be in range [90%-100%)

9.187.2.8 double expectedShortfall (double percentile) const

expected shortfall at a given percentile


returns the expected loss in case that the loss exceeded a VaR threshold,

E x | x < VaR(p) ,
 

that is the average of observations below the given percentile p. Also know as conditional
value-at-risk.
See Artzner, Delbaen, Eber and Heath, "Coherent measures of risk", Mathematical Finance 9
(1999)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


336 QuantLib Class Documentation

9.187.2.9 double shortfall (double target) const

probability of missing the given target, defined as

E [Θ | (−∞, ∞)]

where
1 x<t
(
Θ(x) =
0 x≥t

9.187.2.10 double averageShortfall (double target) const

averaged shortfallness, defined as


E [t − x | x < t]

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.188 Greeks Class Reference 337

9.188 Greeks Class Reference


#include <ql/option.hpp>
Inheritance diagram for Greeks:

Results

Greeks

results results

9.188.1 Detailed Description

additional option results

Public Member Functions


• void reset ()

Public Attributes
• double delta
• double gamma
• double theta
• double vega
• double rho
• double dividendRho

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


338 QuantLib Class Documentation

9.189 HaltonRsg Class Reference


#include <ql/RandomNumbers/haltonrsg.hpp>

9.189.1 Detailed Description

Halton low-discrepancy sequence generator.


Halton algorithm for low-discrepancy sequence. For more details see chapter 8, paragraph 2 of
"Monte Carlo Methods in Finance", by Peter Jäckel

Public Types
• typedef Sample< Array > sample_type

Public Member Functions


• HaltonRsg (Size dimensionality, unsigned long seed=0, bool randomStart=true, bool
randomShift=false)
• const sample_type & nextSequence () const
• const sample_type & lastSequence () const
• Size dimension () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.190 Handle Class Template Reference 339

9.190 Handle Class Template Reference


#include <ql/handle.hpp>

9.190.1 Detailed Description

template<class T> class QuantLib::Handle< T >

Reference-counted pointer.
This class acts as a proxy to a pointer contained in it. Such pointer is owned by the handle, i.e.,
the handle will be responsible for its deletion, unless explicitly stated by the programmer.
A count of the references to the contained pointer is incremented every time a handle is copied,
and decremented every time a handle is deleted or goes out of scope. When the handle owns the
pointer, this mechanism ensures on one hand, that the pointer will not be deallocated as long as
a handle refers to it, and on the other hand, that it will be deallocated when no more handles do.

Note:
The implementation of this class was originally taken from "The C++ Programming Lan-
guage", 3rd ed., B.Stroustrup, Addison-Wesley, 1997.

Warning:
This mechanism will break and result in untimely deallocation of the pointer (and very
possible death of your executable) if two handles are explicitly initialized with the same
pointer, as in
SomeObj* so = new SomeObj;
Handle<SomeObj> h1(so);
Handle<SomeObj> h2 = h1; // this is safe.
Handle<SomeObj> h3(so); // this is definitely not.

It is good practice to create the pointer and immediately pass it to the handle, as in
Handle<SomeObj> h1(new SomeObj); // this is as safe as can be.

When the programmer keeps the ownership of the pointer, as explicitly declared in
SomeObj so;
Handle<SomeObj> h(&so,false);

it is responsibility of the programmer to make sure that the object remain in scope as long
as there are handles pointing to it. Also, the programmer must explicitly delete the object if
required.

Public Member Functions


constructors, destructor, and assignment

• Handle (T ∗ptr=0, bool owns=true)


Constructor taking a pointer.

• template<class U> Handle (const Handle< U > &from)


• Handle (const Handle &from)
• template<class U> Handle & operator= (const Handle< U > &from)
• Handle & operator= (const Handle &from)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


340 QuantLib Class Documentation

Dereferencing

• T & operator ∗ () const


• T ∗ operator → () const

Inspectors

• bool isNull () const


Checks if the contained pointer is actually allocated.

• bool operator== (const Handle< T > &) const


Checks if the two handles point to the same object.

• bool operator!= (const Handle< T > &) const

Friends
• class HandleCopier

9.190.2 Constructor & Destructor Documentation

9.190.2.1 Handle (T ∗ ptr = 0, bool owns = true) [explicit]

Constructor taking a pointer.


If owns is set to true (the default), the handle will be responsible for the deletion of the pointer.
If it is set to false, the programmer must make sure that the pointed object remains in scope for
the lifetime of the handle and its copies. Destruction of the object is also responsibility of the
programmer.
It is advised that handles be used with owns = false only in a controlled an self-contained
environment. Such a case happens when an object needs to pass a handle to itself to inner classes
or bootstrappers - i.e., contained or temporary objects whose lifetime is guaranteed not to last
more than the lifetime of the object.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.191 Helsinki Class Reference 341

9.191 Helsinki Class Reference


#include <ql/Calendars/helsinki.hpp>
Inheritance diagram for Helsinki:

Bridge< Calendar, CalendarImpl >

Calendar

Helsinki

9.191.1 Detailed Description

Helsinki calendar
Holidays:

• Saturdays
• Sundays
• New Year’s Day, January 1st
• Epiphany, January 6th
• Good Friday
• Easter Monday
• Ascension Thursday
• Labour Day, May 1st
• Midsummer Eve (Friday between June 18-24)
• Independence Day, December 6th
• Christmas Eve, December 24th
• Christmas, December 25th
• Boxing Day, December 26th

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


342 QuantLib Class Documentation

9.192 History Class Reference


#include <ql/history.hpp>

9.192.1 Detailed Description

Container for historical data.


This class acts as a generic repository for a set of historical data. Single data can be accessed
through their date, while sets of consecutive data can be accessed through iterators.
A history can contain null data, which can either be returned or skipped according to the chosen
iterator type.
Example: uses of history iterators (p. ??)

Public Types
• typedef filtering_iterator< const_iterator, DataValidator > const_valid_iterator
bidirectional iterator on non-null history entries

• typedef std::vector< double >::const_iterator const_data_iterator


random access iterator on historical data

• typedef filtering_iterator< const_data_iterator, DataValidator > const_valid_data_iterator


bidirectional iterator on non-null historical data

Public Member Functions


• History ()
• template<class Iterator> History (const Date &firstDate, const Date &lastDate, Iterator
begin, Iterator end)
• History (const Date &firstDate, const std::vector< double > &values)
• History (const Date &firstDate, const Date &lastDate, const std::vector< double > &values)
• History (const std::vector< Date > &dates, const std::vector< double > &values)

Inspectors

• const Date & firstDate () const


returns the first date for which a historical datum exists

• const Date & lastDate () const


returns the last date for which a historical datum exists

• int size () const


returns the number of historical data including null ones

Historical data access

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.192 History Class Reference 343

• double operator[ ] (const Date &) const


returns the (possibly null) datum corresponding to the given date

Iterator access
Four different types of iterators are provided, namely, const_iterator, const_valid_iterator, const_data_-
iterator, and const_valid_data_iterator.
const_iterator and const_valid_iterator point to an Entry structure, the difference being that the latter
only iterates over valid entries - i.e., entries whose data are not null. The same difference exists between
const_data_iterator and const_valid_data_iterator which point directly to historical values without
reference to the date they are associated to.

• const_iterator begin () const


• const_iterator end () const
• const_iterator iterator (const Date &d) const
• const_valid_iterator vbegin () const
• const_valid_iterator vend () const
• const_valid_iterator valid_iterator (const Date &d) const
• const_data_iterator dbegin () const
• const_data_iterator dend () const
• const_data_iterator data_iterator (const Date &d) const
• const_valid_data_iterator vdbegin () const
• const_valid_data_iterator vdend () const
• const_valid_data_iterator valid_data_iterator (const Date &d) const

9.192.2 Constructor & Destructor Documentation

9.192.2.1 History ()

Default constructor

9.192.2.2 History (const Date & firstDate, const Date & lastDate, Iterator begin, Iterator end)

This constructor initializes the history with the given set of values, corresponding to the date
range between firstDate and lastDate included.

Precondition:
begin-end must equal the number of days from firstDate to lastDate included.

9.192.2.3 History (const Date & firstDate, const Date & lastDate, const std::vector< double >
& values)

This constructor initializes the history with the given set of values, corresponding to the date
range between firstDate and lastDate included.

Precondition:
The size of values must equal the number of days from firstDate to lastDate included.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


344 QuantLib Class Documentation

9.192.2.4 History (const std::vector< Date > & dates, const std::vector< double > & values)

This constructor initializes the history with the given set of values, corresponding each to the
element with the same index in the given set of dates. The whole date range between dates[0]
and dates[N-1] will be automatically filled by inserting null values where a date is missing from
the given set.

Precondition:
dates must be sorted.
There can be no pairs (dates[i],values[i]) and (dates[j],values[j]) such that dates[i] ==
dates[j] && values[i] != values[j]. Pairs with dates[i] == dates[j] && values[i]
== values[j] are allowed; the duplicated entries will be discarded.
The size of values must equal the number of days from firstDate to lastDate included.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.193 History::const_iterator Class Reference 345

9.193 History::const_iterator Class Reference


#include <ql/history.hpp>

9.193.1 Detailed Description

random access iterator on history entries

Public Types
• typedef Entry value_type
• typedef int difference_type
• typedef const Entry ∗ pointer
• typedef const Entry & reference

Public Member Functions


Dereferencing

• reference operator ∗ () const


• pointer operator → () const

Random access

• value_type operator[ ] (difference_type i) const

Increment and decrement

• const_iterator & operator++ ()


• const_iterator operator++ (int)
• const_iterator & operator– ()
• const_iterator operator– (int)
• const_iterator & operator+= (difference_type i)
• const_iterator & operator-= (difference_type i)
• const_iterator operator+ (difference_type i)
• const_iterator operator- (difference_type i)

Difference

• difference_type operator- (const const_iterator &i)

Comparisons

• bool operator== (const const_iterator &i)


• bool operator!= (const const_iterator &i)
• bool operator< (const const_iterator &i)
• bool operator> (const const_iterator &i)
• bool operator<= (const const_iterator &i)
• bool operator>= (const const_iterator &i)

Friends
• class History

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


346 QuantLib Class Documentation

9.194 History::Entry Class Reference


#include <ql/history.hpp>

9.194.1 Detailed Description

single datum in history

Public Member Functions


• const Date & date () const
• double value () const

Friends
• class const_iterator

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.195 HullWhite Class Reference 347

9.195 HullWhite Class Reference


#include <ql/ShortRateModels/OneFactorModels/hullwhite.hpp>
Inheritance diagram for HullWhite:

Observer Observable

ShortRateModel

OneFactorModel AffineModel

OneFactorAffineModel TermStructureConsistentModel

Vasicek

HullWhite

9.195.1 Detailed Description

Single-factor Hull-White (extended Vasicek) model class.


This class implements the standard single-factor Hull-White model defined by

drt = (θ(t) − αrt )dt + σdWt

where α and σ are constants.

Public Member Functions


• HullWhite (const RelinkableHandle< TermStructure > &termStructure, double a=0.1,
double sigma=0.01)
• Handle< Lattice > tree (const TimeGrid &grid) const
Return by default a trinomial recombining tree.

• Handle< ShortRateDynamics > dynamics () const


returns the short-rate dynamics

• double discountBondOption (Option::Type type, double strike, Time maturity, Time bond-
Maturity) const

Protected Member Functions


• void generateArguments ()
• double A (Time t, Time T) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


348 QuantLib Class Documentation

9.196 HullWhite::Dynamics Class Reference


#include <ql/ShortRateModels/OneFactorModels/hullwhite.hpp>

9.196.1 Detailed Description

Short-rate dynamics in the Hull-White model.


The short-rate is here
rt = ϕ(t) + xt
where ϕ(t) is the deterministic time-dependent parameter used for term-structure fitting and xt
is the state variable following an Ornstein-Uhlenbeck process.

Public Member Functions


• Dynamics (const Parameter &fitting, double a, double sigma)
• double variable (Time t, Rate r) const
• double shortRate (Time t, double x) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.197 HullWhite::FittingParameter Class Reference 349

9.197 HullWhite::FittingParameter Class Reference


#include <ql/ShortRateModels/OneFactorModels/hullwhite.hpp>
Inheritance diagram for HullWhite::FittingParameter:

Bridge< Parameter, ParameterImpl >

Parameter

TermStructureFittingParameter

HullWhite::FittingParameter

9.197.1 Detailed Description

Analytical term-structure fitting parameter ϕ(t).


ϕ(t) is analytically defined by
1 σ(1 − e−at ) 2
ϕ(t) = f (t) + [ ] ,
2 a
where f (t) is the instantaneous forward rate at t.

Public Member Functions


• FittingParameter (const RelinkableHandle< TermStructure > &termStructure, double a,
double sigma)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


350 QuantLib Class Documentation

9.198 ICGaussianRng Class Template Reference


#include <ql/RandomNumbers/inversecumgaussianrng.hpp>

9.198.1 Detailed Description

template<class RNG, class I> class QuantLib::ICGaussianRng< RNG, I >

Inverse cumulative Gaussian random number generator.


It uses a uniform deviate in (0, 1) as the source of cumulative normal distribution values. Then
an inverse cumulative normal distribution is used as it is approximately a Gaussian deviate with
average 0.0 and standard deviation 1.0.
The uniform deviate is supplied by RNG.
Class RNG must implement the following interface:

RNG::sample_type RNG::next() const;

The inverse cumulative normal distribution is supplied by I.


Class I must implement the following interface:

I::I();
double I::operator() const;

Public Types
• typedef Sample< double > sample_type

Public Member Functions


• ICGaussianRng (const RNG &uniformGenerator)
• ICGaussianRng (long seed=0)
• sample_type next () const
returns next sample from the Gaussian distribution

9.198.2 Constructor & Destructor Documentation

9.198.2.1 ICGaussianRng (long seed = 0) [explicit]

Deprecated
initialize with a random number generator instead.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.199 ICGaussianRsg Class Template Reference 351

9.199 ICGaussianRsg Class Template Reference


#include <ql/RandomNumbers/inversecumgaussianrsg.hpp>

9.199.1 Detailed Description

template<class USG, class I> class QuantLib::ICGaussianRsg< USG, I >

Inverse cumulative Gaussian random sequence generator.


It uses a sequence of uniform deviate in (0, 1) as the source of cumulative normal distribution
values. Then an inverse cumulative normal distribution is used as it is approximately a Gaussian
deviate with average 0.0 and standard deviation 1.0.
The uniform deviate sequence is supplied by USG.
Class USG must implement the following interface:

USG::sample_type USG::next() const;


Size USG::dimension() const;

The inverse cumulative normal distribution is supplied by I.


Class I must implement the following interface:

I::I();
double I::operator() const;

Public Types
• typedef Sample< Array > sample_type

Public Member Functions


• ICGaussianRsg (const USG &uniformSequenceGenerator)
• const sample_type & nextSequence () const
returns next sample from the Gaussian distribution

• const sample_type & lastSequence () const


• Size dimension () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


352 QuantLib Class Documentation

9.200 IllegalArgumentError Class Reference


#include <ql/errors.hpp>
Inheritance diagram for IllegalArgumentError:

Error

IllegalArgumentError

9.200.1 Detailed Description

Specialized error.
Thrown upon passing an argument with an illegal value.

Public Member Functions


• IllegalArgumentError (const std::string &what="")

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.201 IllegalResultError Class Reference 353

9.201 IllegalResultError Class Reference


#include <ql/errors.hpp>
Inheritance diagram for IllegalResultError:

Error

IllegalResultError

9.201.1 Detailed Description

Specialized error.
Thrown upon obtaining a result outside the allowed range.

Public Member Functions


• IllegalResultError (const std::string &what="")

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


354 QuantLib Class Documentation

9.202 ImplicitEuler Class Template Reference


#include <ql/FiniteDifferences/impliciteuler.hpp>
Inheritance diagram for ImplicitEuler:

MixedScheme<Operator>

ImplicitEuler

9.202.1 Detailed Description

template<class Operator> class QuantLib::ImplicitEuler< Operator >

Backward Euler scheme for finite difference methods.


See sect. The finite differences framework(p. 37) for details on the method.
In this implementation, the passed operator must be derived from either TimeConstantOperator
or TimeDependentOperator. Also, it must implement at least the following interface:

typedef ... arrayType;

// copy constructor/assignment
// (these will be provided by the compiler if none is defined)
Operator(const Operator&);
Operator& operator=(const Operator&);

// inspectors
Size size();

// modifiers
void setTime(Time t);

// operator interface
arrayType solveFor(const arrayType&);
static Operator identity(Size size);

// operator algebra
Operator operator*(double, const Operator&);
Operator operator+(const Operator&, const Operator&);

Friends
• class FiniteDifferenceModel< ImplicitEuler< Operator > >

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.203 ImpliedTermStructure Class Reference 355

9.203 ImpliedTermStructure Class Reference


#include <ql/TermStructures/impliedtermstructure.hpp>
Inheritance diagram for ImpliedTermStructure:

Observable

TermStructure

DiscountStructure Observer

ImpliedTermStructure

9.203.1 Detailed Description

Implied term structure at a given date in the future.


The given date will be the implied reference date.

Note:
This term structure will remain linked to the original structure, i.e., any changes in the latter
will be reflected in this structure as well.

Public Member Functions


• ImpliedTermStructure (const RelinkableHandle< TermStructure > &, const Date &new-
TodaysDate, const Date &newReferenceDate)

TermStructure interface

• DayCounter dayCounter () const


the day counter used for date/time conversion

• Date todaysDate () const


today’s date

• Date referenceDate () const


the reference date, i.e., the date at which discount = 1

• Date maxDate () const


the latest date for which the curve can return rates

• Time maxTime () const


the latest time for which the curve can return rates

Observer interface

• void update ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


356 QuantLib Class Documentation

Protected Member Functions


• DiscountFactor discountImpl (Time, bool extrapolate=false) const
returns the discount factor as seen from the evaluation date

9.203.2 Member Function Documentation

9.203.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.204 ImpliedVolTermStructure Class Reference 357

9.204 ImpliedVolTermStructure Class Reference


#include <ql/Volatilities/impliedvoltermstructure.hpp>
Inheritance diagram for ImpliedVolTermStructure:

Observable

BlackVolTermStructure

BlackVarianceTermStructure Observer

ImpliedVolTermStructure

9.204.1 Detailed Description

Implied vol term structure at a given date in the future.


The given date will be the implied reference date.

Note:
This term structure will remain linked to the original structure, i.e., any changes in the latter
will be reflected in this structure as well.
Warning:
It doesn’t make financial sense to have an asset-dependant implied Vol Term Structure. This
class should be used with term structures that are time dependant only

Public Member Functions


• ImpliedVolTermStructure (const RelinkableHandle< BlackVolTermStructure >
&originalTS, const Date &newReferenceDate)

BlackVolTermStructure interface
• Date referenceDate () const
returns the reference date for which t=0

• DayCounter dayCounter () const


returns the day counter

• Date maxDate () const


the latest date for which the term structure can return vols

Observer interface
• void update ()

Visitability
• virtual void accept (AcyclicVisitor &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


358 QuantLib Class Documentation

Protected Member Functions


• virtual double blackVarianceImpl (Time t, double strike, bool extrapolate=false) const
implements the actual Black variance calculation in derived classes

9.204.2 Member Function Documentation

9.204.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.205 InArrearIndexedCoupon Class Reference 359

9.205 InArrearIndexedCoupon Class Reference


#include <ql/CashFlows/inarrearindexedcoupon.hpp>
Inheritance diagram for InArrearIndexedCoupon:

Observable

CashFlow

Coupon

FloatingRateCoupon Observer

IndexedCoupon

InArrearIndexedCoupon

9.205.1 Detailed Description

In-arrear indexed coupon class.

Warning:
This class does not perform any date adjustment, i.e., the start and end date passed upon
construction should be already rolled to a business day.

Public Member Functions


• InArrearIndexedCoupon (double nominal, const Date &paymentDate, const Handle<
Xibor > &index, const Date &startDate, const Date &endDate, int fixingDays, Spread
spread=0.0, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date(), const
DayCounter &dayCounter=DayCounter())

FloatingRateCoupon interface

• Date fixingDate () const

Visitability

• virtual void accept (AcyclicVisitor &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


360 QuantLib Class Documentation

9.206 IncrementalStatistics Class Reference

#include <ql/Math/incrementalstatistics.hpp>

9.206.1 Detailed Description

Statistics tool based on incremental accumulation.


It can accumulate a set of data and return statistics (e.g: mean, variance, skewness, kurtosis, error
estimation, etc.)

Warning:
high moments are numerically unstable for high average/standardDeviation ratios

Public Member Functions

Inspectors

• Size samples () const


number of samples collected

• double weightSum () const


sum of data weights

• double mean () const


• double variance () const
• double standardDeviation () const
• double downsideVariance () const
• double downsideDeviation () const
• double errorEstimate () const
• double skewness () const
• double kurtosis () const
• double min () const
• double max () const

Modifiers

• void add (double value, double weight=1.0)


adds a datum to the set, possibly with a weight

• template<class DataIterator> void addSequence (DataIterator begin, DataIterator end)


adds a sequence of data to the set, with default weight

• template<class DataIterator, class WeightIterator> void addSequence (DataIterator be-


gin, DataIterator end, WeightIterator wbegin)
adds a sequence of data to the set, each with its weight

• void reset ()
resets the data to a null set

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.206 IncrementalStatistics Class Reference 361

Protected Attributes

• Size sampleNumber_
• Size downsideSampleNumber_
• double sampleWeight_
• double downsideSampleWeight_
• double sum_
• double quadraticSum_
• double downsideQuadraticSum_
• double cubicSum_
• double fourthPowerSum_
• double min_
• double max_

9.206.2 Member Function Documentation

9.206.2.1 double mean () const

returns the mean, defined as P


wi xi
hxi = P .
wi

9.206.2.2 double variance () const

returns the variance, defined as


N D E
(x − hxi)2 .
N−1

9.206.2.3 double standardDeviation () const

returns the standard deviation σ, defined as the square root of the variance.

9.206.2.4 double downsideVariance () const

returns the downside variance, defined as


PN
i=1 θ × xi
2
N
× PN
N−1 i=1 wi

, where θ = 0 if x > 0 and θ =1 if x <0

9.206.2.5 double downsideDeviation () const

returns the downside deviation, defined as the square root of the downside variance.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


362 QuantLib Class Documentation

9.206.2.6 double errorEstimate () const

returns the error estimate , defined as the square root of the ratio of the variance to the number
of samples.

9.206.2.7 double skewness () const

returns the skewness, defined as


D E
N2 (x − hxi)3
.
(N − 1)(N − 2) σ3

The above evaluates to 0 for a Gaussian distribution.

9.206.2.8 double kurtosis () const

returns the excess kurtosis, defined as


D E
N2 (N + 1) (x − hxi)4 3(N − 1)2
− .
(N − 1)(N − 2)(N − 3) σ4 (N − 2)(N − 3)

The above evaluates to 0 for a Gaussian distribution.

9.206.2.9 double min () const

returns the minimum sample value

9.206.2.10 double max () const

returns the maximum sample value

9.206.2.11 void add (double value, double weight = 1.0)

adds a datum to the set, possibly with a weight

Precondition:
weight must be positive or null

9.206.2.12 void addSequence (DataIterator begin, DataIterator end, WeightIterator wbegin)

adds a sequence of data to the set, each with its weight

Precondition:
weights must be positive or null

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.207 Index Class Reference 363

9.207 Index Class Reference


#include <ql/index.hpp>
Inheritance diagram for Index:

Observable

Index

Xibor

9.207.1 Detailed Description

purely virtual base class for indexes

Public Member Functions


• virtual std::string name () const=0
Returns the name of the index.

• virtual Rate fixing (const Date &fixingDate) const=0


returns the fixing at the given date

9.207.2 Member Function Documentation

9.207.2.1 virtual std::string name () const [pure virtual]

Returns the name of the index.

Warning:
This method is used for output and comparison between indexes. It is not meant to be used
for writing switch-on-type code.

Implemented in Xibor (p. 632).

9.207.2.2 virtual Rate fixing (const Date & fixingDate) const [pure virtual]

returns the fixing at the given date

Note:
any date passed as arguments must be a value date, i.e., the real calendar date advanced by
a number of settlement days.

Implemented in Xibor (p. 632).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


364 QuantLib Class Documentation

9.208 IndexedCoupon Class Reference


#include <ql/CashFlows/indexedcoupon.hpp>
Inheritance diagram for IndexedCoupon:

Observable

CashFlow

Coupon

FloatingRateCoupon Observer

IndexedCoupon

InArrearIndexedCoupon UpFrontIndexedCoupon

9.208.1 Detailed Description

Base indexed coupon class.

Warning:
This class does not perform any date adjustment, i.e., the start and end date passed upon
construction should be already rolled to a business day.

Public Member Functions


• IndexedCoupon (double nominal, const Date &paymentDate, const Handle< Xibor >
&index, const Date &startDate, const Date &endDate, int fixingDays, Spread spread=0.0,
const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date(), const DayCounter
&dayCounter=DayCounter())

CashFlow interface

• double amount () const


returns the amount of the cash flow

Coupon interface

• DayCounter dayCounter () const


day counter for accrual calculation

FloatingRateCoupon interface

• Rate fixing () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.208 IndexedCoupon Class Reference 365

Inspectors

• const Handle< Xibor > & index () const

Observer interface

• void update ()

Visitability

• virtual void accept (AcyclicVisitor &)

9.208.2 Member Function Documentation

9.208.2.1 double amount () const [virtual]

returns the amount of the cash flow

Note:
The amount is not discounted, i.e., it is the actual amount paid at the cash flow date.

Implements CashFlow (p. 200).

9.208.2.2 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


366 QuantLib Class Documentation

9.209 IndexError Class Reference


#include <ql/errors.hpp>
Inheritance diagram for IndexError:

Error

IndexError

9.209.1 Detailed Description

Specialized error.
Thrown upon accessing an array or container outside its range.

Public Member Functions


• IndexError (const std::string &what="")

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.210 Instrument Class Reference 367

9.210 Instrument Class Reference


#include <ql/instrument.hpp>
Inheritance diagram for Instrument:

Observable Observer

LazyObject

Instrument

CapFloor Option Stock Swap

Cap Collar Floor MultiAssetOption OneAssetOption Swaption SimpleSwap

BasketOption OneAssetStrikedOption

BarrierOption DiscreteAveragingAsianOption VanillaOption

ForwardVanillaOption QuantoVanillaOption

9.210.1 Detailed Description

Abstract instrument class.


This class is purely abstract and defines the interface of concrete instruments which will be derived
from this one.

Public Member Functions


• virtual void setupArguments (Arguments ∗) const

Inspectors

• double NPV () const


returns the net present value of the instrument.

• double errorEstimate () const


returns the error estimate on the NPV when available.

• virtual bool isExpired () const=0


returns whether the instrument is still tradable.

Modifiers

• void setPricingEngine (const Handle< PricingEngine > &)


set the pricing engine to be used.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


368 QuantLib Class Documentation

Protected Member Functions


Calculations

• void calculate () const


• virtual void setupExpired () const
• virtual void performCalculations () const

Protected Attributes
• Handle< PricingEngine > engine_

Results
The value of this attribute and any other that derived classes might declare must be set during calculation.
• double NPV_
• double errorEstimate_

9.210.2 Member Function Documentation

9.210.2.1 void setPricingEngine (const Handle< PricingEngine > &)

set the pricing engine to be used.

Warning:
calling this method will have no effects in case the performCalculation method was overrid-
den in a derived class.

9.210.2.2 void setupArguments (Arguments ∗) const [virtual]

When a derived argument structure is defined for an instrument, this method should be overrid-
den to fill it. This is mandatory in case a pricing engine is used.
Reimplemented in DiscreteAveragingAsianOption (p. 256), BarrierOption (p. 137), Basket-
Option (p. 140), CapFloor (p. 196), ForwardVanillaOption (p. 316), MultiAssetOption (p. 452),
OneAssetOption (p. 478), OneAssetStrikedOption (p. 482), QuantoForwardVanillaOption
(p. 525), QuantoVanillaOption (p. 531), SimpleSwap (p. 557), and Swaption (p. 585).

9.210.2.3 void calculate () const [protected, virtual]

This method performs all needed calculations by calling the performCalculations method.

Warning:
Objects cache the results of the previous calculation. Such results will be returned upon
later invocations of calculate. When the results depend on arguments which could change
between invocations, the lazy object must register itself as observer of such objects for the
calculations to be performed again when they change.
Should this method be redefined in derived classes, LazyObject::calculate()(p. 392) should
be called in the overriding method.

Reimplemented from LazyObject (p. 392).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.210 Instrument Class Reference 369

9.210.2.4 void setupExpired () const [protected, virtual]

This method must leave the instrument in a consistent state when the expiration condition is met.
Reimplemented in MultiAssetOption (p. 452), OneAssetOption (p. 478), QuantoVanillaOption
(p. 531), and Swap (p. 582).

9.210.2.5 void performCalculations () const [protected, virtual]

In case a pricing engine is not used, this method must be overridden to perform the actual calcu-
lations and set any needed results. In case a pricing engine is used, the default implementation
can be used.
Implements LazyObject (p. 392).
Reimplemented in DiscreteAveragingAsianOption (p. 256), BarrierOption (p. 137), Basket-
Option (p. 141), ForwardVanillaOption (p. 316), MultiAssetOption (p. 452), OneAssetOption
(p. 478), OneAssetStrikedOption (p. 482), QuantoVanillaOption (p. 531), Stock (p. 574), Swap
(p. 582), Swaption (p. 586), and VanillaOption (p. 624).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


370 QuantLib Class Documentation

9.211 IntegerFormatter Class Reference


#include <ql/dataformatters.hpp>

9.211.1 Detailed Description

Formats integers for output.

Static Public Member Functions


• std::string toString (long l, int digits=0)
• std::string toOrdinal (long l)
• std::string toPowerOfTwo (unsigned long l, int digits=0)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.212 IntegralEngine Class Reference 371

9.212 IntegralEngine Class Reference


#include <ql/PricingEngines/Vanilla/integralengine.hpp>
Inheritance diagram for IntegralEngine:

Observable

PricingEngine

GenericEngine< VanillaOption::arguments, VanillaOption::results >

VanillaEngine

IntegralEngine

9.212.1 Detailed Description

Pricing engine for European vanilla options using integral approach

Todo
define tolerance for calculate()

Public Member Functions


• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


372 QuantLib Class Documentation

9.213 Interpolation Class Reference


#include <ql/Math/interpolation.hpp>
Inheritance diagram for Interpolation:

Bridge< Interpolation, InterpolationImpl >

Interpolation

CubicSpline LinearInterpolation LogLinearInterpolation

MonotonicCubicSpline NaturalCubicSpline NaturalMonotonicCubicSpline

9.213.1 Detailed Description

base class for 1-D interpolations.


Classes derived from this class will provide interpolated values from two sequences of equal
length, representing discretized values of a variable and a function of the former, respectively.

Public Types
• typedef double argument_type
• typedef double result_type

Public Member Functions


• double operator() (double x, bool allowExtrapolation=false) const
• double primitive (double x, bool allowExtrapolation=false) const
• double derivative (double x, bool allowExtrapolation=false) const
• double secondDerivative (double x, bool allowExtrapolation=false) const
• double xMin () const
• double xMax () const
• bool isInRange (double x) const

Protected Member Functions


• void checkRange (double x, bool allowExtrapolation) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.214 Interpolation2D Class Reference 373

9.214 Interpolation2D Class Reference


#include <ql/Math/interpolation2D.hpp>
Inheritance diagram for Interpolation2D:

Bridge< Interpolation2D, Interpolation2DImpl >

Interpolation2D

BicubicSpline BilinearInterpolation

9.214.1 Detailed Description

base class for 2-D interpolations.


Classes derived from this class will provide interpolated values from two sequences of length
N and M, representing the discretized values of the x and y variables, and a N × M matrix
representing the tabulated function values.

Public Types
• typedef double first_argument_type
• typedef double second_argument_type
• typedef double result_type

Public Member Functions


• double operator() (double x, double y, bool allowExtrapolation=false) const
• double xMin () const
• double xMax () const
• double yMin () const
• double yMax () const
• bool isInRange (double x, double y) const

Protected Member Functions


• void checkRange (double x, double y, bool allowExtrapolation) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


374 QuantLib Class Documentation

9.215 Interpolation2D::templateImpl Class Template Reference


#include <ql/Math/interpolation2D.hpp>
Inheritance diagram for Interpolation2D::templateImpl:

Interpolation2DImpl

Interpolation2D::templateImpl

Impl< I1, I2, M > Impl< I1, I2, M >

9.215.1 Detailed Description

template<class I1, class I2, class M> class QuantLib::Interpolation2D::templateImpl< I1, I2, M
>

basic template implementation

Public Member Functions


• templateImpl (const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, const I2 &yEnd, const
M &zData)
• double xMin () const
• double xMax () const
• double yMin () const
• double yMax () const
• bool isInRange (double x, double y) const

Protected Member Functions


• Size locateX (double x) const
• Size locateY (double y) const

Protected Attributes
• I1 xBegin_
• I1 xEnd_
• I2 yBegin_
• I2 yEnd_
• const M & zData_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.216 Interpolation2DImpl Class Reference 375

9.216 Interpolation2DImpl Class Reference


#include <ql/Math/interpolation2D.hpp>
Inheritance diagram for Interpolation2DImpl:

Interpolation2DImpl

templateImpl

Impl< I1, I2, M > Impl< I1, I2, M >

9.216.1 Detailed Description

abstract base class for 2-D interpolation implementations

Public Member Functions


• virtual double xMin () const=0
• virtual double xMax () const=0
• virtual double yMin () const=0
• virtual double yMax () const=0
• virtual bool isInRange (double x, double y) const=0
• virtual double value (double x, double y) const=0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


376 QuantLib Class Documentation

9.217 Interpolation::templateImpl Class Template Reference


#include <ql/Math/interpolation.hpp>
Inheritance diagram for Interpolation::templateImpl:

InterpolationImpl

Interpolation::templateImpl

9.217.1 Detailed Description

template<class I1, class I2> class QuantLib::Interpolation::templateImpl< I1, I2 >

basic template implementation

Public Member Functions


• templateImpl (const I1 &xBegin, const I1 &xEnd, const I2 &yBegin)
• double xMin () const
• double xMax () const
• bool isInRange (double x) const

Protected Member Functions


• Size locate (double x) const

Protected Attributes
• I1 xBegin_
• I1 xEnd_
• I2 yBegin_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.218 InterpolationImpl Class Reference 377

9.218 InterpolationImpl Class Reference


#include <ql/Math/interpolation.hpp>
Inheritance diagram for InterpolationImpl:

InterpolationImpl

templateImpl

9.218.1 Detailed Description

abstract base class for interpolation implementations

Public Member Functions


• virtual double xMin () const=0
• virtual double xMax () const=0
• virtual bool isInRange (double) const=0
• virtual double value (double) const=0
• virtual double primitive (double) const=0
• virtual double derivative (double) const=0
• virtual double secondDerivative (double) const=0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


378 QuantLib Class Documentation

9.219 InverseCumulativeNormal Class Reference


#include <ql/Math/normaldistribution.hpp>

9.219.1 Detailed Description

Inverse cumulative normal distribution function.


Given x between zero and one as the integral value of a gaussian normal distribution this class
provides the value y such that formula here ...
It use Acklam’s approximation: by Peter J. Acklam, University of Oslo(p. 495), Statistics Division.
URL: http://home.online.no/∼pjacklam/notes/invnorm/index.html
This class can also be used to generate a gaussian normal distribution from a uniform distribution.
This is especially useful when a gaussian normal distribution is generated from a low discrepancy
uniform distribution: in this case the traditional Box-Muller approach and its variants would not
preserve the sequence’s low-discrepancy.

Public Member Functions


• InverseCumulativeNormal (double average=0.0, double sigma=1.0)
• double operator() (double x) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.220 JamshidianSwaption Class Reference 379

9.220 JamshidianSwaption Class Reference


#include <ql/PricingEngines/Swaption/jamshidianswaption.hpp>
Inheritance diagram for JamshidianSwaption:

Observable

PricingEngine

GenericEngine<ArgumentsType, ResultsType> Observer

GenericModelEngine< OneFactorAffineModel, Swaption::arguments, Swaption::results >

JamshidianSwaption

9.220.1 Detailed Description

Jamshidian swaption pricer.

Public Member Functions


• JamshidianSwaption (const Handle< OneFactorAffineModel > &modl)
• void calculate () const

Friends
• class rStarFinder

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


380 QuantLib Class Documentation

9.221 JarrowRudd Class Reference


#include <ql/Lattices/binomialtree.hpp>
Inheritance diagram for JarrowRudd:

Tree

BinomialTree

EqualProbabilitiesBinomialTree

JarrowRudd

9.221.1 Detailed Description

Jarrow-Rudd (multiplicative) equal probabilities binomial tree.

Public Member Functions


• JarrowRudd (const Handle< DiffusionProcess > &process, Time end, Size steps, double
strike)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.222 Johannesburg Class Reference 381

9.222 Johannesburg Class Reference


#include <ql/Calendars/johannesburg.hpp>
Inheritance diagram for Johannesburg:

Bridge< Calendar, CalendarImpl >

Calendar

Johannesburg

9.222.1 Detailed Description

Johannesburg calendar
Holidays:

• Saturdays
• Sundays
• New Year’s Day, January 1st (possibly moved to Monday)
• Good Friday
• Family Day, Easter Monday
• Human Rights Day, March 21st (possibly moved to Monday)
• Freedom Day, April 27th (possibly moved to Monday)
• Workers Day, May 1st (possibly moved to Monday)
• Youth Day, June 16th (possibly moved to Monday)
• National Women’s Day, August 9th (possibly moved to Monday)
• Heritage Day, September 24th (possibly moved to Monday)
• Day of Reconciliation, December 16th (possibly moved to Monday)
• Christmas December 25th

• Day of Goodwill December 26th (possibly moved to Monday)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


382 QuantLib Class Documentation

9.223 JointCalendar Class Reference


#include <ql/Calendars/jointcalendar.hpp>
Inheritance diagram for JointCalendar:

Bridge< Calendar, CalendarImpl >

Calendar

JointCalendar

9.223.1 Detailed Description

Joint calendar.
Depending on the chosen rule, this calendar has a set of business days given by either the union
or the intersection of the sets of business days of the given calendars.

Public Member Functions


• JointCalendar (const Calendar &, const Calendar &, JointCalendarRule=JoinHolidays)
• JointCalendar (const Calendar &, const Calendar &, const Calendar &, JointCalendar-
Rule=JoinHolidays)
• JointCalendar (const Calendar &, const Calendar &, const Calendar &, const Calendar &,
JointCalendarRule=JoinHolidays)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.224 JPYLibor Class Reference 383

9.224 JPYLibor Class Reference


#include <ql/Indexes/jpylibor.hpp>
Inheritance diagram for JPYLibor:

Observable

Index Observer

Xibor

JPYLibor

9.224.1 Detailed Description

JPY Libor index, also known as TIBOR

Todo
check settlement days

Public Member Functions


• JPYLibor (int n, TimeUnit units, const RelinkableHandle< TermStructure > &h, const
DayCounter &dc=Actual360())

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


384 QuantLib Class Documentation

9.225 KnuthUniformRng Class Reference


#include <ql/RandomNumbers/knuthuniformrng.hpp>

9.225.1 Detailed Description

Uniform random number generator.


Random number generator by Knuth. For more details see Knuth, Seminumerical Algorithms,
3rd edition, Section 3.6.

Note:
This is not Knuth’s original implementation which is available at
http://www-cs-faculty.stanford.edu/∼knuth/programs.html, but rather a slightly
modified version wrapped in a C++ class. Such modifications did not affect the code but
only the data structures used, which were converted to their standard C++ equivalents.

Public Types
• typedef Sample< double > sample_type

Public Member Functions


• KnuthUniformRng (long seed=0)
• sample_type next () const

9.225.2 Constructor & Destructor Documentation

9.225.2.1 KnuthUniformRng (long seed = 0) [explicit]

if the given seed is 0, a random seed will be chosen based on clock()

9.225.3 Member Function Documentation

9.225.3.1 KnuthUniformRng::sample_type next () const

returns a sample with weight 1.0 containing a random number uniformly chosen from (0.0,1.0)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.226 KronrodIntegral Class Reference 385

9.226 KronrodIntegral Class Reference


#include <ql/Math/kronrodintegral.hpp>

9.226.1 Detailed Description

Integral of a 1-dimensional function using the Gauss-Kronrod method.


References: Gauss-Kronrod Integration http://mathcssun1.emporia.edu/∼oneilcat/Experiment-
Applet3/ExperimentApplet3.html NMS - Numerical Analysis Library
http://www.math.iastate.edu/burkardt/f_src/nms/nms.html

Public Member Functions


• KronrodIntegral (double tolerance, Size maxFunctionEvaluations=Null< int >())
• template<class F> double operator() (const F &f, double a, double b) const
• Size functionEvaluations ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


386 QuantLib Class Documentation

9.227 Lattice Class Reference


#include <ql/Lattices/lattice.hpp>
Inheritance diagram for Lattice:

NumericalMethod

Lattice

BlackScholesLattice Lattice2D ShortRateTree

ShortRateTree

9.227.1 Detailed Description

Lattice-method base class.


This class defines a lattice method that is able to rollback (with discount) a discretized asset object.
It will usually be based on one or more trees.

Public Member Functions


• Lattice (const TimeGrid &timeGrid, Size n)
• double presentValue (const Handle< DiscretizedAsset > &asset)
Computes the present value of an asset using Arrow-Debrew prices.

• void initialize (const Handle< DiscretizedAsset > &asset, Time t) const


Initialize a DiscretizedAsset(p. 260) object.

• void rollback (const Handle< DiscretizedAsset > &asset, Time to) const
• void rollAlmostBack (const Handle< DiscretizedAsset > &asset, Time to) const
• virtual Size size (Size i) const=0
• virtual DiscountFactor discount (Size i, Size index) const=0
Discount factor at time t_i and node indexed by index.

• const Array & statePrices (Size i)


• virtual Size descendant (Size i, Size index, Size branch) const=0
Tree(p. 607) properties.

• virtual double probability (Size i, Size index, Size branch) const=0

Protected Member Functions


• void computeStatePrices (Size until)
• virtual void stepback (Size i, const Array &values, Array &newValues) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.227 Lattice Class Reference 387

Protected Attributes
• std::vector< Array > statePrices_

9.227.2 Member Function Documentation

9.227.2.1 void rollback (const Handle< DiscretizedAsset > & asset, Time to) const
[virtual]

Roll back a DiscretizedAsset(p. 260) object until a certain time, performing any needed adjustment
Implements NumericalMethod (p. 470).

9.227.2.2 void rollAlmostBack (const Handle< DiscretizedAsset > & asset, Time to) const
[virtual]

Roll-back a DiscretizedAsset(p. 260) object until a certain time, but do not perform the final
adjustment.
Implements NumericalMethod (p. 470).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


388 QuantLib Class Documentation

9.228 Lattice2D Class Reference


#include <ql/Lattices/lattice2d.hpp>
Inheritance diagram for Lattice2D:

NumericalMethod

Lattice

Lattice2D

ShortRateTree

9.228.1 Detailed Description

Two-dimensional lattice.
This lattice is based on two trinomial trees and primarly used for the G2(p. 321) short-rate model.

Public Member Functions


• Lattice2D (const Handle< TrinomialTree > &tree1, const Handle< TrinomialTree > &tree2,
double correlation)
• Size size (Size i) const

Protected Member Functions


• Size descendant (Size i, Size index, Size branch) const
Tree(p. 607) properties.

• double probability (Size i, Size index, Size branch) const

Protected Attributes
• Handle< Tree > tree1_
• Handle< Tree > tree2_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.229 LatticeShortRateModelEngine Class Template Reference 389

9.229 LatticeShortRateModelEngine Class Template Reference


#include <ql/PricingEngines/latticeshortratemodelengine.hpp>
Inheritance diagram for LatticeShortRateModelEngine:

Observable

PricingEngine

GenericEngine< Arguments, Results > Observer

GenericModelEngine< ShortRateModel, Arguments, Results >

LatticeShortRateModelEngine

TreeCapFloor< CapFloor::arguments, CapFloor::results > TreeSwaption< Swaption::arguments, Swaption::results >

9.229.1 Detailed Description

template<class Arguments, class Results> class QuantLib::LatticeShortRateModelEngine< Ar-


guments, Results >

Engine for a short-rate model specialized on a lattice.


Derived engines only need to implement the calculate() method

Public Member Functions


• LatticeShortRateModelEngine (const Handle< ShortRateModel > &model, Size time-
Steps)
• LatticeShortRateModelEngine (const Handle< ShortRateModel > &model, const Time-
Grid &timeGrid)
• void update ()

Protected Attributes
• TimeGrid timeGrid_
• Size timeSteps_
• Handle< Lattice > lattice_

9.229.2 Member Function Documentation

9.229.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


390 QuantLib Class Documentation

Reimplemented from GenericModelEngine< ShortRateModel, Arguments, Results > (p. 333).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.230 LazyObject Class Reference 391

9.230 LazyObject Class Reference


#include <ql/Patterns/lazyobject.hpp>
Inheritance diagram for LazyObject:

Observable Observer

LazyObject

Instrument PiecewiseFlatForward

CapFloor Option Stock Swap

Cap Collar Floor MultiAssetOption OneAssetOption Swaption SimpleSwap

BasketOption OneAssetStrikedOption

BarrierOption DiscreteAveragingAsianOption VanillaOption

ForwardVanillaOption QuantoVanillaOption

9.230.1 Detailed Description

Framework for calculation on demand and result caching.

Calculations

These methods do not modify the structure of the object and are therefore declared as const. Data
members which will be calculated on demand need to be declared as mutable.

• void recalculate ()
• void freeze ()
• void unfreeze ()
• virtual void calculate () const
• virtual void performCalculations () const=0

Public Member Functions


Observer interface

• void update ()

Protected Attributes
• bool calculated_
• bool frozen_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


392 QuantLib Class Documentation

9.230.2 Member Function Documentation

9.230.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

9.230.2.2 void recalculate ()

This method force the recalculation of any results which would otherwise be cached. It is not
declared as const since it needs to call the non-const notifyObservers method.

Note:
Explicit invocation of this method is not necessary if the object registered itself as observer
with the structures on which such results depend. It is strongly advised to follow this policy
when possible.

9.230.2.3 void freeze ()

This method constrains the object to return the presently cached results on successive invocations,
even if arguments upon which they depend should change.

9.230.2.4 void unfreeze ()

This method reverts the effect of the freeze method, thus re-enabling recalculations.

9.230.2.5 void calculate () const [protected, virtual]

This method performs all needed calculations by calling the performCalculations method.

Warning:
Objects cache the results of the previous calculation. Such results will be returned upon
later invocations of calculate. When the results depend on arguments which could change
between invocations, the lazy object must register itself as observer of such objects for the
calculations to be performed again when they change.
Should this method be redefined in derived classes, LazyObject::calculate()(p. 392) should
be called in the overriding method.

Reimplemented in Instrument (p. 368).

9.230.2.6 virtual void performCalculations () const [protected, pure virtual]

This method must implement any calculations which must be (re)done in order to calculate the
desired results.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.230 LazyObject Class Reference 393

Implemented in Instrument (p. 369), DiscreteAveragingAsianOption (p. 256), BarrierOption


(p. 137), BasketOption (p. 141), ForwardVanillaOption (p. 316), MultiAssetOption (p. 452), One-
AssetOption (p. 478), OneAssetStrikedOption (p. 482), QuantoVanillaOption (p. 531), Stock
(p. 574), Swap (p. 582), Swaption (p. 586), and VanillaOption (p. 624).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


394 QuantLib Class Documentation

9.231 LeastSquareFunction Class Reference


#include <ql/Optimization/leastsquare.hpp>
Inheritance diagram for LeastSquareFunction:

CostFunction

LeastSquareFunction

9.231.1 Detailed Description

Cost function for least-square problems.


Implements a cost function using the interface provided by the LeastSquareProblem(p. 395)
class. Array(p. 126) vector class requires function DotProduct() that computes dot product and
- operator. M matrix class requires function transpose() that computes transpose and ∗ operator
with vector class.

Public Member Functions


• LeastSquareFunction (LeastSquareProblem &lsp)
Default constructor.

• virtual ∼LeastSquareFunction ()
Destructor.

• virtual double value (const Array &x) const


compute value of the least square function

• virtual void gradient (Array &grad_f, const Array &x) const


compute vector of derivatives of the least square function

• virtual double valueAndGradient (Array &grad_f, const Array &x) const


compute value and gradient of the least square function

Protected Attributes
• LeastSquareProblem & lsp_
least square problem

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.232 LeastSquareProblem Class Reference 395

9.232 LeastSquareProblem Class Reference


#include <ql/Optimization/leastsquare.hpp>

9.232.1 Detailed Description

Base class for least square problem.

Public Member Functions


• virtual int size ()=0
size of the problem ie size of target vector

• virtual void targetAndValue (const Array &x, Array &target, Array &fct2fit)=0
compute the target vector and the values of the fonction to fit

• virtual void targetValueAndGradient (const Array &x, Matrix &grad_fct2fit, Array &target,
Array &fct2fit)=0

9.232.2 Member Function Documentation

9.232.2.1 virtual void targetValueAndGradient (const Array & x, Matrix & grad_fct2fit, Array
& target, Array & fct2fit) [pure virtual]

compute the target vector, the values of the fonction to fit and the matrix of derivatives

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


396 QuantLib Class Documentation

9.233 LecuyerUniformRng Class Reference


#include <ql/RandomNumbers/lecuyeruniformrng.hpp>

9.233.1 Detailed Description

Uniform random number generator.


Random number generator of L’Ecuyer with added Bays-Durham shuffle (know as ran2 in Nu-
merical recipes)
For more details see Section 7.1 of Numerical Recipes in C, 2nd Edition, Cambridge University
Press (available at http://www.nr.com/)

Public Types
• typedef Sample< double > sample_type

Public Member Functions


• LecuyerUniformRng (long seed=0)
• sample_type next () const

9.233.2 Constructor & Destructor Documentation

9.233.2.1 LecuyerUniformRng (long seed = 0) [explicit]

if the given seed is 0, a random seed will be chosen based on clock()

9.233.3 Member Function Documentation

9.233.3.1 LecuyerUniformRng::sample_type next () const

returns a sample with weight 1.0 containing a random number uniformly chosen from (0.0,1.0)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.234 LeisenReimer Class Reference 397

9.234 LeisenReimer Class Reference


#include <ql/Lattices/binomialtree.hpp>
Inheritance diagram for LeisenReimer:

Tree

BinomialTree

LeisenReimer

9.234.1 Detailed Description

Leisen & Reimer tree: multiplicative approach.

Public Member Functions


• LeisenReimer (const Handle< DiffusionProcess > &process, Time end, Size steps, double
strike)
• double underlying (Size i, Size index) const
• double probability (Size, Size, Size) const

Protected Attributes
• double up_
• double down_
• double pu_
• double pd_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


398 QuantLib Class Documentation

9.235 LexicographicalView Class Template Reference


#include <ql/Math/lexicographicalview.hpp>

9.235.1 Detailed Description

template<class RandomAccessIterator> class QuantLib::LexicographicalView< Random-


AccessIterator >

Lexicographical 2-D view of a contiguous set of data.


This view can be used to easily store a discretized 2-D function in an array to be used in a finite
differences calculation.

Public Types
• typedef RandomAccessIterator x_iterator
iterates over vi j with j fixed.

• typedef stepping_iterator< RandomAccessIterator > y_iterator


iterates over vi j with i fixed.

Public Member Functions


• LexicographicalView (const RandomAccessIterator &begin, const RandomAccessIterator
&end, int xSize)
attaches the view with the given dimension to a sequence

• typedef QL_REVERSE_ITERATOR (RandomAccessIterator, typename 1< RandomAccess-


Iterator >::value_type) reverse_x_iterator
iterates backwards over vi j with j fixed.

• typedef QL_REVERSE_ITERATOR (y_iterator, typename 1< RandomAccessIterator


>::value_type) reverse_y_iterator
iterates backwards over vi j with i fixed.

Element access

• y_iterator operator[ ] (int i)

Iterator access

• x_iterator xbegin (int j)


• x_iterator xend (int j)
• reverse_x_iterator rxbegin (int j)
• reverse_x_iterator rxend (int j)
• y_iterator ybegin (int i)
• y_iterator yend (int i)
• reverse_y_iterator rybegin (int i)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.235 LexicographicalView Class Template Reference 399

• reverse_y_iterator ryend (int i)

Inspectors

• int xSize () const


dimension of the array along x

• int ySize () const


dimension of the array along y

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


400 QuantLib Class Documentation

9.236 Linear Class Reference


#include <ql/Math/interpolationtraits.hpp>

9.236.1 Detailed Description

Linear interpolation traits

Static Public Member Functions


• template<class I1, class I2> Interpolation make_interpolation (const I1 &xBegin, const I1
&xEnd, const I2 &yBegin)
• template<class I1, class I2, class M> Interpolation2D make_interpolation (const I1 &x-
Begin, const I1 &xEnd, const I2 &yBegin, const I2 &yEnd, const M &z)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.237 LinearInterpolation Class Reference 401

9.237 LinearInterpolation Class Reference


#include <ql/Math/linearinterpolation.hpp>
Inheritance diagram for LinearInterpolation:

Bridge< Interpolation, InterpolationImpl >

Interpolation

LinearInterpolation

9.237.1 Detailed Description

Linear interpolation between discrete points

Public Member Functions


• template<class I1, class I2> LinearInterpolation (const I1 &xBegin, const I1 &xEnd, const
I2 &yBegin)

9.237.2 Constructor & Destructor Documentation

9.237.2.1 LinearInterpolation (const I1 & xBegin, const I1 & xEnd, const I2 & yBegin)

Precondition:
the x values must be sorted.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


402 QuantLib Class Documentation

9.238 LineSearch Class Reference


#include <ql/Optimization/linesearch.hpp>
Inheritance diagram for LineSearch:

LineSearch

ArmijoLineSearch

9.238.1 Detailed Description

Base class for line search.

Public Member Functions


• LineSearch (double eps=1e-8)
Default constructor.

• virtual ∼LineSearch ()
Destructor.

• const Array & lastX ()


return last x value

• double lastFunctionValue ()
return last cost function value

• const Array & lastGradient ()


return last gradient

• double lastGradientNorm2 ()
return square norm of last gradient

• bool succeed ()
• virtual double operator() (const Problem &P, double t_ini)=0
Perform line search.

• double update (Array &params, const Array &direction, double beta, const Constraint
&constraint)

Protected Attributes
• Array xtd_
new x and its gradient

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.238 LineSearch Class Reference 403

• Array gradient_
new x and its gradient

• double qt_
cost function value and gradient norm corresponding to xtd_

• double qpt_
cost function value and gradient norm corresponding to xtd_

• bool succeed_
flag to know if linesearch succeed

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


404 QuantLib Class Documentation

9.239 Link Class Template Reference


#include <ql/relinkablehandle.hpp>
Inheritance diagram for Link:

Observable Observer

Link

9.239.1 Detailed Description

template<class Type> class QuantLib::Link< Type >

Relinkable access to a Handle.

Precondition:
Class "Type" must inherit from Observable(p. 471)

Public Member Functions


• Link (const Handle< Type > &h=Handle< Type >(), bool registerAsObserver=true)
• void linkTo (const Handle< Type > &h, bool registerAsObserver=true)
• bool isNull () const
Checks if the contained handle points to anything.

• const Handle< Type > & currentLink () const


Returns the contained handle.

• void update ()
Observer(p. 473) interface.

9.239.2 Constructor & Destructor Documentation

9.239.2.1 Link (const Handle< Type > & h = Handle< Type >(), bool registerAsObserver =
true) [explicit]

Warning:
see the documentation of the linkTo method for issues relatives to registerAsObserver.

9.239.3 Member Function Documentation

9.239.3.1 void linkTo (const Handle< Type > & h, bool registerAsObserver = true)

Warning:
registerAsObserver is left as a backdoor in case the programmer cannot guarantee that the
object pointed to will remain alive for the whole lifetime of the handle—namely, it should be

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.239 Link Class Template Reference 405

set to false when the passed handle was created with owns = false (the latter should only
happen in a controlled environment, so that the programmer is aware of it). Failure to do so
can very likely result in a program crash. If the programmer does want the relinkable handle
to register as observer of such a handle, it is his responsibility to ensure that the relinkable
handle gets destroyed before the pointed object does.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


406 QuantLib Class Documentation

9.240 LocalConstantVol Class Reference

#include <ql/Volatilities/localconstantvol.hpp>
Inheritance diagram for LocalConstantVol:

Observable

LocalVolTermStructure Observer

LocalConstantVol

9.240.1 Detailed Description

Constant local volatility, no time-strike dependence.


This class implements the LocalVolatilityTermStructure interface for a constant local volatility (no
time/asset dependence). Local volatility and Black volatility are the same when volatility is at
most time dependent, so this class is basically a proxy for BlackVolatilityTermStructure(p. 169).

Public Member Functions

• LocalConstantVol (const Date &referenceDate, double volatility, const DayCounter &day-


Counter=Actual365())
• LocalConstantVol (const Date &referenceDate, const RelinkableHandle< Quote >
&volatility, const DayCounter &dayCounter=Actual365())

LocalVolTermStructure interface

• Date referenceDate () const


returns the reference date for which t=0

• DayCounter dayCounter () const


returns the day counter

• Date maxDate () const


the latest date for which the term structure can return vols

Observer interface

• void update ()

Visitability

• virtual void accept (AcyclicVisitor &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.240 LocalConstantVol Class Reference 407

9.240.2 Member Function Documentation

9.240.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


408 QuantLib Class Documentation

9.241 LocalVolCurve Class Reference

#include <ql/Volatilities/localvolcurve.hpp>
Inheritance diagram for LocalVolCurve:

Observable

LocalVolTermStructure Observer

LocalVolCurve

9.241.1 Detailed Description

Local volatility curve derived from a Black curve.

Public Member Functions

• LocalVolCurve (const RelinkableHandle< BlackVarianceCurve > &curve)

LocalVolTermStructure interface

• Date referenceDate () const


returns the reference date for which t=0

• DayCounter dayCounter () const


returns the day counter

• Date maxDate () const


the latest date for which the term structure can return vols

Observer interface

• void update ()

Visitability

• virtual void accept (AcyclicVisitor &)

Protected Member Functions

• double localVolImpl (Time, double, bool extrapolate) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.241 LocalVolCurve Class Reference 409

9.241.2 Member Function Documentation

9.241.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

9.241.2.2 double localVolImpl (Time t, double dummy, bool extrapolate) const [protected,
virtual]

The relation Z T
σ2L (t)dt = σ2B T
0

holds, where σL (t) is the local volatility at time t and σB (T) is the Black volatility for maturity T.
From the above, the formula r
d 2
σL (t) = σ (t)t
dt B
can be deduced which is here implemented.
Implements LocalVolTermStructure (p. 412).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


410 QuantLib Class Documentation

9.242 LocalVolSurface Class Reference


#include <ql/Volatilities/localvolsurface.hpp>
Inheritance diagram for LocalVolSurface:

Observable

LocalVolTermStructure Observer

LocalVolSurface

9.242.1 Detailed Description

Local volatility surface derived from a Black vol surface.


For details about this implementation refers to "Stochastic Volatility and Local Volatility," in "Case
Studies in Financial Modelling Course Notes," by Jim Gatheral, Fall Term, 2003
see www.math.nyu.edu/fellows_fin_math/gatheral/Lecture1_Fall02.pdf

Bug
This class is untested, probably unreliable.

Public Member Functions


• LocalVolSurface (const RelinkableHandle< BlackVolTermStructure > &blackTS, const
RelinkableHandle< TermStructure > &riskFreeTS, const RelinkableHandle< Term-
Structure > &dividendTS, const RelinkableHandle< Quote > &underlying)
• LocalVolSurface (const RelinkableHandle< BlackVolTermStructure > &blackTS, const
RelinkableHandle< TermStructure > &riskFreeTS, const RelinkableHandle< Term-
Structure > &dividendTS, double underlying)

LocalVolTermStructure interface
• Date referenceDate () const
returns the reference date for which t=0

• DayCounter dayCounter () const


returns the day counter

• Date maxDate () const


the latest date for which the term structure can return vols

Observer interface
• void update ()

Visitability
• virtual void accept (AcyclicVisitor &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.242 LocalVolSurface Class Reference 411

Protected Member Functions


• double localVolImpl (Time, double, bool extrapolate) const
implements the actual local vol calculation in derived classes

9.242.2 Member Function Documentation

9.242.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


412 QuantLib Class Documentation

9.243 LocalVolTermStructure Class Reference


#include <ql/voltermstructure.hpp>
Inheritance diagram for LocalVolTermStructure:

Observable

LocalVolTermStructure

LocalConstantVol LocalVolCurve LocalVolSurface

9.243.1 Detailed Description

Local-volatility term structure.


This abstract class defines the interface of concrete local-volatility term structures which will be
derived from this one.
Volatilities are assumed to be expressed on an annual basis.

Public Member Functions


Local Volatility
• double localVol (const Date &d, double underlyingLevel, bool extrapolate=false) const
• double localVol (Time t, double underlyingLevel, bool extrapolate=false) const

Dates
• virtual Date referenceDate () const=0
returns the reference date for which t=0

• virtual DayCounter dayCounter () const=0


returns the day counter

• virtual Date maxDate () const=0


the latest date for which the term structure can return vols

• Time maxTime () const


the latest time for which the term structure can return vols

Visitability
• virtual void accept (AcyclicVisitor &)

Protected Member Functions


• virtual double localVolImpl (Time t, double strike, bool extrapolate=false) const=0
implements the actual local vol calculation in derived classes

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.244 LogLinear Class Reference 413

9.244 LogLinear Class Reference


#include <ql/Math/interpolationtraits.hpp>

9.244.1 Detailed Description

Log-linear interpolation traits.

Static Public Member Functions


• template<class I1, class I2> Interpolation make_interpolation (const I1 &xBegin, const I1
&xEnd, const I2 &yBegin)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


414 QuantLib Class Documentation

9.245 LogLinearInterpolation Class Reference


#include <ql/Math/loglinearinterpolation.hpp>
Inheritance diagram for LogLinearInterpolation:

Bridge< Interpolation, InterpolationImpl >

Interpolation

LogLinearInterpolation

9.245.1 Detailed Description

Log-linear interpolation between discrete points

Todo
Implement primitive, derivative, and secondDerivative functions.

Public Member Functions


• template<class I1, class I2> LogLinearInterpolation (const I1 &xBegin, const I1 &xEnd,
const I2 &yBegin)

9.245.2 Constructor & Destructor Documentation

9.245.2.1 LogLinearInterpolation (const I1 & xBegin, const I1 & xEnd, const I2 & yBegin)

Precondition:
the x values must be sorted.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.246 London Class Reference 415

9.246 London Class Reference


#include <ql/Calendars/london.hpp>
Inheritance diagram for London:

Bridge< Calendar, CalendarImpl >

Calendar

London

9.246.1 Detailed Description

London calendar
Holidays:

• Saturdays
• Sundays
• New Year’s Day, January 1st (possibly moved to Monday)
• Good Friday
• Easter Monday
• Early May Bank Holiday, first Monday of May
• Spring Bank Holiday, last Monday of May
• Summer Bank Holiday, last Monday of August
• Christmas, December 25th (possibly moved to Monday or Tuesday)
• Boxing Day, December 26th (possibly moved to Monday or Tuesday)

See http://www.dti.gov.uk/er/bankhol.htm

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


416 QuantLib Class Documentation

9.247 lowest_category_iterator Struct Template Reference


#include <ql/Utilities/iteratorcategories.hpp>

9.247.1 Detailed Description

template<class Category1, class Category2> struct QuantLib::lowest_category_iterator< Cate-


gory1, Category2 >

most generic of two given iterator categories


Specializations of this struct define a typedef iterator_category which corresponds to the most
generic of the two input categories, e.g., lowest_category_iterator(p. 416)<std::random_access_-
iterator_tag, std::forward_iterator_tag>::iterator_category corresponds to std::forward_iterator_-
tag.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.248 MakeSchedule Class Reference 417

9.248 MakeSchedule Class Reference


#include <ql/scheduler.hpp>

9.248.1 Detailed Description

helper class
This class provides a more comfortable interface to the argument list of Schedule’s constructor.

Public Member Functions


• MakeSchedule (const Calendar &calendar, const Date &startDate, const Date &endDate,
int frequency, RollingConvention rollingConvention, bool isAdjusted)
• MakeSchedule & withStubDate (const Date &d)
• MakeSchedule & backwards (bool flag=true)
• MakeSchedule & forwards (bool flag=true)
• MakeSchedule & longFinalPeriod (bool flag=true)
• MakeSchedule & shortFinalPeriod (bool flag=true)
• operator Schedule ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


418 QuantLib Class Documentation

9.249 Matrix Class Reference


#include <ql/Math/matrix.hpp>

9.249.1 Detailed Description

Matrix used in linear algebra.


This class implements the concept of Matrix(p. 418) as used in linear algebra. As such, it is not
meant to be used as a container.

Public Types
• typedef double ∗ iterator
• typedef const double ∗ const_iterator
• typedef double ∗ row_iterator
• typedef const double ∗ const_row_iterator
• typedef stepping_iterator< double ∗ > column_iterator
• typedef stepping_iterator< const double ∗ > const_column_iterator

Public Member Functions


• typedef QL_REVERSE_ITERATOR (iterator, double) reverse_iterator
• typedef QL_REVERSE_ITERATOR (const_iterator, double) const _reverse_iterator
• typedef QL_REVERSE_ITERATOR (row_iterator, double) reverse_row_iterator
• typedef QL_REVERSE_ITERATOR (const_row_iterator, double) const _reverse_row_-
iterator
• typedef QL_REVERSE_ITERATOR (column_iterator, double) reverse_column_iterator
• typedef QL_REVERSE_ITERATOR (const_column_iterator, double) const _reverse_-
column_iterator

Constructors, destructor, and assignment

• Matrix ()
creates a null matrix

• Matrix (Size rows, Size columns)


creates a matrix with the given dimensions

• Matrix (Size rows, Size columns, double value)


creates the matrix and fills it with value

• Matrix (const Matrix &)


• Matrix (const Disposable< Matrix > &)
• Matrix & operator= (const Matrix &)
• Matrix & operator= (const Disposable< Matrix > &)

Algebraic operators

• const Matrix & operator+= (const Matrix &)


• const Matrix & operator-= (const Matrix &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.249 Matrix Class Reference 419

• const Matrix & operator ∗= (double)


• const Matrix & operator/= (double)

Iterator access

• const_iterator begin () const


• iterator begin ()
• const_iterator end () const
• iterator end ()
• const_reverse_iterator rbegin () const
• reverse_iterator rbegin ()
• const_reverse_iterator rend () const
• reverse_iterator rend ()
• const_row_iterator row_begin (Size i) const
• row_iterator row_begin (Size i)
• const_row_iterator row_end (Size i) const
• row_iterator row_end (Size i)
• const_reverse_row_iterator row_rbegin (Size i) const
• reverse_row_iterator row_rbegin (Size i)
• const_reverse_row_iterator row_rend (Size i) const
• reverse_row_iterator row_rend (Size i)
• const_column_iterator column_begin (Size i) const
• column_iterator column_begin (Size i)
• const_column_iterator column_end (Size i) const
• column_iterator column_end (Size i)
• const_reverse_column_iterator column_rbegin (Size i) const
• reverse_column_iterator column_rbegin (Size i)
• const_reverse_column_iterator column_rend (Size i) const
• reverse_column_iterator column_rend (Size i)

Element access

• const_row_iterator operator[ ] (Size) const


• row_iterator operator[ ] (Size)
• Disposable< Array > diagonal (void) const

Inspectors

• Size rows () const


• Size columns () const

Utilities

• void swap (Matrix &)

Related Functions

(Note that these are not member functions.)

• std::ostream & operator<< (std::ostream &, const Matrix &)


• const Disposable< Matrix > CholeskyDecomposition (const Matrix &m, bool flexi-
ble=false)
• const Disposable< Matrix > operator+ (const Matrix &, const Matrix &)
• const Disposable< Matrix > operator- (const Matrix &, const Matrix &)
• const Disposable< Matrix > operator ∗ (const Matrix &, double)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


420 QuantLib Class Documentation

• const Disposable< Matrix > operator ∗ (double, const Matrix &)


• const Disposable< Matrix > operator/ (const Matrix &, double)
• const Disposable< Array > operator ∗ (const Array &, const Matrix &)
• const Disposable< Array > operator ∗ (const Matrix &, const Array &)
• const Disposable< Matrix > operator ∗ (const Matrix &, const Matrix &)
• const Disposable< Matrix > transpose (const Matrix &)
• const Disposable< Matrix > outerProduct (const Array &v1, const Array &v2)
• template<class Iterator1, class Iterator2> const Disposable< Matrix > outerProduct (Itera-
tor1 v1begin, Iterator1 v1end, Iterator2 v2begin, Iterator2 v2end)
• const Disposable< Matrix > pseudoSqrt (const Matrix &, SalvagingAlgorithm::Type)
Returns the pseudo square root of a real symmetric matrix.

• const Disposable< Matrix > rankReducedSqrt (const Matrix &, Size maxRank, double
componentRetainedPercentag, SalvagingAlgorithm::Type)
• const Disposable< Matrix > matrixSqrt (const Matrix &)

9.249.2 Member Function Documentation

9.249.2.1 const Matrix & operator+= (const Matrix &)

Precondition:
all matrices involved in an algebraic expression must have the same size.

9.249.3 Friends And Related Function Documentation

9.249.3.1 const Disposable< Matrix > pseudoSqrt (const Matrix &,


SalvagingAlgorithm::Type) [related]

Returns the pseudo square root of a real symmetric matrix.


Given a matrix M, the result S is defined as the matrix such that SST = M. If the matrix is not
positive semi definite, it can return an approximation of the pseudo square root using a (user
selected) salvaging algorithm.
For more information see: "The most general methodology to create a valid correlation matrix
for risk management and option pricing purposes", by R. Rebonato and P. Jäckel. The Journal of
Risk, 2(2), Winter 1999/2000 http://www.rebonato.com/correlationmatrix.pdf
Revised and extended in "Monte Carlo Methods in Finance", by Peter Jäckel, Chapter 6.

Precondition:
the given matrix must be symmetric.

Todo
a) implement Hypersphere decomposition: 1) Jäckel "Monte Carlo Methods in Finance",
Chapter 6 2) Brigo "A Note on Correlation and Rank Reduction" 3) Rapisarda, Brigo, Mercurio
"Parameterizing correlations: a geometric interpretation" b) implement Higham algorithm:
Higham "Computing the nearest correlation matrix"

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.249 Matrix Class Reference 421

9.249.3.2 const Disposable< Matrix > rankReducedSqrt (const Matrix &, Size maxRank,
double componentRetainedPercentag, SalvagingAlgorithm::Type) [related]

Precondition:
the given matrix must be symmetric.

9.249.3.3 const Disposable< Matrix > matrixSqrt (const Matrix &) [related]

Deprecated
use CholeskyDecomposition or pseudoSqrt instead

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


422 QuantLib Class Documentation

9.250 MCAmericanBasketEngine Class Reference


#include <ql/PricingEngines/Basket/mcamericanbasketengine.hpp>
Inheritance diagram for MCAmericanBasketEngine:

Observable

PricingEngine

GenericEngine< BasketOption::arguments, BasketOption::results >

BasketEngine

MCAmericanBasketEngine

9.250.1 Detailed Description

least-square Monte Carlo engine

Warning:
This method is intrinsically weak for out-of-the-money options.

Bug
This engine does not yet work for put options. More problems might surface.

Public Member Functions


• MCAmericanBasketEngine (Size requiredSamples, Size timeSteps, long seed=0)
• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.251 MCBarrierEngine Class Template Reference 423

9.251 MCBarrierEngine Class Template Reference


#include <ql/PricingEngines/Barrier/mcbarrierengine.hpp>
Inheritance diagram for MCBarrierEngine:

Observable

PricingEngine

GenericEngine< BarrierOption::arguments, BarrierOption::results >

BarrierEngine McSimulation< SingleAsset< RNG >, S >

MCBarrierEngine

9.251.1 Detailed Description

template<class RNG = PseudoRandom, class S = Statistics> class QuantLib::MCBarrier-


Engine< RNG, S >

Pricing engine for barrier options using Monte Carlo.


Uses the Brownian-bridge correction for the barrier found in Going to Extremes: Correcting Sim-
ulation Bias in Exotic Option(p. 490) Valuation - D.R. Beaglehole, P.H. Dybvig and G. Zhou Financial
Analysts Journal; Jan/Feb 1997; 53, 1. pg. 62-68 and Simulating path-dependent options: A new approach
- M. El Babsiri and G. Noel Journal of Derivatives; Winter 1998; 6, 2; pg. 65-83

Public Member Functions


• MCBarrierEngine (Size maxTimeStepsPerYear, bool antitheticVariate=false, bool control-
Variate=false, Size requiredSamples=Null< int >(), double requiredTolerance=Null< dou-
ble >(), Size maxSamples=Null< int >(), bool isBiased=false, long seed=0)
• void calculate () const

Protected Types
• typedef McSimulation< SingleAsset< RNG >, S >::path_generator_type path_generator_-
type
• typedef McSimulation< SingleAsset< RNG >, S >::path_pricer_type path_pricer_type
• typedef McSimulation< SingleAsset< RNG >, S >::stats_type stats_type

Protected Member Functions


• Handle< path_generator_type > pathGenerator () const
• TimeGrid timeGrid () const
• Handle< path_pricer_type > pathPricer () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


424 QuantLib Class Documentation

Protected Attributes
• Size maxTimeStepsPerYear_
• Size requiredSamples_
• Size maxSamples_
• double requiredTolerance_
• bool isBiased_
• long seed_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.252 McBasket Class Reference 425

9.252 McBasket Class Reference


#include <ql/Pricers/mcbasket.hpp>
Inheritance diagram for McBasket:

McPricer< MultiAsset_old< PseudoRandomSequence_old > >

McBasket

9.252.1 Detailed Description

simple example of multi-factor Monte Carlo pricer

Public Member Functions


• McBasket (Option::Type type, const std::vector< double > &underlying, double strike, const
Array &dividendYield, const Matrix &covariance, Rate riskFreeRate, double residualTime,
bool antitheticVariance, long seed=0)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


426 QuantLib Class Documentation

9.253 MCBasketEngine Class Template Reference


#include <ql/PricingEngines/Basket/mcbasketengine.hpp>
Inheritance diagram for MCBasketEngine:

Observable

PricingEngine

GenericEngine< BasketOption::arguments, BasketOption::results >

BasketEngine McSimulation< MultiAsset< RNG >, S >

MCBasketEngine

9.253.1 Detailed Description

template<class RNG = PseudoRandom, class S = Statistics> class QuantLib::MCBasket-


Engine< RNG, S >

MC Pricing engine for European Baskets.

Public Types
• typedef McSimulation< MultiAsset< RNG >, S >::path_generator_type path_generator_-
type
• typedef McSimulation< MultiAsset< RNG >, S >::path_pricer_type path_pricer_type
• typedef McSimulation< MultiAsset< RNG >, S >::stats_type stats_type

Public Member Functions


• MCBasketEngine (Size maxTimeStepsPerYear, bool antitheticVariate=false, bool control-
Variate=false, Size requiredSamples=Null< int >(), double requiredTolerance=Null< dou-
ble >(), Size maxSamples=Null< int >(), bool brownianBridge=false, long seed=0)
• void calculate () const

Protected Member Functions


• Handle< path_generator_type > pathGenerator () const
• TimeGrid timeGrid () const
• Handle< path_pricer_type > pathPricer () const

Protected Attributes
• Size maxTimeStepsPerYear_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.253 MCBasketEngine Class Template Reference 427

• Size requiredSamples_
• Size maxSamples_
• double requiredTolerance_
• bool brownianBridge_
• long seed_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


428 QuantLib Class Documentation

9.254 McCliquetOption Class Reference


#include <ql/Pricers/mccliquetoption.hpp>
Inheritance diagram for McCliquetOption:

McPricer< SingleAsset_old< PseudoRandom_old > >

McCliquetOption

9.254.1 Detailed Description

simple example of Monte Carlo pricer

Public Member Functions


• McCliquetOption (Option::Type type, double underlying, double moneyness, const
std::vector< Spread > &dividendYield, const std::vector< Rate > &riskFreeRate, const
std::vector< Time > &times, const std::vector< double > &volatility, double accruedCoupon,
double lastFixing, double localCap, double localFloor, double globalCap, double global-
Floor, bool redemptionOnly, bool antitheticVariance, long seed=0)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.255 MCDigitalEngine Class Template Reference 429

9.255 MCDigitalEngine Class Template Reference


#include <ql/PricingEngines/Vanilla/mcdigitalengine.hpp>
Inheritance diagram for MCDigitalEngine:

Observable

PricingEngine

GenericEngine< VanillaOption::arguments, VanillaOption::results >

VanillaEngine McSimulation< SingleAsset< RNG >, S >

MCVanillaEngine<RNG,S>

MCDigitalEngine

9.255.1 Detailed Description

template<class RNG = PseudoRandom, class S = Statistics> class QuantLib::MCDigital-


Engine< RNG, S >

Pricing engine for digital options using Monte Carlo simulation.


Uses the Brownian Bridge(p. 179) correction for the barrier found in Going to Extremes: Correcting
Simulation Bias in Exotic Option(p. 490) Valuation - D.R. Beaglehole, P.H. Dybvig and G. Zhou Financial
Analysts Journal; Jan/Feb 1997; 53, 1. pg. 62-68 and Simulating path-dependent options: A new approach
- M. El Babsiri and G. Noel Journal of Derivatives; Winter 1998; 6, 2; pg. 65-83

Public Types
• typedef MCVanillaEngine< RNG, S >::path_generator_type path_generator_type
• typedef MCVanillaEngine< RNG, S >::path_pricer_type path_pricer_type
• typedef MCVanillaEngine< RNG, S >::stats_type stats_type

Public Member Functions


• MCDigitalEngine (Size maxTimeStepsPerYear, bool antitheticVariate=false, bool control-
Variate=false, Size requiredSamples=Null< int >(), double requiredTolerance=Null< dou-
ble >(), Size maxSamples=Null< int >(), long seed=0)
• void calculate () const

Protected Member Functions


• TimeGrid timeGrid () const
• Handle< path_pricer_type > pathPricer () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


430 QuantLib Class Documentation

9.256 McDiscreteArithmeticAPO Class Reference


#include <ql/Pricers/mcdiscretearithmeticapo.hpp>
Inheritance diagram for McDiscreteArithmeticAPO:

McPricer< SingleAsset_old< PseudoRandom_old > >

McDiscreteArithmeticAPO

9.256.1 Detailed Description

example of Monte Carlo pricer using a control variate

Todo
Continous-averaging version

Public Member Functions


• McDiscreteArithmeticAPO (Option::Type type, double underlying, double strike, Spread
dividendYield, Rate riskFreeRate, const std::vector< Time > &times, double volatility, bool
antitheticVariance, bool controlVariate, long seed=0)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.257 McDiscreteArithmeticASO Class Reference 431

9.257 McDiscreteArithmeticASO Class Reference


#include <ql/Pricers/mcdiscretearithmeticaso.hpp>
Inheritance diagram for McDiscreteArithmeticASO:

McPricer< SingleAsset_old< PseudoRandom_old > >

McDiscreteArithmeticASO

9.257.1 Detailed Description

example of Monte Carlo pricer using a control variate.

Todo
Continous Averaging version

Public Member Functions


• McDiscreteArithmeticASO (Option::Type type, double underlying, Spread dividendYield,
Rate riskFreeRate, const std::vector< Time > &times, double volatility, bool antithetic-
Variance, bool controlVariate, long seed=0)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


432 QuantLib Class Documentation

9.258 MCEuropeanEngine Class Template Reference


#include <ql/PricingEngines/Vanilla/mceuropeanengine.hpp>
Inheritance diagram for MCEuropeanEngine:

Observable

PricingEngine

GenericEngine< VanillaOption::arguments, VanillaOption::results >

VanillaEngine McSimulation< SingleAsset< RNG >, S >

MCVanillaEngine<RNG,S>

MCEuropeanEngine

9.258.1 Detailed Description

template<class RNG = PseudoRandom, class S = Statistics> class QuantLib::MCEuropean-


Engine< RNG, S >

European option pricing engine using Monte Carlo simulation.

Public Types
• typedef MCVanillaEngine< RNG, S >::path_generator_type path_generator_type
• typedef MCVanillaEngine< RNG, S >::path_pricer_type path_pricer_type
• typedef MCVanillaEngine< RNG, S >::stats_type stats_type

Public Member Functions


• MCEuropeanEngine (Size maxTimeStepPerYear, bool antitheticVariate=false, bool control-
Variate=false, Size requiredSamples=Null< int >(), double requiredTolerance=Null< dou-
ble >(), Size maxSamples=Null< int >(), long seed=0)

Protected Member Functions


• TimeGrid timeGrid () const
• Handle< path_pricer_type > pathPricer () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.259 McEverest Class Reference 433

9.259 McEverest Class Reference


#include <ql/Pricers/mceverest.hpp>
Inheritance diagram for McEverest:

McPricer< MultiAsset_old< PseudoRandomSequence_old > >

McEverest

9.259.1 Detailed Description

Everest-type option pricer.


The payoff of an Everest option is simply given by the final price / initial price ratio of the worst
performer

Public Member Functions


• McEverest (const Array &dividendYield, const Matrix &covariance, Rate riskFreeRate, Time
residualTime, bool antitheticVariance, long seed=0)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


434 QuantLib Class Documentation

9.260 McHimalaya Class Reference


#include <ql/Pricers/mchimalaya.hpp>
Inheritance diagram for McHimalaya:

McPricer< MultiAsset_old< PseudoRandomSequence_old > >

McHimalaya

9.260.1 Detailed Description

Himalayan-type option pricer.


The payoff of a Himalaya option is computed in the following way: Given a basket of N assets,
and N time periods, at end of each period the option who performed the best is added to the
average and then discarded from the basket. At the end of the N periods the option pays the max
between the strike and the average of the best performers.

Public Member Functions


• McHimalaya (const std::vector< double > &underlying, const Array &dividendYield, const
Matrix &covariance, Rate riskFreeRate, double strike, const std::vector< Time > &times,
bool antitheticVariance, long seed=0)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.261 McMaxBasket Class Reference 435

9.261 McMaxBasket Class Reference


#include <ql/Pricers/mcmaxbasket.hpp>
Inheritance diagram for McMaxBasket:

McPricer< MultiAsset_old< PseudoRandomSequence_old > >

McMaxBasket

9.261.1 Detailed Description

simple example of multi-factor Monte Carlo pricer

Public Member Functions


• McMaxBasket (const std::vector< double > &underlying, const Array &dividendYield,
const Matrix &covariance, Rate riskFreeRate, double residualTime, bool antitheticVariance,
long seed=0)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


436 QuantLib Class Documentation

9.262 McPagoda Class Reference


#include <ql/Pricers/mcpagoda.hpp>
Inheritance diagram for McPagoda:

McPricer< MultiAsset_old< PseudoRandomSequence_old > >

McPagoda

9.262.1 Detailed Description

roofed Asian option


Given a certain portfolio of assets at the end of the period it is returned the minimum of a
given roof and a certain fraction of the positive portfolio performance. If the performance of the
portfolio is below then the payoff is null.

Public Member Functions


• McPagoda (const std::vector< double > &portfolio, double fraction, double roof, const Array
&dividendYield, const Matrix &covariance, Rate riskFreeRate, const std::vector< Time >
&times, bool antithetic, long seed=0)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.263 McPerformanceOption Class Reference 437

9.263 McPerformanceOption Class Reference


#include <ql/Pricers/mcperformanceoption.hpp>
Inheritance diagram for McPerformanceOption:

McPricer< SingleAsset_old< PseudoRandom_old > >

McPerformanceOption

9.263.1 Detailed Description

Performance option computed using Monte Carlo simulation.


A performance option is a variant of a cliquet option: the payoff of each forward-starting (a.k.a.
deferred strike) options is $ max(S/X- 1) $.

Public Member Functions


• McPerformanceOption (Option::Type type, double underlying, double moneyness, const
std::vector< Spread > &dividendYield, const std::vector< Rate > &riskFreeRate, const
std::vector< Time > &times, const std::vector< double > &volatility, bool antitheticVariance,
long seed=0)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


438 QuantLib Class Documentation

9.264 McPricer Class Template Reference


#include <ql/Pricers/mcpricer.hpp>

9.264.1 Detailed Description

template<class MC, class S = Statistics> class QuantLib::McPricer< MC, S >

base class for Monte Carlo pricers


Eventually this class might be linked to the general tree of pricers, in order to have tools like
impliedVolatility available. Also, it could, eventually, offer greeks methods. Deriving a class
from McPricer(p. 438) gives an easy way to write a Monte Carlo Pricer. See McEuropean as
example of one factor pricer, Basket as example of multi factor pricer.

Public Member Functions


• double value (double tolerance, Size maxSample=QL_MAX_INT) const
add samples until the required tolerance is reached

• double valueWithSamples (Size samples) const


simulate a fixed number of samples

• double errorEstimate () const


error Estimated of the samples simulated so far

• const S & sampleAccumulator (void) const


access to the sample accumulator for more statistics

Protected Attributes
• Handle< MonteCarloModel< MC, S > > mcModel_

Static Protected Attributes


• const Size minSample_ = 1023

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.265 McSimulation Class Template Reference 439

9.265 McSimulation Class Template Reference


#include <ql/PricingEngines/mcsimulation.hpp>

9.265.1 Detailed Description

template<class MC, class S = Statistics> class QuantLib::McSimulation< MC, S >

base class for Monte Carlo engines


Eventually this class might offer greeks methods. Deriving a class from McEngine gives an easy
way to write a Monte Carlo engine.
See McVanillaEngine as an example of one factor engine.

Public Types
• typedef MonteCarloModel< MC, S >::path_generator_type path_generator_type
• typedef MonteCarloModel< MC, S >::path_pricer_type path_pricer_type
• typedef MonteCarloModel< MC, S >::stats_type stats_type

Public Member Functions


• double value (double tolerance, Size maxSample=QL_MAX_INT) const
add samples until the required tolerance is reached

• double valueWithSamples (Size samples) const


simulate a fixed number of samples

• double errorEstimate () const


error estimated using the samples simulated so far

• const stats_type & sampleAccumulator (void) const


access to the sample accumulator for richer statistics

Protected Member Functions


• McSimulation (bool antitheticVariate, bool controlVariate)
• virtual Handle< path_pricer_type > pathPricer () const=0
• virtual Handle< path_pricer_type > controlPathPricer () const
• virtual Handle< PricingEngine > controlPricingEngine () const
• virtual Handle< path_generator_type > pathGenerator () const=0
• virtual TimeGrid timeGrid () const=0

Protected Attributes
• Handle< MonteCarloModel< MC, S > > mcModel_
• bool antitheticVariate_
• bool controlVariate_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


440 QuantLib Class Documentation

Static Protected Attributes


• const Size minSample_ = 1023

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.266 MCVanillaEngine Class Template Reference 441

9.266 MCVanillaEngine Class Template Reference


#include <ql/PricingEngines/Vanilla/mcvanillaengine.hpp>
Inheritance diagram for MCVanillaEngine:

Observable

PricingEngine

GenericEngine< VanillaOption::arguments, VanillaOption::results >

VanillaEngine McSimulation< SingleAsset< RNG >, S >

MCVanillaEngine

MCDigitalEngine< RNG, S > MCEuropeanEngine< RNG, S >

9.266.1 Detailed Description

template<class RNG = PseudoRandom, class S = Statistics> class QuantLib::MCVanilla-


Engine< RNG, S >

Pricing engine for vanilla option using Monte Carlo simulation.

Public Member Functions


• void calculate () const

Protected Types
• typedef McSimulation< SingleAsset< RNG >, S >::path_generator_type path_generator_-
type
• typedef McSimulation< SingleAsset< RNG >, S >::path_pricer_type path_pricer_type
• typedef McSimulation< SingleAsset< RNG >, S >::stats_type stats_type

Protected Member Functions


• MCVanillaEngine (Size maxTimeStepsPerYear, bool antitheticVariate=false, bool control-
Variate=false, Size requiredSamples=Null< int >(), double requiredTolerance=Null< dou-
ble >(), Size maxSamples=Null< int >(), long seed=0)
• Handle< path_generator_type > pathGenerator () const

Protected Attributes
• Size maxTimeStepsPerYear_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


442 QuantLib Class Documentation

• Size requiredSamples_
• Size maxSamples_
• double requiredTolerance_
• long seed_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.267 MersenneTwisterUniformRng Class Reference 443

9.267 MersenneTwisterUniformRng Class Reference


#include <ql/RandomNumbers/mt19937uniformrng.hpp>

9.267.1 Detailed Description

Uniform random number generator.


Mersenne Twister random number generator of period 2∗∗19937-1
For more details see http://www.math.keio.ac.jp/matumoto/emt.html

Public Types
• typedef Sample< double > sample_type

Public Member Functions


• MersenneTwisterUniformRng (unsigned long seed=0)
• MersenneTwisterUniformRng (const std::vector< unsigned long > &seeds)
• sample_type next () const
• unsigned long nextInt32 () const
return a random number on [0,0xffffffff]-interval

9.267.2 Constructor & Destructor Documentation

9.267.2.1 MersenneTwisterUniformRng (unsigned long seed = 0) [explicit]

if the given seed is 0, a random seed will be chosen based on clock()

9.267.3 Member Function Documentation

9.267.3.1 sample_type next () const

returns a sample with weight 1.0 containing a random number on (0.0, 1.0)-real-interval

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


444 QuantLib Class Documentation

9.268 Milan Class Reference


#include <ql/Calendars/milan.hpp>
Inheritance diagram for Milan:

Bridge< Calendar, CalendarImpl >

Calendar

Milan

9.268.1 Detailed Description

Milan calendar
Holidays:

• Saturdays
• Sundays
• New Year’s Day, January 1st
• Epiphany, January 6th
• Easter Monday
• Liberation Day, April 25th
• Labour Day, May 1st
• Republic Day, June 2nd (since 2000)
• Assumption, August 15th
• All Saint’s Day, November 1st
• Immaculate Conception, December 8th
• Christmas, December 25th
• St. Stephen, December 26th

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.269 MixedScheme Class Template Reference 445

9.269 MixedScheme Class Template Reference


#include <ql/FiniteDifferences/mixedscheme.hpp>
Inheritance diagram for MixedScheme:

MixedScheme

CrankNicolson< Operator > ExplicitEuler< Operator > ImplicitEuler< Operator >

9.269.1 Detailed Description

template<class Operator> class QuantLib::MixedScheme< Operator >

Mixed (explicit/implicit) scheme for finite difference methods.


See sect. The finite differences framework(p. 37) for details on the method.
In this implementation, the passed operator must be derived from either TimeConstantOperator
or TimeDependentOperator. Also, it must implement at least the following interface:

typedef ... arrayType;

// copy constructor/assignment
// (these will be provided by the compiler if none is defined)
Operator(const Operator&);
Operator& operator=(const Operator&);

// inspectors
Size size();

// modifiers
void setTime(Time t);

// operator interface
arrayType applyTo(const arrayType&);
arrayType solveFor(const arrayType&);
static Operator identity(Size size);

// operator algebra
Operator operator*(double, const Operator&);
Operator operator+(const Operator&, const Operator&);
Operator operator+(const Operator&, const Operator&);

Warning:
The differential operator must be linear for this evolver to work.

Todo
a) derive variable theta schemes b) introduce multi time-level schemes.

Protected Types
• typedef Operator::arrayType arrayType
• typedef Operator operatorType
• typedef BoundaryCondition< Operator > bcType

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


446 QuantLib Class Documentation

Protected Member Functions


• MixedScheme (const Operator &L, double theta, const std::vector< Handle< bcType > >
&bcs)
• void step (arrayType &a, Time t)
• void setStep (Time dt)

Protected Attributes
• Operator L_
• Operator I_
• Operator explicitPart_
• Operator implicitPart_
• Time dt_
• double theta_
• std::vector< Handle< bcType > > bcs_

Friends
• class FiniteDifferenceModel< MixedScheme< Operator > >

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.270 MonotonicCubicSpline Class Reference 447

9.270 MonotonicCubicSpline Class Reference


#include <ql/Math/cubicspline.hpp>
Inheritance diagram for MonotonicCubicSpline:

Bridge< Interpolation, InterpolationImpl >

Interpolation

CubicSpline

MonotonicCubicSpline

9.270.1 Detailed Description

Cubic spline with monotonicity constraint

Public Member Functions


• template<class I1, class I2> MonotonicCubicSpline (const I1 &xBegin, const I1 &xEnd,
const I2 &yBegin, CubicSpline::BoundaryCondition leftCondition, double leftCondition-
Value, CubicSpline::BoundaryCondition rightCondition, double rightConditionValue)

9.270.2 Constructor & Destructor Documentation

9.270.2.1 MonotonicCubicSpline (const I1 & xBegin, const I1 & xEnd, const I2 & yBegin,
CubicSpline::BoundaryCondition leftCondition, double leftConditionValue,
CubicSpline::BoundaryCondition rightCondition, double rightConditionValue)

Precondition:
the x values must be sorted.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


448 QuantLib Class Documentation

9.271 MonteCarloModel Class Template Reference


#include <ql/MonteCarlo/montecarlomodel.hpp>

9.271.1 Detailed Description

template<class mc_traits, class stats_traits = Statistics> class QuantLib::MonteCarloModel<


mc_traits, stats_traits >

General purpose Monte Carlo model for path samples.


The template arguments of this class correspond to available policies for the particular model to
be instantiated—i.e., whether it is single- or multi-asset, or whether it should use pseudo-random
or low-discrepancy numbers for path generation. Such decisions are grouped in trait classes so
as to be orthogonal—see mctraits.hpp(p. 798) for examples.
The constructor accepts two safe references, i.e. two smart pointers, one to a path generator
and the other to a path pricer. In case of control variate technique the user should provide the
additional control option, namely the option path pricer and the option value.

Public Types
• typedef mc_traits::rsg_type rsg_type
• typedef mc_traits::path_generator_type path_generator_type
• typedef mc_traits::path_pricer_type path_pricer_type
• typedef path_generator_type::sample_type sample_type
• typedef path_pricer_type::result_type result_type
• typedef stats_traits stats_type

Public Member Functions


• MonteCarloModel (const Handle< path_generator_type > &pathGenerator, const
Handle< path_pricer_type > &pathPricer, const stats_type &sampleAccumulator, bool
antitheticVariate, const Handle< path_pricer_type > &cvPathPricer=Handle< path_-
pricer_type >(), result_type cvOptionValue=result_type())
• void addSamples (Size samples)
• const stats_type & sampleAccumulator (void) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.272 MoreGreeks Class Reference 449

9.272 MoreGreeks Class Reference


#include <ql/option.hpp>
Inheritance diagram for MoreGreeks:

Results

MoreGreeks

results

9.272.1 Detailed Description

more additional option results

Public Member Functions


• void reset ()

Public Attributes
• double itmCashProbability
• double deltaForward
• double elasticity
• double thetaPerDay
• double strikeSensitivity

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


450 QuantLib Class Documentation

9.273 MoroInverseCumulativeNormal Class Reference


#include <ql/Math/normaldistribution.hpp>

9.273.1 Detailed Description

Moro Inverse cumulative normal distribution class.


Given x between zero and one as the integral value of a gaussian normal distribution this class
provides the value y such that formula here ...
It uses Beasly and Springer approximation, with an improved approximation for the tails. See
Boris Moro, "The Full Monte", 1995, Risk Magazine.
This class can also be used to generate a gaussian normal distribution from a uniform distribution.
This is especially useful when a gaussian normal distribution is generated from a low discrepancy
uniform distribution: in this case the traditional Box-Muller approach and its variants would not
preserve the sequence’s low-discrepancy.
Peter J. Acklam’s approximation is better and is available as QuantLib::InverseCumulative-
Normal(p. 378)

Public Member Functions


• MoroInverseCumulativeNormal (double average=0.0, double sigma=1.0)
• double operator() (double x) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.274 MultiAssetOption Class Reference 451

9.274 MultiAssetOption Class Reference


#include <ql/Instruments/multiassetoption.hpp>
Inheritance diagram for MultiAssetOption:

Observable Observer

LazyObject

Instrument

Option

MultiAssetOption

BasketOption

9.274.1 Detailed Description

Base class for options on multiple assets.

Public Member Functions


• MultiAssetOption (const std::vector< Handle< BlackScholesStochasticProcess > > &stoch-
Procs, const Handle< Payoff > &payoff, const Handle< Exercise > &exercise, const Matrix
&correlation, const Handle< PricingEngine > &engine=Handle< PricingEngine >())
• void setupArguments (Arguments ∗) const

Instrument interface
• bool isExpired () const
returns whether the instrument is still tradable.

greeks
• double delta () const
• double gamma () const
• double theta () const
• double vega () const
• double rho () const
• double dividendRho () const

Protected Member Functions


• void setupExpired () const
• void performCalculations () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


452 QuantLib Class Documentation

Protected Attributes
• double delta_
• double gamma_
• double theta_
• double vega_
• double rho_
• double dividendRho_
• std::vector< Handle< BlackScholesStochasticProcess > > blackScholesProcesses_
• Matrix correlation_

9.274.2 Member Function Documentation

9.274.2.1 void setupArguments (Arguments ∗) const [virtual]

When a derived argument structure is defined for an instrument, this method should be overrid-
den to fill it. This is mandatory in case a pricing engine is used.
Reimplemented from Instrument (p. 368).
Reimplemented in BasketOption (p. 140).

9.274.2.2 void setupExpired () const [protected, virtual]

This method must leave the instrument in a consistent state when the expiration condition is met.
Reimplemented from Instrument (p. 369).

9.274.2.3 void performCalculations () const [protected, virtual]

In case a pricing engine is not used, this method must be overridden to perform the actual calcu-
lations and set any needed results. In case a pricing engine is used, the default implementation
can be used.
Reimplemented from Instrument (p. 369).
Reimplemented in BasketOption (p. 141).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.275 MultiAssetOption::arguments Class Reference 453

9.275 MultiAssetOption::arguments Class Reference


#include <ql/Instruments/multiassetoption.hpp>
Inheritance diagram for MultiAssetOption::arguments:

Arguments

arguments

MultiAssetOption::arguments

arguments

9.275.1 Detailed Description

Arguments for multi-asset option calculation

Public Member Functions


• void validate () const

Public Attributes
• std::vector< Handle< BlackScholesStochasticProcess > > blackScholesProcesses
• Matrix correlation

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


454 QuantLib Class Documentation

9.276 MultiAssetOption::results Class Reference


#include <ql/Instruments/multiassetoption.hpp>
Inheritance diagram for MultiAssetOption::results:

Results

Value Greeks

MultiAssetOption::results

9.276.1 Detailed Description

Results from multi-asset option calculation

Public Member Functions


• void reset ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.277 MultiPath Class Reference 455

9.277 MultiPath Class Reference


#include <ql/MonteCarlo/multipath.hpp>

9.277.1 Detailed Description

multiple random walk


MultiPath(p. 455) contains the list of variations for each asset,
j
Yi+1
log j
fori = 0, . . . , n − 1 and j = 0, . . . , m − 1
Yi
j
where Yi is the value of the underlying j at discretized time ti . The first index refers to the
underlying, the second to the time position MultiPath(p. 455)[j,i]

Todo
a) make it time-aware b) rename it as MultiAssetPath

Public Member Functions


• MultiPath (Size nAsset, const TimeGrid &timeGrid)
• MultiPath (const std::vector< Path > &multiPath)

inspectors

• Size assetNumber () const


• Size pathSize () const

read/write access to components

• const Path & operator[ ] (Size j) const


• Path & operator[ ] (Size j)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


456 QuantLib Class Documentation

9.278 MultiPathGenerator Class Template Reference


#include <ql/MonteCarlo/multipathgenerator.hpp>

9.278.1 Detailed Description

template<class GSG> class QuantLib::MultiPathGenerator< GSG >

Generates a multipath from a random number generator.


MultiPathGenerator<RAG> is a class that returns a random multi path. RAG is a sample gener-
ator which returns a random array. It must have the minimal interface:

RAG{
RAG();
RAG(Matrix& covariance,
long seed);
Sample<Array> next();
};

Todo
why store correlation Matrix(p. 418) rather than covariance?

Public Types
• typedef Sample< MultiPath > sample_type

Public Member Functions


• MultiPathGenerator (const std::vector< Handle< DiffusionProcess > > &diffusionProcs,
const Matrix &correlation, const TimeGrid &timeGrid, GSG generator, bool brownian-
Bridge)
• const sample_type & next () const
• const sample_type & antithetic () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.279 MultiPathGenerator_old Class Template Reference 457

9.279 MultiPathGenerator_old Class Template Reference


#include <ql/MonteCarlo/multipathgenerator.hpp>

9.279.1 Detailed Description

template<class RAG> class QuantLib::MultiPathGenerator_old< RAG >

Generates a multipath from a random number generator.


MultiPathGenerator_old<RAG> is a class that returns a random multi path. RAG is a sample
generator which returns a random array. It must have the minimal interface:

RAG{
RAG();
RAG(Matrix& covariance,
long seed);
Sample<Array> next();
};

Public Types
• typedef Sample< MultiPath > sample_type

Public Member Functions


• MultiPathGenerator_old (const Array &drifts, const Matrix &covariance, Time length, Size
timeSteps, long seed)
• MultiPathGenerator_old (const Array &drifts, const Matrix &covariance, const TimeGrid
&times, long seed=0)
• const sample_type & next () const
• const sample_type & antithetic () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


458 QuantLib Class Documentation

9.280 NaturalCubicSpline Class Reference


#include <ql/Math/cubicspline.hpp>
Inheritance diagram for NaturalCubicSpline:

Bridge< Interpolation, InterpolationImpl >

Interpolation

CubicSpline

NaturalCubicSpline

9.280.1 Detailed Description

Cubic spline with null second derivative at end points

Public Member Functions


• template<class I1, class I2> NaturalCubicSpline (const I1 &xBegin, const I1 &xEnd, const
I2 &yBegin)

9.280.2 Constructor & Destructor Documentation

9.280.2.1 NaturalCubicSpline (const I1 & xBegin, const I1 & xEnd, const I2 & yBegin)

Precondition:
the x values must be sorted.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.281 NaturalMonotonicCubicSpline Class Reference 459

9.281 NaturalMonotonicCubicSpline Class Reference


#include <ql/Math/cubicspline.hpp>
Inheritance diagram for NaturalMonotonicCubicSpline:

Bridge< Interpolation, InterpolationImpl >

Interpolation

CubicSpline

NaturalMonotonicCubicSpline

9.281.1 Detailed Description

Natural cubic spline with monotonicity constraint.

Public Member Functions


• template<class I1, class I2> NaturalMonotonicCubicSpline (const I1 &xBegin, const I1
&xEnd, const I2 &yBegin)

9.281.2 Constructor & Destructor Documentation

9.281.2.1 NaturalMonotonicCubicSpline (const I1 & xBegin, const I1 & xEnd, const I2 &
yBegin)

Precondition:
the x values must be sorted.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


460 QuantLib Class Documentation

9.282 NeumannBC Class Reference


#include <ql/FiniteDifferences/boundarycondition.hpp>
Inheritance diagram for NeumannBC:

BoundaryCondition< TridiagonalOperator >

NeumannBC

9.282.1 Detailed Description

Neumann boundary condition (i.e., constant derivative).

Warning:
The value passed must not be the value of the derivative. Instead, it must be comprehensive
of the grid step between the first two points–i.e., it must be the difference between f[0] and
f[1].

Todo
generalize to time-dependent conditions.

Public Member Functions


• NeumannBC (double value, Side side)
• void applyBeforeApplying (TridiagonalOperator &) const
• void applyAfterApplying (Array &) const
• void applyBeforeSolving (TridiagonalOperator &, Array &rhs) const
• void applyAfterSolving (Array &) const
• void setTime (Time t)

9.282.2 Member Function Documentation

9.282.2.1 void setTime (Time t) [virtual]

This method sets the current time for time-dependent boundary conditions.
Implements BoundaryCondition< TridiagonalOperator > (p. 173).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.283 Newton Class Reference 461

9.283 Newton Class Reference


#include <ql/Solvers1D/newton.hpp>
Inheritance diagram for Newton:

CuriouslyRecurringTemplate< Newton >

Solver1D< Newton >

Newton

9.283.1 Detailed Description

Newton 1-D solver

Note:
This solver requires that the passed function object implement a method double
derivative(double).

Public Member Functions


• template<class F> double solveImpl (const F &f, double xAccuracy) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


462 QuantLib Class Documentation

9.284 NewtonSafe Class Reference


#include <ql/Solvers1D/newtonsafe.hpp>
Inheritance diagram for NewtonSafe:

CuriouslyRecurringTemplate< NewtonSafe >

Solver1D< NewtonSafe >

NewtonSafe

9.284.1 Detailed Description

safe Newton 1-D solver

Note:
This solver requires that the passed function object implement a method double
derivative(double).

Public Member Functions


• template<class F> double solveImpl (const F &f, double xAccuracy) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.285 NewYork Class Reference 463

9.285 NewYork Class Reference


#include <ql/Calendars/newyork.hpp>
Inheritance diagram for NewYork:

Bridge< Calendar, CalendarImpl >

Calendar

NewYork

9.285.1 Detailed Description

New York calendar.


Holidays:

• Saturdays
• Sundays
• New Year’s Day, January 1st (possibly moved to Monday if actually on Sunday, or to Friday
if on Saturday)
• Martin Luther King’s birthday, third Monday in January
• Washington’s birthday, third Monday in February
• Good Friday
• Memorial Day, last Monday in May
• Independence Day, July 4th (moved to Monday if Sunday or Friday if Saturday)
• Labor Day, first Monday in September

• Thanksgiving Day, fourth Thursday in November


• Christmas, December 25th (moved to Monday if Sunday or Friday if Saturday)

Data from http://www.nyse.com

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


464 QuantLib Class Documentation

9.286 NoConstraint Class Reference


#include <ql/Optimization/constraint.hpp>
Inheritance diagram for NoConstraint:

Bridge< Constraint, ConstraintImpl >

Constraint

NoConstraint

9.286.1 Detailed Description

No constraint.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.287 NonLinearLeastSquare Class Reference 465

9.287 NonLinearLeastSquare Class Reference


#include <ql/Optimization/leastsquare.hpp>

9.287.1 Detailed Description

Non-linear least-square method.


Using a given optimization algorithm (default is conjugate gradient),
min { r(x) : x in R∧ n }
where r(x) = ||f(x)||∧ 2 the euclidian norm of f(x) for some vector-valued function f from R∧ n to
R∧ m f = (f1, ..., fm) with fi(x) = bi - phi(x,ti) where bi is the vector of target data and phi is a scalar
function.
Assuming the differentiability of f, the gradient of r is define by grad r(x) = f’(x)∧ t.f(x)
Array(p. 126) vector class has the requirement of the previous class Handle(p. 339) class is need
to manage pointer to optimization method

Public Member Functions


• NonLinearLeastSquare (Constraint &c, double accuracy=1e-4, int maxiter=100)
Default constructor.

• NonLinearLeastSquare (Constraint &c, double accuracy, int maxiter, Handle<


OptimizationMethod > om)
Default constructor.

• ∼NonLinearLeastSquare ()
Destructor.

• Array & perform (LeastSquareProblem &lsProblem)


Solve least square problem using numerix solver.

• void setInitialValue (const Array &initialValue)


• Array & results ()
return the results

• double residualNorm ()
return the least square residual norm

• double lastValue ()
return last function value

• int exitFlag ()
return exit flag

• int iterationsNumber ()
return the performed number of iterations

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


466 QuantLib Class Documentation

9.288 NormalDistribution Class Reference


#include <ql/Math/normaldistribution.hpp>

9.288.1 Detailed Description

Normal distribution function.


formula here ... Given x it returns its probability in a Gaussian normal distribution. It provides
the first derivative too.

Public Member Functions


• NormalDistribution (double average=0.0, double sigma=1.0)
• double operator() (double x) const
• double derivative (double x) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.289 Null Class Template Reference 467

9.289 Null Class Template Reference


#include <ql/null.hpp>

9.289.1 Detailed Description

template<class Type> class QuantLib::Null< Type >

template class providing a null value for a given type.

Public Member Functions


• operator Type () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


468 QuantLib Class Documentation

9.290 NullCalendar Class Reference


#include <ql/Calendars/nullcalendar.hpp>
Inheritance diagram for NullCalendar:

Bridge< Calendar, CalendarImpl >

Calendar

NullCalendar

9.290.1 Detailed Description

Calendar for reproducing theoretical calculations.


This calendar has no holidays. It ensures that dates at whole-month distances have the same day
of month.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.291 NullParameter Class Reference 469

9.291 NullParameter Class Reference


#include <ql/ShortRateModels/parameter.hpp>
Inheritance diagram for NullParameter:

Bridge< Parameter, ParameterImpl >

Parameter

NullParameter

9.291.1 Detailed Description

Parameter which is always zero a(t) = 0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


470 QuantLib Class Documentation

9.292 NumericalMethod Class Reference


#include <ql/numericalmethod.hpp>
Inheritance diagram for NumericalMethod:

NumericalMethod

Lattice

BlackScholesLattice Lattice2D ShortRateTree

ShortRateTree

9.292.1 Detailed Description

Numerical method (tree, finite-differences) base class.

Public Member Functions


• NumericalMethod (const TimeGrid &timeGrid)
• const TimeGrid & timeGrid () const
• virtual void initialize (const Handle< DiscretizedAsset > &, Time time) const=0
• virtual void rollback (const Handle< DiscretizedAsset > &, Time to) const=0
• virtual void rollAlmostBack (const Handle< DiscretizedAsset > &, Time to) const=0

Protected Attributes
• TimeGrid t_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.293 Observable Class Reference 471

9.293 Observable Class Reference

#include <ql/Patterns/observable.hpp>
Inheritance diagram for Observable:

AffineModel

BlackModel

BlackVolTermStructure

CalibrationHelper

CapFlatVolatilityStructure

CapletForwardVolatilityStructure

CashFlow

Index

LazyObject

Link

Link< BlackVarianceCurve >

Link< BlackVolTermStructure >


Observable
Link< LocalVolTermStructure >

Link< Quote >

Link< TermStructure >

LocalVolTermStructure

PricingEngine

Quote

RateHelper

ShortRateModel

StochasticProcess

SwaptionVolatilityStructure

TermStructure

TermStructureConsistentModel

9.293.1 Detailed Description

Object that notifies its changes to a set of observables.

Public Member Functions

• void notifyObservers ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


472 QuantLib Class Documentation

Friends
• class Observer

9.293.2 Member Function Documentation

9.293.2.1 void notifyObservers ()

This method should be called at the end of non-const methods or when the programmer desires
to notify any changes.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.294 Observer Class Reference 473

9.294 Observer Class Reference

#include <ql/Patterns/observable.hpp>
Inheritance diagram for Observer:

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


474 QuantLib Class Documentation

AffineTermStructure

BlackConstantVol

BlackModel

BlackVarianceCurve

BlackVarianceSurface

CalibrationHelper

CompositeQuote

DerivedQuote

DriftTermStructure

ExtendedDiscountCurve

ForwardSpreadedTermStructure

GenericModelEngine

GenericModelEngine< AffineModel, CapFloor::arguments, CapFloor::results >

GenericModelEngine< BlackModel, CapFloor::arguments, CapFloor::results >

GenericModelEngine< BlackModel, Swaption::arguments, Swaption::results >

GenericModelEngine< OneFactorAffineModel, Swaption::arguments, Swaption::results >

GenericModelEngine< ShortRateModel, Arguments, Results >

GenericModelEngine< ShortRateModel, CapFloor::arguments, CapFloor::results >

GenericModelEngine< ShortRateModel, Swaption::arguments, Swaption::results >

Observer ImpliedTermStructure

ImpliedVolTermStructure

IndexedCoupon

LazyObject

Link

Link< BlackVarianceCurve >

Link< BlackVolTermStructure >

Link< LocalVolTermStructure >

Link< Quote >

Link< TermStructure >

LocalConstantVol

LocalVolCurve

LocalVolSurface

ParCoupon

QuantoTermStructure

RateHelper

ShortRateModel

StochasticProcess

Xibor

ZeroSpreadedTermStructure

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.294 Observer Class Reference 475

9.294.1 Detailed Description

Object that gets notified when a given observable changes.

Public Member Functions


• Observer (const Observer &)
• Observer & operator= (const Observer &)
• template<class T> void registerWith (const Handle< T > &h)
• template<class T> void unregisterWith (const Handle< T > &h)
• virtual void update ()=0

9.294.2 Member Function Documentation

9.294.2.1 virtual void update () [pure virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implemented in IndexedCoupon (p. 365), ParCoupon (p. 500), Xibor (p. 632), DerivedQuote
(p. 245), CompositeQuote (p. 212), LazyObject (p. 392), BlackModel (p. 159), GenericModel-
Engine (p. 333), LatticeShortRateModelEngine (p. 389), Link (p. 404), CalibrationHelper
(p. 190), ShortRateModel (p. 551), StochasticProcess (p. 573), AffineTermStructure (p. 114),
DriftTermStructure (p. 270), ExtendedDiscountCurve (p. 289), ForwardSpreadedTermStructure
(p. 314), ImpliedTermStructure (p. 356), QuantoTermStructure (p. 529), RateHelper (p. 537),
ZeroSpreadedTermStructure (p. 637), BlackConstantVol (p. 156), BlackVarianceCurve (p. 165),
BlackVarianceSurface (p. 167), ImpliedVolTermStructure (p. 358), LocalConstantVol (p. 407),
LocalVolCurve (p. 409), LocalVolSurface (p. 411), GenericModelEngine< ShortRateModel, Ar-
guments, Results > (p. 333), GenericModelEngine< BlackModel, CapFloor::arguments, Cap-
Floor::results > (p. 333), GenericModelEngine< OneFactorAffineModel, Swaption::arguments,
Swaption::results > (p. 333), GenericModelEngine< AffineModel, CapFloor::arguments, Cap-
Floor::results > (p. 333), GenericModelEngine< ShortRateModel, CapFloor::arguments, Cap-
Floor::results > (p. 333), GenericModelEngine< BlackModel, Swaption::arguments, Swap-
tion::results > (p. 333), GenericModelEngine< ShortRateModel, Swaption::arguments, Swap-
tion::results > (p. 333), LatticeShortRateModelEngine< CapFloor::arguments, CapFloor::results
> (p. 389), LatticeShortRateModelEngine< Swaption::arguments, Swaption::results > (p. 389),
Link< LocalVolTermStructure > (p. 404), Link< BlackVarianceCurve > (p. 404), Link< Black-
VolTermStructure > (p. 404), Link< TermStructure > (p. 404), and Link< Quote > (p. 404).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


476 QuantLib Class Documentation

9.295 OneAssetOption Class Reference


#include <ql/Instruments/oneassetoption.hpp>
Inheritance diagram for OneAssetOption:

Observable Observer

LazyObject

Instrument

Option

OneAssetOption

OneAssetStrikedOption

BarrierOption DiscreteAveragingAsianOption VanillaOption

ForwardVanillaOption QuantoVanillaOption

QuantoForwardVanillaOption

9.295.1 Detailed Description

Base class for options on a single asset.

Public Member Functions


• OneAssetOption (const Handle< BlackScholesStochasticProcess > &stochProc, const
Handle< Payoff > &payoff, const Handle< Exercise > &exercise, const Handle< Pricing-
Engine > &engine=Handle< PricingEngine >())
• double impliedVolatility (double price, double accuracy=1.0e-4, Size maxEvaluations=100,
double minVol=QL_MIN_VOLATILITY, double maxVol=QL_MAX_VOLATILITY) const
• void setupArguments (Arguments ∗) const

Instrument interface

• bool isExpired () const


returns whether the instrument is still tradable.

greeks

• double delta () const


• double deltaForward () const
• double elasticity () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.295 OneAssetOption Class Reference 477

• double gamma () const


• double theta () const
• double thetaPerDay () const
• double vega () const
• double rho () const
• double dividendRho () const
• double itmCashProbability () const

Protected Member Functions

• void setupExpired () const


• void performCalculations () const

Protected Attributes

• double delta_
• double deltaForward_
• double elasticity_
• double gamma_
• double theta_
• double thetaPerDay_
• double vega_
• double rho_
• double dividendRho_
• double itmCashProbability_
• Handle< BlackScholesStochasticProcess > blackScholesProcess_

9.295.2 Member Function Documentation

9.295.2.1 double impliedVolatility (double price, double accuracy = 1.0e-4, Size


maxEvaluations = 100, double minVol = QL_MIN_VOLATILITY, double maxVol =
QL_MAX_VOLATILITY) const

Warning:
currently, this method returns the Black-Scholes implied volatility. It will give unconsistent
results if the pricing was performed with any other methods (such as jump-diffusion models.)
options with a gamma that changes sign have values that are not monotonic in the volatility,
e.g binary options. In these cases the calculation can fail and the result (if any) is almost
meaningless. Another possible source of failure is to have a target value that is not attainable
with any volatility, e.g., a target value lower than the intrinsic value in the case of American
options.

Bug
run-time crashes are possible with the Borland compiler

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


478 QuantLib Class Documentation

9.295.2.2 void setupArguments (Arguments ∗) const [virtual]

When a derived argument structure is defined for an instrument, this method should be overrid-
den to fill it. This is mandatory in case a pricing engine is used.
Reimplemented from Instrument (p. 368).
Reimplemented in DiscreteAveragingAsianOption (p. 256), BarrierOption (p. 137), Forward-
VanillaOption (p. 316), OneAssetStrikedOption (p. 482), QuantoForwardVanillaOption
(p. 525), and QuantoVanillaOption (p. 531).

9.295.2.3 void setupExpired () const [protected, virtual]

This method must leave the instrument in a consistent state when the expiration condition is met.
Reimplemented from Instrument (p. 369).
Reimplemented in QuantoVanillaOption (p. 531).

9.295.2.4 void performCalculations () const [protected, virtual]

In case a pricing engine is not used, this method must be overridden to perform the actual calcu-
lations and set any needed results. In case a pricing engine is used, the default implementation
can be used.
Reimplemented from Instrument (p. 369).
Reimplemented in DiscreteAveragingAsianOption (p. 256), BarrierOption (p. 137), Forward-
VanillaOption (p. 316), OneAssetStrikedOption (p. 482), QuantoVanillaOption (p. 531), and
VanillaOption (p. 624).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.296 OneAssetOption::arguments Class Reference 479

9.296 OneAssetOption::arguments Class Reference


#include <ql/Instruments/oneassetoption.hpp>
Inheritance diagram for OneAssetOption::arguments:

Arguments

arguments

OneAssetOption::arguments

9.296.1 Detailed Description

Arguments for single-asset option calculation

Public Member Functions


• void validate () const

Public Attributes
• Handle< BlackScholesStochasticProcess > blackScholesProcess

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


480 QuantLib Class Documentation

9.297 OneAssetOption::results Class Reference


#include <ql/Instruments/oneassetoption.hpp>
Inheritance diagram for OneAssetOption::results:

Results

Value Greeks MoreGreeks

OneAssetOption::results

9.297.1 Detailed Description

Results from single-asset option calculation

Public Member Functions


• void reset ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.298 OneAssetStrikedOption Class Reference 481

9.298 OneAssetStrikedOption Class Reference


#include <ql/Instruments/oneassetstrikedoption.hpp>
Inheritance diagram for OneAssetStrikedOption:

Observable Observer

LazyObject

Instrument

Option

OneAssetOption

OneAssetStrikedOption

BarrierOption DiscreteAveragingAsianOption VanillaOption

ForwardVanillaOption QuantoVanillaOption

QuantoForwardVanillaOption

9.298.1 Detailed Description

Base class for options on a single asset with striked payoff.

Public Member Functions


• OneAssetStrikedOption (const Handle< BlackScholesStochasticProcess > &stochProc,
const Handle< StrikedTypePayoff > &payoff, const Handle< Exercise > &exercise, const
Handle< PricingEngine > &engine=Handle< PricingEngine >())
• void setupArguments (Arguments ∗) const

greeks

• double strikeSensitivity () const

Protected Member Functions


• void performCalculations () const

Protected Attributes
• double strikeSensitivity_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


482 QuantLib Class Documentation

9.298.2 Member Function Documentation

9.298.2.1 void setupArguments (Arguments ∗) const [virtual]

When a derived argument structure is defined for an instrument, this method should be overrid-
den to fill it. This is mandatory in case a pricing engine is used.
Reimplemented from OneAssetOption (p. 478).
Reimplemented in DiscreteAveragingAsianOption (p. 256), BarrierOption (p. 137), Forward-
VanillaOption (p. 316), QuantoForwardVanillaOption (p. 525), and QuantoVanillaOption
(p. 531).

9.298.2.2 void performCalculations () const [protected, virtual]

In case a pricing engine is not used, this method must be overridden to perform the actual calcu-
lations and set any needed results. In case a pricing engine is used, the default implementation
can be used.
Reimplemented from OneAssetOption (p. 478).
Reimplemented in DiscreteAveragingAsianOption (p. 256), BarrierOption (p. 137), Forward-
VanillaOption (p. 316), QuantoVanillaOption (p. 531), and VanillaOption (p. 624).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.299 OneFactorAffineModel Class Reference 483

9.299 OneFactorAffineModel Class Reference


#include <ql/ShortRateModels/onefactormodel.hpp>
Inheritance diagram for OneFactorAffineModel:

Observer Observable

ShortRateModel

OneFactorModel AffineModel

OneFactorAffineModel

CoxIngersollRoss Vasicek

ExtendedCoxIngersollRoss HullWhite

9.299.1 Detailed Description

Single-factor affine base class.


Single-factor models with an analytical formula for discount bonds should inherit from this class.
They must then implement the functions A(t, T) and B(t, T) such that

P(t, T, rt ) = A(t, T)e−B(t,T)rt .

Public Member Functions


• OneFactorAffineModel (Size nArguments)
• double discountBond (Time now, Time maturity, Rate rate) const
• DiscountFactor discount (Time t) const
Implied discount curve.

Protected Member Functions


• virtual double A (Time t, Time T) const=0
• virtual double B (Time t, Time T) const=0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


484 QuantLib Class Documentation

9.300 OneFactorModel Class Reference


#include <ql/ShortRateModels/onefactormodel.hpp>
Inheritance diagram for OneFactorModel:

Observer Observable

ShortRateModel

OneFactorModel

BlackKarasinski OneFactorAffineModel

CoxIngersollRoss Vasicek

ExtendedCoxIngersollRoss HullWhite

9.300.1 Detailed Description

Single-factor short-rate model abstract class.

Public Member Functions


• OneFactorModel (Size nArguments)
• virtual Handle< ShortRateDynamics > dynamics () const=0
returns the short-rate dynamics

• virtual Handle< Lattice > tree (const TimeGrid &grid) const


Return by default a trinomial recombining tree.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.301 OneFactorModel::ShortRateDynamics Class Reference 485

9.301 OneFactorModel::ShortRateDynamics Class Reference


#include <ql/ShortRateModels/onefactormodel.hpp>

9.301.1 Detailed Description

Base class describing the short-rate dynamics.

Public Member Functions


• ShortRateDynamics (const Handle< DiffusionProcess > &process)
• virtual double variable (Time t, Rate r) const=0
Compute state variable from short rate.

• virtual Rate shortRate (Time t, double variable) const=0


Compute short rate from state variable.

• const Handle< DiffusionProcess > & process ()


Returns the risk-neutral dynamics of the state variable.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


486 QuantLib Class Documentation

9.302 OneFactorModel::ShortRateTree Class Reference


#include <ql/ShortRateModels/onefactormodel.hpp>
Inheritance diagram for OneFactorModel::ShortRateTree:

NumericalMethod

Lattice

OneFactorModel::ShortRateTree

9.302.1 Detailed Description

Recombining trinomial tree discretizing the state variable.

Public Member Functions


• ShortRateTree (const Handle< Tree > &tree, const Handle< ShortRateDynamics > &dy-
namics, const TimeGrid &timeGrid)
Plain tree build-up from short-rate dynamics.

• ShortRateTree (const Handle< Tree > &tree, const Handle< ShortRateDynamics > &dy-
namics, const Handle< TermStructureFittingParameter::NumericalImpl > &phi, const
TimeGrid &timeGrid)
Tree(p. 607) build-up + numerical fitting to term-structure.

• Size size (Size i) const


• DiscountFactor discount (Size i, Size index) const
Discount factor at time t_i and node indexed by index.

Protected Member Functions


• Size descendant (Size i, Size index, Size branch) const
Tree(p. 607) properties.

• double probability (Size i, Size index, Size branch) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.303 OneFactorOperator Class Reference 487

9.303 OneFactorOperator Class Reference


#include <ql/FiniteDifferences/onefactoroperator.hpp>
Inheritance diagram for OneFactorOperator:

TridiagonalOperator

OneFactorOperator

9.303.1 Detailed Description

Interest-rate single factor model differential operator.

Public Member Functions


• OneFactorOperator (const Array &grid, const Handle< OneFactorModel::ShortRate-
Dynamics > &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


488 QuantLib Class Documentation

9.304 OptimizationMethod Class Reference


#include <ql/Optimization/method.hpp>
Inheritance diagram for OptimizationMethod:

OptimizationMethod

ConjugateGradient Simplex SteepestDescent

9.304.1 Detailed Description

Abstract class for constrained optimization method.

Public Member Functions


• void setInitialValue (const Array &initialValue)
Set initial value.

• void setEndCriteria (const EndCriteria &endCriteria)


Set optimization end criteria.

• int & iterationNumber () const


current iteration number

• EndCriteria & endCriteria () const


optimization end criteria

• int & functionEvaluation () const


number of evaluation of cost function

• int & gradientEvaluation () const


number of evaluation of cost function gradient

• double & functionValue () const


value of cost function

• double & gradientNormValue () const


value of cost function gradient norm

• Array & x () const


current value of the local minimum

• Array & searchDirection () const


current value of the search direction

• virtual void minimize (const Problem &P) const=0


minimize the optimization problem P

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.304 OptimizationMethod Class Reference 489

Protected Attributes
• Array initialValue_
initial value of unknowns

• int iterationNumber_
current iteration step in the Optimization process

• EndCriteria endCriteria_
optimization end criteria

• int functionEvaluation_
number of evaluation of cost function and its gradient

• int gradientEvaluation_
number of evaluation of cost function and its gradient

• double functionValue_
function and gradient norm values of the last step

• double squaredNorm_
function and gradient norm values of the last step

• Array x_
current values of the local minimum and the search direction

• Array searchDirection_
current values of the local minimum and the search direction

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


490 QuantLib Class Documentation

9.305 Option Class Reference


#include <ql/option.hpp>
Inheritance diagram for Option:

Observable Observer

LazyObject

Instrument

Option

MultiAssetOption OneAssetOption Swaption

BasketOption OneAssetStrikedOption

BarrierOption DiscreteAveragingAsianOption VanillaOption

ForwardVanillaOption QuantoVanillaOption

QuantoForwardVanillaOption

9.305.1 Detailed Description

base option class

Public Types
• enum Type { Call, Put, Straddle }

Public Member Functions


• Option (const Handle< Payoff > &payoff, const Handle< Exercise > &exercise, const
Handle< PricingEngine > &engine=Handle< PricingEngine >())

Protected Attributes
• Handle< Payoff > payoff_
• Handle< Exercise > exercise_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.306 Option::arguments Class Reference 491

9.306 Option::arguments Class Reference


#include <ql/option.hpp>
Inheritance diagram for Option::arguments:

Arguments

Option::arguments

arguments arguments arguments

arguments

9.306.1 Detailed Description

basic option arguments

Todo
a) remove std::vector<Time> stoppingTimes b) how to handle strike-less option (asian aver-
age strike, forward, etc.)?

Public Member Functions


• void validate () const

Public Attributes
• Handle< Payoff > payoff
• Handle< Exercise > exercise
• std::vector< Time > stoppingTimes

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


492 QuantLib Class Documentation

9.307 OptionTypeFormatter Class Reference


#include <ql/dataformatters.hpp>

9.307.1 Detailed Description

Formats option type for output.

Static Public Member Functions


• std::string toString (Option::Type type)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.308 OrnsteinUhlenbeckProcess Class Reference 493

9.308 OrnsteinUhlenbeckProcess Class Reference

#include <ql/diffusionprocess.hpp>
Inheritance diagram for OrnsteinUhlenbeckProcess:

DiffusionProcess

OrnsteinUhlenbeckProcess

9.308.1 Detailed Description

Ornstein-Uhlenbeck process class.


This class describes the Ornstein-Uhlenbeck process governed by

dx = −axt dt + σdWt .

Public Member Functions

• OrnsteinUhlenbeckProcess (double speed, double vol, double x0=0.0)


• double drift (Time t, double x) const
returns the drift part of the equation, i.e. µ(t, xt )

• double diffusion (Time t, double x) const


• double expectation (Time t0, double x0, Time dt) const
returns the expectation of the process after a time interval

• double variance (Time t0, double x0, Time dt) const


returns the variance of the process after a time interval

9.308.2 Member Function Documentation

9.308.2.1 double diffusion (Time t, double x) const [virtual]

returns the diffusion part of the equation, i.e. σ(t, xt )


Implements DiffusionProcess (p. 246).

9.308.2.2 double expectation (Time t0, double x0, Time dt) const [virtual]

returns the expectation of the process after a time interval


returns E(xt0 +∆t |xt0 = x0 ). By default, it returns the Euler approximation defined by x0 + µ(t0 , x0 )∆t.
Reimplemented from DiffusionProcess (p. 246).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


494 QuantLib Class Documentation

9.308.2.3 double variance (Time t0, double x0, Time dt) const [virtual]

returns the variance of the process after a time interval


returns Var(xt0 +∆t |xt0 = x0 ). By default, it returns the Euler approximation defined by σ(t0 , x0 )2 ∆t.
Reimplemented from DiffusionProcess (p. 247).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.309 Oslo Class Reference 495

9.309 Oslo Class Reference


#include <ql/Calendars/oslo.hpp>
Inheritance diagram for Oslo:

Bridge< Calendar, CalendarImpl >

Calendar

Oslo

9.309.1 Detailed Description

Oslo calendar
Holidays:

• Saturdays
• Sundays
• Holy Thursday
• Good Friday
• Easter Monday
• Ascension
• Whit(Pentecost) Monday
• New Year’s Day, January 1st
• May Day, May 1st
• National Independence Day, May 17st
• Christmas, December 25th
• Boxing Day, December 26th

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


496 QuantLib Class Documentation

9.310 OutOfMemoryError Class Reference


#include <ql/errors.hpp>
Inheritance diagram for OutOfMemoryError:

Error

OutOfMemoryError

9.310.1 Detailed Description

Specialized error.
Thrown upon failed allocation.

Public Member Functions


• OutOfMemoryError (const std::string &whatClass="unknown class")

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.311 Parameter Class Reference 497

9.311 Parameter Class Reference


#include <ql/ShortRateModels/parameter.hpp>
Inheritance diagram for Parameter:

Bridge< Parameter, ParameterImpl >

Parameter

ConstantParameter NullParameter PiecewiseConstantParameter TermStructureFittingParameter

9.311.1 Detailed Description

Base class for model arguments.

Public Member Functions


• const Array & params () const
• void setParam (Size i, double x)
• bool testParams (const Array &params) const
• Size size () const
• double operator() (Time t) const
• const Handle< ParameterImpl > & implementation () const

Protected Member Functions


• Parameter (Size size, const Handle< ParameterImpl > &impl, const Constraint &constraint)

Protected Attributes
• Array params_
• Constraint constraint_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


498 QuantLib Class Documentation

9.312 ParameterImpl Class Reference


#include <ql/ShortRateModels/parameter.hpp>

9.312.1 Detailed Description

Base class for model parameter implementation.

Public Member Functions


• virtual double value (const Array &params, Time t) const=0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.313 ParCoupon Class Reference 499

9.313 ParCoupon Class Reference


#include <ql/CashFlows/parcoupon.hpp>
Inheritance diagram for ParCoupon:

Observable

CashFlow

Coupon

FloatingRateCoupon Observer

ParCoupon

ShortFloatingRateCoupon

9.313.1 Detailed Description

coupon at par on a term structure

Warning:
This class does not perform any date adjustment, i.e., the start and end date passed upon
construction should be already rolled to a business day.

Public Member Functions


• ParCoupon (double nominal, const Date &paymentDate, const Handle< Xibor > &index,
const Date &startDate, const Date &endDate, int fixingDays, Spread spread=0.0, const Date
&refPeriodStart=Date(), const Date &refPeriodEnd=Date())

CashFlow interface

• double amount () const


returns the amount of the cash flow

Coupon interface

• DayCounter dayCounter () const


day counter for accrual calculation

FloatingRateCoupon interface

• Rate fixing () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


500 QuantLib Class Documentation

• Date fixingDate () const

Inspectors

• const Handle< Xibor > & index () const

Observer interface

• void update ()

Visitability

• virtual void accept (AcyclicVisitor &)

9.313.2 Member Function Documentation

9.313.2.1 double amount () const [virtual]

returns the amount of the cash flow

Note:
The amount is not discounted, i.e., it is the actual amount paid at the cash flow date.

Implements CashFlow (p. 200).


Reimplemented in ShortFloatingRateCoupon (p. 549).

9.313.2.2 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.314 Path Class Reference 501

9.314 Path Class Reference


#include <ql/MonteCarlo/path.hpp>

9.314.1 Detailed Description

single factor random walk path pricer

Todo
should Path(p. 501) include the t=0.0 point? Alternatively all path pricers must be revisited.

Public Member Functions


• Path (const TimeGrid &timeGrid, const Array &drift=Array(), const Array &diffu-
sion=Array())

inspectors

• double operator[ ] (int i) const


• Size size () const

read/write access to components

• const TimeGrid & timeGrid () const


• TimeGrid & timeGrid ()
• const Array & drift () const
• Array & drift ()
• const Array & diffusion () const
• Array & diffusion ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


502 QuantLib Class Documentation

9.315 PathGenerator Class Template Reference


#include <ql/MonteCarlo/pathgenerator.hpp>

9.315.1 Detailed Description

template<class GSG> class QuantLib::PathGenerator< GSG >

Generates random paths using a sequence generator.


Generates random paths with drift(S,t) and variance(S,t) using a gaussian sequence generator

Public Types
• typedef Sample< Path > sample_type

Public Member Functions


• PathGenerator (const Handle< DiffusionProcess > &diffProcess, Time length, Size time-
Steps, const GSG &generator, bool brownianBridge)
• PathGenerator (const Handle< DiffusionProcess > &diffProcess, const TimeGrid &time-
Grid, const GSG &generator, bool brownianBridge)

inspectors

• const sample_type & next () const


• const sample_type & antithetic () const
• Size size () const
• const TimeGrid & timeGrid () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.316 PathGenerator_old Class Template Reference 503

9.316 PathGenerator_old Class Template Reference


#include <ql/MonteCarlo/pathgenerator.hpp>

9.316.1 Detailed Description

template<class RNG> class QuantLib::PathGenerator_old< RNG >

Generates random paths from a random number generator.

Deprecated
use PathGenerator(p. 502) instead

Public Types
• typedef Sample< Path > sample_type

Public Member Functions


• PathGenerator_old (double drift, double variance, Time length, Size timeSteps, long
seed=0)
• PathGenerator_old (double drift, double variance, const TimeGrid &times, long seed=0)
• PathGenerator_old (const std::vector< double > &drift, const std::vector< double > &vari-
ance, const TimeGrid &times, long seed=0)

inspectors

• const sample_type & next () const


• const sample_type & antithetic () const
• Size size () const

9.316.2 Constructor & Destructor Documentation

9.316.2.1 PathGenerator_old (double drift, double variance, const TimeGrid & times, long
seed = 0)

Warning:
the initial time is assumed to be zero and must not be included in the passed vector

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


504 QuantLib Class Documentation

9.317 PathPricer Class Template Reference


#include <ql/MonteCarlo/pathpricer.hpp>

9.317.1 Detailed Description

template<class PathType, class ValueType = double> class QuantLib::PathPricer< PathType,


ValueType >

base class for path pricers


Given a path the value of an option is returned on that path.

Public Member Functions


• PathPricer (const RelinkableHandle< TermStructure > &riskFreeTS)
• virtual ValueType operator() (const PathType &path) const=0

Protected Attributes
• RelinkableHandle< TermStructure > riskFreeTS_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.318 PathPricer_old Class Template Reference 505

9.318 PathPricer_old Class Template Reference


#include <ql/MonteCarlo/pathpricer.hpp>

9.318.1 Detailed Description

template<class PathType, class ValueType = double> class QuantLib::PathPricer_old< Path-


Type, ValueType >

base class for path pricers


Given a path the value of an option is returned on that path.

Deprecated
use PathPricer(p. 504) instead

Public Member Functions


• PathPricer_old (DiscountFactor discount, bool useAntitheticVariance)
• virtual ValueType operator() (const PathType &path) const=0

Protected Attributes
• DiscountFactor discount_
• bool useAntitheticVariance_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


506 QuantLib Class Documentation

9.319 Payoff Class Reference


#include <ql/payoff.hpp>
Inheritance diagram for Payoff:

Payoff

TypePayoff

StrikedTypePayoff

9.319.1 Detailed Description

Base class for option payoffs.

Public Member Functions


• virtual double operator() (double price) const=0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.320 PercentageStrikePayoff Class Reference 507

9.320 PercentageStrikePayoff Class Reference


#include <ql/Instruments/payoffs.hpp>
Inheritance diagram for PercentageStrikePayoff:

Payoff

TypePayoff

StrikedTypePayoff

PercentageStrikePayoff

9.320.1 Detailed Description

Payoff with strike expressed as percentage

Public Member Functions


• PercentageStrikePayoff (Option::Type type, double moneyness)
• double operator() (double price) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


508 QuantLib Class Documentation

9.321 PerformanceOption Class Reference


#include <ql/Pricers/performanceoption.hpp>

9.321.1 Detailed Description

Performance option.
A performance option is a variant of a cliquet option: the payoff of each forward-starting (a.k.a.
deferred strike) options is $ max(S/X- 1) $.

Public Member Functions


• PerformanceOption (Option::Type type, double underlying, double moneyness, const
std::vector< Spread > &dividendYield, const std::vector< Rate > &riskFreeRate, const
std::vector< Time > &times, const std::vector< double > &volatility)
• double value () const
• double delta () const
• double gamma () const
• double theta () const
• double vega () const
• double rho () const
• double dividendRho () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.322 Period Class Reference 509

9.322 Period Class Reference


#include <ql/date.hpp>

9.322.1 Detailed Description

Time period described by a number of a given time unit.

Public Member Functions


• Period (int n, TimeUnit units)
• int length () const
• TimeUnit units () const

Related Functions

(Note that these are not member functions.)

• bool operator< (const Period &, const Period &)


• bool operator== (const Period &, const Period &)
• bool operator!= (const Period &, const Period &)
• bool operator> (const Period &, const Period &)
• bool operator<= (const Period &, const Period &)
• bool operator>= (const Period &, const Period &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


510 QuantLib Class Documentation

9.323 PiecewiseConstantParameter Class Reference


#include <ql/ShortRateModels/parameter.hpp>
Inheritance diagram for PiecewiseConstantParameter:

Bridge< Parameter, ParameterImpl >

Parameter

PiecewiseConstantParameter

9.323.1 Detailed Description

Piecewise-constant parameter.
a(t) = ai i f ti−1 ≥ t < ti . This kind of parameter is usually used to enhance the fitting of a model

Public Member Functions


• PiecewiseConstantParameter (const std::vector< Time > &times)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.324 PiecewiseFlatForward Class Reference 511

9.324 PiecewiseFlatForward Class Reference


#include <ql/TermStructures/piecewiseflatforward.hpp>
Inheritance diagram for PiecewiseFlatForward:

Observable Observer

TermStructure LazyObject

PiecewiseFlatForward

9.324.1 Detailed Description

Piecewise flat forward term structure.


This term structure is bootstrapped on a number of interest rate instruments which are passed as
a vector of handles to RateHelper(p. 536) instances. Their maturities mark the boundaries of the
flat forward segments.
The values of the forward rates for each segment are determined sequentially starting from the
earliest period to the latest.
The value for each segment is chosen so that the instrument whose maturity marks the end of
such segment is correctly repriced on the curve.
Rates are assumed to be annual continuos compounding.

Warning:
The bootstrapping algorithm will raise an exception if any two instruments have the same
maturity date.

Public Member Functions


• PiecewiseFlatForward (const Date &todaysDate, const Date &referenceDate, const
std::vector< Handle< RateHelper > > &instruments, const DayCounter &dayCounter,
double accuracy=1.0e-12)
• PiecewiseFlatForward (const Date &todaysDate, const std::vector< Date > &dates, const
std::vector< Rate > &forwards, const DayCounter &dayCounter)

TermStructure interface

• DayCounter dayCounter () const


the day counter used for date/time conversion

• Date todaysDate () const


today’s date

• Date referenceDate () const


the reference date, i.e., the date at which discount = 1

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


512 QuantLib Class Documentation

• const std::vector< Date > & dates () const


• Date maxDate () const
the latest date for which the curve can return rates

• const std::vector< Time > & times () const


• Time maxTime () const
the latest time for which the curve can return rates

Protected Member Functions


• Rate zeroYieldImpl (Time, bool extrapolate=false) const
zero-yield calculation

• DiscountFactor discountImpl (Time, bool extrapolate=false) const


discount calculation

• Rate forwardImpl (Time, bool extrapolate=false) const


instantaneous forward-rate calculation

• Rate compoundForwardImpl (Time t, int compFreq, bool extrapolate) const


compound forward-rate calculation

Friends
• class FFObjFunction

9.324.2 Constructor & Destructor Documentation

9.324.2.1 PiecewiseFlatForward (const Date & todaysDate, const std::vector< Date > & dates,
const std::vector< Rate > & forwards, const DayCounter & dayCounter)

In this constructor, the first date must be the reference date of the curve, the other dates are
the nodes of the term structure. The forward rate at index i is used in the period ti−1 < t ≤ ti .
Therefore, forwards[0] is used only to compute the zero yield for t = 0.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.325 PlainVanillaPayoff Class Reference 513

9.325 PlainVanillaPayoff Class Reference


#include <ql/Instruments/payoffs.hpp>
Inheritance diagram for PlainVanillaPayoff:

Payoff

TypePayoff

StrikedTypePayoff

PlainVanillaPayoff

9.325.1 Detailed Description

Plain-vanilla payoff.

Public Member Functions


• PlainVanillaPayoff (Option::Type type, double strike)
• double operator() (double price) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


514 QuantLib Class Documentation

9.326 PoissonDistribution Class Reference


#include <ql/Math/poissondistribution.hpp>

9.326.1 Detailed Description

Normal distribution function.


formula here ... Given an integer k it returns its probability in a Poisson distribution.

Public Member Functions


• PoissonDistribution (double mu)
• double operator() (unsigned long k) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.327 PositiveConstraint Class Reference 515

9.327 PositiveConstraint Class Reference


#include <ql/Optimization/constraint.hpp>
Inheritance diagram for PositiveConstraint:

Bridge< Constraint, ConstraintImpl >

Constraint

PositiveConstraint

9.327.1 Detailed Description

Constraint imposing positivity to all arguments

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


516 QuantLib Class Documentation

9.328 PostconditionNotSatisfiedError Class Reference


#include <ql/errors.hpp>
Inheritance diagram for PostconditionNotSatisfiedError:

Error

PostconditionNotSatisfiedError

9.328.1 Detailed Description

Specialized error.
Thrown upon an unsatisfied postcondition.

Public Member Functions


• PostconditionNotSatisfiedError (const std::string &what="")

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.329 PreconditionNotSatisfiedError Class Reference 517

9.329 PreconditionNotSatisfiedError Class Reference


#include <ql/errors.hpp>
Inheritance diagram for PreconditionNotSatisfiedError:

Error

PreconditionNotSatisfiedError

9.329.1 Detailed Description

Specialized error.
Thrown upon an unsatisfied precondition.

Public Member Functions


• PreconditionNotSatisfiedError (const std::string &what="")

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


518 QuantLib Class Documentation

9.330 PricingEngine Class Reference


#include <ql/pricingengine.hpp>
Inheritance diagram for PricingEngine:

GenericEngine

GenericEngine< Arguments, Results >

GenericEngine< BarrierOption::arguments, BarrierOption::results >

GenericEngine< BasketOption::arguments, BasketOption::results >

GenericEngine< CapFloor::arguments, CapFloor::results >

Observable PricingEngine GenericEngine< CliquetOption::arguments, VanillaOption::results >

GenericEngine< DiscreteAveragingAsianOption::arguments, DiscreteAveragingAsianOption::results >

GenericEngine< ForwardOptionArguments< ArgumentsType >, ResultsType >

GenericEngine< QuantoOptionArguments< ArgumentsType >, QuantoOptionResults< ResultsType > >

GenericEngine< Swaption::arguments, Swaption::results >

GenericEngine< VanillaOption::arguments, VanillaOption::results >

9.330.1 Detailed Description

interface for pricing engines

Public Member Functions


• virtual Arguments ∗ arguments () const=0
• virtual const Results ∗ results () const=0
• virtual void reset () const=0
• virtual void calculate () const=0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.331 PrimeNumbers Class Reference 519

9.331 PrimeNumbers Class Reference


#include <ql/Math/primenumbers.hpp>

9.331.1 Detailed Description

Prime numbers calculator.


Taken from "Monte Carlo Methods in Finance", by Peter Jäckel

Static Public Member Functions


• unsigned long get (Size absoluteIndex)
Get and store one after another.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


520 QuantLib Class Documentation

9.332 Problem Class Reference


#include <ql/Optimization/problem.hpp>

9.332.1 Detailed Description

Constrained optimization problem.

Public Member Functions


• Problem (CostFunction &f, Constraint &c, OptimizationMethod &meth)
default constructor

• double value (const Array &x) const


call cost function computation and increment evaluation counter

• void gradient (Array &grad_f, const Array &x) const


call cost function gradient computation and increment

• double valueAndGradient (Array &grad_f, const Array &x) const


call cost function computation and it gradient

• OptimizationMethod & method () const


Constrained optimization method.

• Constraint & constraint () const


Constraint(p. 215).

• CostFunction & costFunction () const


Cost function.

• void minimize () const


Minimization.

• Array & minimumValue () const

Protected Attributes
• CostFunction & costFunction_
Unconstrained cost function.

• Constraint & constraint_


Constraint(p. 215).

• OptimizationMethod & method_


constrained optimization method

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.333 processing_iterator Class Template Reference 521

9.333 processing_iterator Class Template Reference


#include <ql/Utilities/processingiterator.hpp>

9.333.1 Detailed Description

template<class Iterator, class UnaryFunction> class QuantLib::processing_iterator< Iterator,


UnaryFunction >

Iterator mapping a unary function to an underlying sequence.


This iterator advances an underlying iterator and returns the values obtained by applying a unary
function to the values such iterator points to.
This class was implemented based on Christopher Baus and Thomas Becker, Custom Iterators
for the STL, included in the proceedings of the First Workshop on C++ Template Programming,
Erfurt, Germany, 2000 (http://www.oonumerics.org/tmpw00/)

Public Types
• typedef UnaryFunction::result_type value_type
• typedef const value_type ∗ pointer
• typedef const value_type & reference

Public Member Functions


• processing_iterator (const Iterator &, const UnaryFunction &)

Dereferencing

• reference operator ∗ () const


• pointer operator → () const

Random access

• value_type operator[ ] (int) const

Increment and decrement

• processing_iterator & operator++ ()


• processing_iterator operator++ (int)
• processing_iterator & operator– ()
• processing_iterator operator– (int)
• processing_iterator & operator+= (difference_type)
• processing_iterator & operator-= (difference_type)
• processing_iterator operator+ (difference_type)
• processing_iterator operator- (difference_type)

Difference

• difference_type operator- (const processing_iterator< Iterator, UnaryFunction > &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


522 QuantLib Class Documentation

Comparisons

• bool operator== (const processing_iterator< Iterator, UnaryFunction > &)


• bool operator!= (const processing_iterator< Iterator, UnaryFunction > &)
• bool operator< (const processing_iterator< Iterator, UnaryFunction > &)
• bool operator> (const processing_iterator< Iterator, UnaryFunction > &)
• bool operator<= (const processing_iterator< Iterator, UnaryFunction > &)
• bool operator>= (const processing_iterator< Iterator, UnaryFunction > &)

Public Attributes
• typedef< Iterator >::difference_type difference_type

Related Functions

(Note that these are not member functions.)

• processing_iterator< Iterator, UnaryFunction > make_processing_iterator (Iterator it,


UnaryFunction p)
helper function to create processing iterators

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.334 QuantoEngine Class Template Reference 523

9.334 QuantoEngine Class Template Reference


#include <ql/PricingEngines/Quanto/quantoengine.hpp>
Inheritance diagram for QuantoEngine:

Observable

PricingEngine

GenericEngine< QuantoOptionArguments< ArgumentsType >, QuantoOptionResults< ResultsType > >

QuantoEngine

9.334.1 Detailed Description

template<class ArgumentsType, class ResultsType> class QuantLib::QuantoEngine<


ArgumentsType, ResultsType >

Quanto engine base class.

Public Member Functions


• QuantoEngine (const Handle< GenericEngine< ArgumentsType, ResultsType > > &)
• void calculate () const

Protected Attributes
• Handle< GenericEngine< ArgumentsType, ResultsType > > originalEngine_
• ArgumentsType ∗ originalArguments_
• const ResultsType ∗ originalResults_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


524 QuantLib Class Documentation

9.335 QuantoForwardVanillaOption Class Reference

#include <ql/Instruments/quantoforwardvanillaoption.hpp>
Inheritance diagram for QuantoForwardVanillaOption:

Observable Observer

LazyObject

Instrument

Option

OneAssetOption

OneAssetStrikedOption

VanillaOption

QuantoVanillaOption

QuantoForwardVanillaOption

9.335.1 Detailed Description

Quanto version of a forward vanilla option.

Public Types

• typedef QuantoOptionArguments< ForwardVanillaOption::arguments > arguments


• typedef QuantoOptionResults< ForwardVanillaOption::arguments > results

Public Member Functions

• QuantoForwardVanillaOption (const RelinkableHandle< TermStructure > &foreign-


RiskFreeTS, const RelinkableHandle< BlackVolTermStructure > &exchRateVolTS, const
RelinkableHandle< Quote > &correlation, double moneyness, Date resetDate, const
Handle< BlackScholesStochasticProcess > &stochProc, const Handle< StrikedTypePayoff
> &payoff, const Handle< Exercise > &exercise, const Handle< PricingEngine > &engine)
• void setupArguments (Arguments ∗) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.335 QuantoForwardVanillaOption Class Reference 525

9.335.2 Member Function Documentation

9.335.2.1 void setupArguments (Arguments ∗) const [virtual]

When a derived argument structure is defined for an instrument, this method should be overrid-
den to fill it. This is mandatory in case a pricing engine is used.
Reimplemented from QuantoVanillaOption (p. 531).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


526 QuantLib Class Documentation

9.336 QuantoOptionArguments Class Template Reference


#include <ql/Instruments/quantovanillaoption.hpp>

9.336.1 Detailed Description

template<class ArgumentsType> class QuantLib::QuantoOptionArguments< ArgumentsType


>

Arguments for quanto option calculation

Public Member Functions


• void validate () const

Public Attributes
• double correlation
• RelinkableHandle< TermStructure > foreignRiskFreeTS
• RelinkableHandle< BlackVolTermStructure > exchRateVolTS

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.337 QuantoOptionResults Class Template Reference 527

9.337 QuantoOptionResults Class Template Reference


#include <ql/Instruments/quantovanillaoption.hpp>

9.337.1 Detailed Description

template<class ResultsType> class QuantLib::QuantoOptionResults< ResultsType >

Results from quanto option calculation

Public Member Functions


• void reset ()

Public Attributes
• double qvega
• double qrho
• double qlambda

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


528 QuantLib Class Documentation

9.338 QuantoTermStructure Class Reference


#include <ql/TermStructures/quantotermstructure.hpp>
Inheritance diagram for QuantoTermStructure:

Observable

TermStructure

ZeroYieldStructure Observer

QuantoTermStructure

9.338.1 Detailed Description

Quanto term structure.


Quanto term structure for modelling quanto effect in option pricing.

Note:
This term structure will remain linked to the original structures, i.e., any changes in the latters
will be reflected in this structure as well.

Public Member Functions


• QuantoTermStructure (const RelinkableHandle< TermStructure > &underlying-
DividendTS, const RelinkableHandle< TermStructure > &riskFreeTS, const Relinkable-
Handle< TermStructure > &foreignRiskFreeTS, const RelinkableHandle< BlackVolTerm-
Structure > &underlyingBlackVolTS, double strike, const RelinkableHandle< BlackVol-
TermStructure > &exchRateBlackVolTS, double exchRateATMlevel, double underlying-
ExchRateCorrelation)

TermStructure interface
• DayCounter dayCounter () const
the day counter used for date/time conversion

• Date todaysDate () const


today’s date

• Date referenceDate () const


the reference date, i.e., the date at which discount = 1

• Date maxDate () const


the latest date for which the curve can return rates

Observer interface
• void update ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.338 QuantoTermStructure Class Reference 529

Protected Member Functions


• Rate zeroYieldImpl (Time, bool extrapolate=false) const
returns the zero yield as seen from the evaluation date

9.338.2 Member Function Documentation

9.338.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


530 QuantLib Class Documentation

9.339 QuantoVanillaOption Class Reference

#include <ql/Instruments/quantovanillaoption.hpp>
Inheritance diagram for QuantoVanillaOption:

Observable Observer

LazyObject

Instrument

Option

OneAssetOption

OneAssetStrikedOption

VanillaOption

QuantoVanillaOption

QuantoForwardVanillaOption

9.339.1 Detailed Description

quanto version of a vanilla option

Public Types

• typedef QuantoOptionArguments< VanillaOption::arguments > arguments


• typedef QuantoOptionResults< VanillaOption::results > results

Public Member Functions

• QuantoVanillaOption (const RelinkableHandle< TermStructure > &foreignRiskFreeTS,


const RelinkableHandle< BlackVolTermStructure > &exchRateVolTS, const Relinkable-
Handle< Quote > &correlation, const Handle< BlackScholesStochasticProcess > &stoch-
Proc, const Handle< StrikedTypePayoff > &payoff, const Handle< Exercise > &exercise,
const Handle< PricingEngine > &engine)
• void setupArguments (Arguments ∗) const

greeks

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.339 QuantoVanillaOption Class Reference 531

• double qvega () const


• double qrho () const
• double qlambda () const

Protected Member Functions


• void setupExpired () const
• void performCalculations () const

Protected Attributes
• RelinkableHandle< TermStructure > foreignRiskFreeTS_
• RelinkableHandle< BlackVolTermStructure > exchRateVolTS_
• RelinkableHandle< Quote > correlation_
• double qvega_
• double qrho_
• double qlambda_

9.339.2 Member Function Documentation

9.339.2.1 void setupArguments (Arguments ∗) const [virtual]

When a derived argument structure is defined for an instrument, this method should be overrid-
den to fill it. This is mandatory in case a pricing engine is used.
Reimplemented from OneAssetStrikedOption (p. 482).
Reimplemented in QuantoForwardVanillaOption (p. 525).

9.339.2.2 void setupExpired () const [protected, virtual]

This method must leave the instrument in a consistent state when the expiration condition is met.
Reimplemented from OneAssetOption (p. 478).

9.339.2.3 void performCalculations () const [protected, virtual]

In case a pricing engine is not used, this method must be overridden to perform the actual calcu-
lations and set any needed results. In case a pricing engine is used, the default implementation
can be used.
Reimplemented from VanillaOption (p. 624).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


532 QuantLib Class Documentation

9.340 Quote Class Reference


#include <ql/marketelement.hpp>
Inheritance diagram for Quote:

Observable

Quote

CompositeQuote DerivedQuote SimpleQuote

9.340.1 Detailed Description

purely virtual base class for market observables

Public Member Functions


• virtual double value () const=0
returns the current value

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.341 RandomArrayGenerator Class Template Reference 533

9.341 RandomArrayGenerator Class Template Reference


#include <ql/RandomNumbers/randomarraygenerator.hpp>

9.341.1 Detailed Description

template<class RNG> class QuantLib::RandomArrayGenerator< RNG >

Generates random arrays using a random number generator.

Deprecated
use RandomSequenceGenerator(p. 534) instead.

Public Types
• typedef Sample< Array > sample_type

Public Member Functions


• RandomArrayGenerator (const Array &variance, long seed=0)
• RandomArrayGenerator (const Matrix &covariance, long seed=0)
• const sample_type & next () const
• int size () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


534 QuantLib Class Documentation

9.342 RandomSequenceGenerator Class Template Reference


#include <ql/RandomNumbers/randomsequencegenerator.hpp>

9.342.1 Detailed Description

template<class RNG> class QuantLib::RandomSequenceGenerator< RNG >

Random sequence generator based on a pseudo-random number generator.


Random sequence generator based on a pseudo-random number generator RNG.
Class RNG must implement the following interface:

RNG::sample_type RNG::next() const;

Warning:
do not use with low-discrepancy sequence generator

Public Types
• typedef Sample< Array > sample_type

Public Member Functions


• RandomSequenceGenerator (Size dimensionality, const RNG &rng)
• RandomSequenceGenerator (Size dimensionality, long seed=0)
• const sample_type & nextSequence () const
• std::vector< unsigned long > nextInt32Sequence () const
• const sample_type & lastSequence () const
• Size dimension () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.343 RateFormatter Class Reference 535

9.343 RateFormatter Class Reference


#include <ql/dataformatters.hpp>

9.343.1 Detailed Description

Formats rates for output.


Formatting is in percentage form (xx.xxxxx)

Static Public Member Functions


• std::string toString (double rate, int precision=5)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


536 QuantLib Class Documentation

9.344 RateHelper Class Reference

#include <ql/TermStructures/ratehelpers.hpp>
Inheritance diagram for RateHelper:

Observer Observable

RateHelper

DepositRateHelper FraRateHelper FuturesRateHelper SwapRateHelper

9.344.1 Detailed Description

Base class for rate helpers.


This class provides an abstraction for the instruments used to bootstrap a term structure. It is
advised that a rate helper for an instrument contains an instance of the actual instrument class
to ensure consistancy between the algorithms used during bootstrapping and later instrument
pricing. This is not yet fully enforced in the available rate helpers, though - only SwapRate-
Helper(p. 583) contains a Swap(p. 581) instrument for the time being.

Public Member Functions

• RateHelper (const RelinkableHandle< Quote > &quote)


• RateHelper (double quote)

RateHelper interface

• double quoteError () const


• double referenceQuote () const
• virtual double impliedQuote () const=0
• virtual DiscountFactor discountGuess () const
• virtual void setTermStructure (TermStructure ∗)
sets the term structure to be used for pricing

• virtual Date maturity () const=0


maturity date

Observer interface

• void update ()

Protected Attributes

• RelinkableHandle< Quote > quote_


• TermStructure ∗ termStructure_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.344 RateHelper Class Reference 537

9.344.2 Member Function Documentation

9.344.2.1 virtual void setTermStructure (TermStructure ∗) [virtual]

sets the term structure to be used for pricing

Warning:
Being a pointer and not a Handle(p. 339), the term structure is not guaranteed to remain
allocated for the whole life of the rate helper. It is responsibility of the programmer to ensure
that the pointer remains valid. It is advised that rate helpers be used only in term structure
constructors, setting the term structure to this, i.e., the one being constructed.

Reimplemented in DepositRateHelper (p. 243), FraRateHelper (p. 318), and SwapRateHelper


(p. 584).

9.344.2.2 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


538 QuantLib Class Documentation

9.345 RelinkableHandle Class Template Reference


#include <ql/relinkablehandle.hpp>
Inheritance diagram for RelinkableHandle:

Handle< Link< Type > >

RelinkableHandle

9.345.1 Detailed Description

template<class Type> class QuantLib::RelinkableHandle< Type >

Globally accessible relinkable pointer.


An instance of this class can be relinked to another Handle(p. 339): such change will be propagated
to all the copies of the instance.

Precondition:
Class "Type" must inherit from Observable(p. 471)

Public Member Functions


• RelinkableHandle (const Handle< Type > &h=Handle< Type >(), bool registerAs-
Observer=true)
• void linkTo (const Handle< Type > &h, bool registerAsObserver=true)
• const Handle< Type > & operator → () const
dereferencing

• bool isNull () const


Checks if the contained handle points to anything.

9.345.2 Constructor & Destructor Documentation

9.345.2.1 RelinkableHandle (const Handle< Type > & h = Handle< Type >(), bool
registerAsObserver = true) [explicit]

Warning:
see the documentation of Link(p. 404) for issues relatives to registerAsObserver.

9.345.3 Member Function Documentation

9.345.3.1 void linkTo (const Handle< Type > & h, bool registerAsObserver = true)

Warning:
see the documentation of Link(p. 404) for issues relatives to registerAsObserver.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.346 Results Class Reference 539

9.346 Results Class Reference


#include <ql/argsandresults.hpp>
Inheritance diagram for Results:

Results

MoreGreeks Greeks Value

results results results results results

9.346.1 Detailed Description

base class for generic result groups

Public Member Functions


• virtual void reset ()=0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


540 QuantLib Class Documentation

9.347 Ridder Class Reference


#include <ql/Solvers1D/ridder.hpp>
Inheritance diagram for Ridder:

CuriouslyRecurringTemplate< Ridder >

Solver1D< Ridder >

Ridder

9.347.1 Detailed Description

Ridder 1-D solver

Public Member Functions


• template<class F> double solveImpl (const F &f, double xAcc) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.348 SalvagingAlgorithm Struct Reference 541

9.348 SalvagingAlgorithm Struct Reference


#include <ql/Math/pseudosqrt.hpp>

9.348.1 Detailed Description

algorithm used for matricial pseudo square root

Public Types
• enum Type { None, Spectral, Hypersphere }

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


542 QuantLib Class Documentation

9.349 Sample Struct Template Reference


#include <ql/MonteCarlo/sample.hpp>

9.349.1 Detailed Description

template<class T> struct QuantLib::Sample< T >

weighted sample

Public Types
• typedef T value_type

Public Member Functions


• Sample (const T &value, double weight)

Public Attributes
• T value
• double weight

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.350 Schedule Class Reference 543

9.350 Schedule Class Reference


#include <ql/scheduler.hpp>

9.350.1 Detailed Description

Payment schedule.

Iterators
• typedef std::vector< Date >::const_iterator const_iterator
• const_iterator begin () const
• const_iterator end () const

Public Member Functions


• Schedule (const Calendar &calendar, const Date &startDate, const Date &endDate, int
frequency, RollingConvention rollingConvention, bool isAdjusted, const Date &stub-
Date=Date(), bool startFromEnd=false, bool longFinal=false)
• Schedule (const std::vector< Date > &, const Calendar &calendar, RollingConvention
rollingConvention, bool isAdjusted)

Date access

• Size size () const


• const Date & operator[ ] (Size i) const
• const Date & date (Size i) const
• bool isRegular (Size i) const

Other inspectors

• const Calendar & calendar () const


• const Date & startDate () const
• const Date & endDate () const
• Frequency frequency () const
• RollingConvention rollingConvention () const
• bool isAdjusted () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


544 QuantLib Class Documentation

9.351 Secant Class Reference


#include <ql/Solvers1D/secant.hpp>
Inheritance diagram for Secant:

CuriouslyRecurringTemplate< Secant >

Solver1D< Secant >

Secant

9.351.1 Detailed Description

Secant 1-D solver

Public Member Functions


• template<class F> double solveImpl (const F &f, double xAccuracy) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.352 SegmentIntegral Class Reference 545

9.352 SegmentIntegral Class Reference


#include <ql/Math/segmentintegral.hpp>

9.352.1 Detailed Description

Integral of a one-dimensional function.


Given a number N of intervals, the integral of a function f between a and b is calculated by means
of the trapezoid formula
Z b
1 1
f dx = f (x0 ) + f (x1 ) + f (x2 ) + . . . + f (xN−1 ) + f (xN )
a 2 2

where x0 = a, xN = b, and xi = a + i∆x with ∆x = (b − a)/N.

Public Member Functions


• SegmentIntegral (Size intervals)
• template<class F> double operator() (const F &f, double a, double b) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


546 QuantLib Class Documentation

9.353 SequenceStatistics Class Template Reference


#include <ql/Math/sequencestatistics.hpp>

9.353.1 Detailed Description

template<class StatisticsType = Statistics> class QuantLib::SequenceStatistics< StatisticsType


>

Statistics analysis of N-dimensional (sequence) data.


It provides 1-dimensional statistics as discrepancy plus N-dimensional (sequence) statistics (e.g.
mean, variance, skewness, kurtosis, etc.) with one component for each dimension of the sample
space.
For most of the statistics this class relies on the StatisticsType underlying class to provide 1-D
methods that will be iterated for all the components of the N-D data. These lifted methods are
the union of all the methods that might be requested to the 1-D underlying StatisticsType class,
with the usual compile-time checks provided by the template approach.

Public Types
• typedef StatisticsType statistics_type

Public Member Functions


• SequenceStatistics (Size dimension)

inspectors

• Size size () const

covariance and correlation

• Disposable< Matrix > covariance () const


returns the covariance Matrix(p. 418)

• Disposable< Matrix > correlation () const


returns the correlation Matrix(p. 418)

1-D inspectors lifted from underlying statistics class

• Size samples () const


• double weightSum () const

N-D inspectors lifted from underlying statistics class

• std::vector< double > mean () const


• std::vector< double > variance () const
• std::vector< double > standardDeviation () const
• std::vector< double > downsideVariance () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.353 SequenceStatistics Class Template Reference 547

• std::vector< double > downsideDeviation () const


• std::vector< double > semiVariance () const
• std::vector< double > semiDeviation () const
• std::vector< double > errorEstimate () const
• std::vector< double > skewness () const
• std::vector< double > kurtosis () const
• std::vector< double > min () const
• std::vector< double > max () const
• std::vector< double > gaussianPercentile (double y) const
• std::vector< double > percentile (double y) const
• std::vector< double > gaussianPotentialUpside (double percentile) const
• std::vector< double > potentialUpside (double percentile) const
• std::vector< double > gaussianValueAtRisk (double percentile) const
• std::vector< double > valueAtRisk (double percentile) const
• std::vector< double > gaussianExpectedShortfall (double percentile) const
• std::vector< double > expectedShortfall (double percentile) const
• std::vector< double > regret (double target) const
• std::vector< double > gaussianShortfall (double target) const
• std::vector< double > shortfall (double target) const
• std::vector< double > gaussianAverageShortfall (double target) const
• std::vector< double > averageShortfall (double target) const

Modifiers

• void reset (Size dimension=0)


• template<class Sequence> void add (const Sequence &sample, double weight=1.0)
• template<class Iterator> void add (Iterator begin, Iterator end, double weight=1.0)

Protected Attributes
• Size dimension_
• std::vector< statistics_type > stats_
• std::vector< double > results_
• Matrix quadraticSum_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


548 QuantLib Class Documentation

9.354 Short Class Template Reference


#include <ql/CashFlows/shortindexedcoupon.hpp>

9.354.1 Detailed Description

template<class IndexedCouponType> class QuantLib::Short< IndexedCouponType >

Short indexed coupon

Warning:
This class does not perform any date adjustment, i.e., the start and end date passed upon
construction should be already rolled to a business day.

Public Member Functions


• Short (double nominal, const Date &paymentDate, const Handle< Xibor > &index,
const Date &startDate, const Date &endDate, int fixingDays, Spread spread=0.0, const
Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date(), const DayCounter &day-
Counter=DayCounter())
• double amount () const
inhibit calculation

9.354.2 Member Function Documentation

9.354.2.1 double amount () const

inhibit calculation
Unlike ParCoupon(p. 499), this coupon can’t calculate its fixing for future dates, either.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.355 ShortFloatingRateCoupon Class Reference 549

9.355 ShortFloatingRateCoupon Class Reference


#include <ql/CashFlows/shortfloatingcoupon.hpp>
Inheritance diagram for ShortFloatingRateCoupon:

Observable

CashFlow

Coupon

FloatingRateCoupon Observer

ParCoupon

ShortFloatingRateCoupon

9.355.1 Detailed Description

Short coupon at par on a term structure

Warning:
This class does not perform any date adjustment, i.e., the start and end date passed upon
construction should be already rolled to a business day.

Public Member Functions


• ShortFloatingRateCoupon (double nominal, const Date &paymentDate, const Handle<
Xibor > &index, const Date &startDate, const Date &endDate, int fixingDays, Spread
spread=0.0, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date())
• double amount () const
throws when an interpolated fixing is needed

Visitability

• virtual void accept (AcyclicVisitor &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


550 QuantLib Class Documentation

9.356 ShortRateModel Class Reference


#include <ql/ShortRateModels/model.hpp>
Inheritance diagram for ShortRateModel:

Observer Observable

ShortRateModel

OneFactorModel TwoFactorModel

BlackKarasinski OneFactorAffineModel G2

CoxIngersollRoss Vasicek

ExtendedCoxIngersollRoss HullWhite

9.356.1 Detailed Description

Abstract short-rate model class.

Public Member Functions


• ShortRateModel (Size nArguments)
• void update ()
• virtual Handle< Lattice > tree (const TimeGrid &grid) const=0
• void calibrate (const std::vector< Handle< CalibrationHelper > > &instruments,
OptimizationMethod &method, const Constraint &constraint=Constraint())
Calibrate to a set of market instruments (caps/swaptions).

• const Handle< Constraint > & constraint () const


• Disposable< Array > params () const
Returns array of arguments on which calibration is done.

• void setParams (const Array &params)

Protected Member Functions


• virtual void generateArguments ()

Protected Attributes
• std::vector< Parameter > arguments_
• Handle< Constraint > constraint_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.356 ShortRateModel Class Reference 551

Friends
• class CalibrationFunction

9.356.2 Member Function Documentation

9.356.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

9.356.2.2 void calibrate (const std::vector< Handle< CalibrationHelper > > & instruments,
OptimizationMethod & method, const Constraint & constraint = Constraint())

Calibrate to a set of market instruments (caps/swaptions).


An additional constraint can be passed which must be satisfied in addition to the constraints of
the model.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


552 QuantLib Class Documentation

9.357 ShoutCondition Class Reference


#include <ql/FiniteDifferences/shoutcondition.hpp>
Inheritance diagram for ShoutCondition:

StandardStepCondition

ShoutCondition

9.357.1 Detailed Description

Shout option condition.


A shout option is an option where the holder has the right to lock in a minimum value for the
payoff at one (shout) time during the option’s life. The minimum value is the option’s intrinsic
value at the shout time.

Todo
Unify the intrinsicValues/Payoff thing

Public Member Functions


• ShoutCondition (Option::Type type, double strike, Time resTime, Rate rate)
• ShoutCondition (const Array &intrinsicValues, Time resTime, Rate rate)
• void applyTo (Array &a, Time t) const
• void applyTo (Handle< DiscretizedAsset > asset) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.358 SimpleCashFlow Class Reference 553

9.358 SimpleCashFlow Class Reference


#include <ql/CashFlows/simplecashflow.hpp>
Inheritance diagram for SimpleCashFlow:

Observable

CashFlow

SimpleCashFlow

9.358.1 Detailed Description

Predetermined cash flow.


This cash flow pays a predetermined amount at a given date.

Public Member Functions


• SimpleCashFlow (double amount, const Date &date)

CashFlow interface

• double amount () const


returns the amount of the cash flow

• Date date () const


returns the date at which the cash flow is settled

Visitability

• virtual void accept (AcyclicVisitor &)

9.358.2 Member Function Documentation

9.358.2.1 double amount () const [virtual]

returns the amount of the cash flow

Note:
The amount is not discounted, i.e., it is the actual amount paid at the cash flow date.

Implements CashFlow (p. 200).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


554 QuantLib Class Documentation

9.359 SimpleDayCounter Class Reference


#include <ql/DayCounters/simpledaycounter.hpp>
Inheritance diagram for SimpleDayCounter:

Bridge< DayCounter, DayCounterImpl >

DayCounter

SimpleDayCounter

9.359.1 Detailed Description

Simple day counter for reproducing theoretical calculations.


This day counter tries to ensure that whole-month distances are returned as a simple fraction, i.e.,
1 year = 1.0, 6 months = 0.5, 3 months = 0.25 and so forth.

Warning:
this day counter should be used together with NullCalendar(p. 468), which ensures that
dates at whole-month distances share the same day of month. It is not guaranteed to work
with any other calendar.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.360 SimpleQuote Class Reference 555

9.360 SimpleQuote Class Reference


#include <ql/marketelement.hpp>
Inheritance diagram for SimpleQuote:

Observable

Quote

SimpleQuote

9.360.1 Detailed Description

market element returning a stored value

Public Member Functions


• SimpleQuote (double value)

Quote interface

• double value () const


returns the current value

Modifiers

• void setValue (double value)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


556 QuantLib Class Documentation

9.361 SimpleSwap Class Reference

#include <ql/Instruments/simpleswap.hpp>
Inheritance diagram for SimpleSwap:

Observable Observer

LazyObject

Instrument

Swap

SimpleSwap

9.361.1 Detailed Description

Simple fixed-rate vs Libor swap.

Public Member Functions

• SimpleSwap (bool payFixedRate, const Date &startDate, int n, TimeUnit units, const Calen-
dar &calendar, RollingConvention rollingConvention, double nominal, int fixedFrequency,
Rate fixedRate, bool fixedIsAdjusted, const DayCounter &fixedDayCount, int floating-
Frequency, const Handle< Xibor > &index, int indexFixingDays, Spread spread, const
RelinkableHandle< TermStructure > &termStructure)
• SimpleSwap (bool payFixedRate, double nominal, const Schedule &fixedSchedule, Rate
fixedRate, const DayCounter &fixedDayCount, const Schedule &floatSchedule, const
Handle< Xibor > &index, int indexFixingDays, Spread spread, const RelinkableHandle<
TermStructure > &termStructure)
• Rate fairRate () const
• Spread fairSpread () const
• double fixedLegBPS () const
• double floatingLegBPS () const
• Rate fixedRate () const
• Spread spread () const
• double nominal () const
• bool payFixedRate () const
• const std::vector< Handle< CashFlow > > & fixedLeg () const
• const std::vector< Handle< CashFlow > > & floatingLeg () const
• void setupArguments (Arguments ∗args) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.361 SimpleSwap Class Reference 557

9.361.2 Member Function Documentation

9.361.2.1 void setupArguments (Arguments ∗ args) const [virtual]

When a derived argument structure is defined for an instrument, this method should be overrid-
den to fill it. This is mandatory in case a pricing engine is used.
Reimplemented from Instrument (p. 368).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


558 QuantLib Class Documentation

9.362 SimpleSwap::arguments Class Reference


#include <ql/Instruments/simpleswap.hpp>
Inheritance diagram for SimpleSwap::arguments:

Arguments

SimpleSwap::arguments

arguments

9.362.1 Detailed Description

Arguments for simple swap calculation

Public Member Functions


• void validate () const

Public Attributes
• bool payFixed
• double nominal
• std::vector< Time > fixedResetTimes
• std::vector< Time > fixedPayTimes
• std::vector< double > fixedCoupons
• std::vector< Time > floatingAccrualTimes
• std::vector< Time > floatingResetTimes
• std::vector< Time > floatingPayTimes
• std::vector< Spread > floatingSpreads

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.363 SimpleSwap::results Class Reference 559

9.363 SimpleSwap::results Class Reference


#include <ql/Instruments/simpleswap.hpp>
Inheritance diagram for SimpleSwap::results:

Results

Value

SimpleSwap::results

9.363.1 Detailed Description

Results from simple swap calculation

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


560 QuantLib Class Documentation

9.364 Simplex Class Reference


#include <ql/Optimization/simplex.hpp>
Inheritance diagram for Simplex:

OptimizationMethod

Simplex

9.364.1 Detailed Description

Multi-dimensional simplex class.

Public Member Functions


• Simplex (double lambda, double tol)
• virtual void minimize (const Problem &P) const
minimize the optimization problem P

9.364.2 Constructor & Destructor Documentation

9.364.2.1 Simplex (double lambda, double tol)

Constructor taking as input the characteristic length and tolerance

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.365 SimpsonIntegral Class Reference 561

9.365 SimpsonIntegral Class Reference


#include <ql/Math/simpsonintegral.hpp>
Inheritance diagram for SimpsonIntegral:

TrapezoidIntegral

SimpsonIntegral

9.365.1 Detailed Description

Integral of a one-dimensional function.

Public Member Functions


• SimpsonIntegral (double accuracy, Size maxIterations=Null< int >())
• template<class F> double operator() (const F &f, double a, double b) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


562 QuantLib Class Documentation

9.366 SingleAssetOption Class Reference


#include <ql/Pricers/singleassetoption.hpp>
Inheritance diagram for SingleAssetOption:

SingleAssetOption

DiscreteGeometricAPO DiscreteGeometricASO EuropeanOption FdBsmOption

9.366.1 Detailed Description

Black-Scholes-Merton option.

Public Member Functions


• SingleAssetOption (Option::Type type, double underlying, double strike, Spread dividend-
Yield, Rate riskFreeRate, Time residualTime, double volatility)
• virtual void setVolatility (double newVolatility)
• virtual void setRiskFreeRate (Rate newRate)
• virtual void setDividendYield (Rate newDividendYield)
• virtual double value () const=0
• virtual double delta () const=0
• virtual double gamma () const=0
• virtual double theta () const
• virtual double vega () const
• virtual double rho () const
• virtual double dividendRho () const
• double impliedVolatility (double targetValue, double accuracy=1e-4, Size max-
Evaluations=100, double minVol=QL_MIN_VOLATILITY, double maxVol=QL_MAX_-
VOLATILITY) const
• double impliedDivYield (double targetValue, double accuracy=1e-4, Size max-
Evaluations=100, double minVol=QL_MIN_DIVYIELD, double maxVol=QL_MAX_-
DIVYIELD) const
• virtual Handle< SingleAssetOption > clone () const=0

Protected Attributes
• double underlying_
• PlainVanillaPayoff payoff_
• Spread dividendYield_
• Rate riskFreeRate_
• Time residualTime_
• double volatility_
• bool hasBeenCalculated_
• double rho_
• double dividendRho_
• double vega_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.366 SingleAssetOption Class Reference 563

• double theta_
• bool rhoComputed_
• bool dividendRhoComputed_
• bool vegaComputed_
• bool thetaComputed_

Static Protected Attributes


• const double dVolMultiplier_
• const double dRMultiplier_

Friends
• class VolatilityFunction
• class DivYieldFunction

9.366.2 Member Function Documentation

9.366.2.1 double impliedVolatility (double targetValue, double accuracy = 1e-4, Size


maxEvaluations = 100, double minVol = QL_MIN_VOLATILITY, double maxVol =
QL_MAX_VOLATILITY) const

Warning:
Options with a gamma that changes sign have values that are not monotonic in the volatility,
e.g binary options. In these cases impliedVolatility can fail and in any case is meaningless.
Another possible source of failure is to have a targetValue that is not attainable with any
volatility, e.g. a targetValue lower than the intrinsic value in the case of American options.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


564 QuantLib Class Documentation

9.367 SobolRsg Class Reference


#include <ql/RandomNumbers/sobolrsg.hpp>

9.367.1 Detailed Description

Sobol low-discrepancy sequence generator.


A Gray code counter and bitwise operations are used for very fast sequence generation.
The implementation relies on primitive polynomials modulo two and initialization numbers from
the book "Monte Carlo Methods in Finance" by Peter Jäckel.
21200 primitive polynomials modulo two are provided by default. There are 8 129 334 polynomials
as provided by Jäckel which can be downloaded from quantlib.org. If you need that many
dimensions you must replace the primitivepolynomial.∗ files with the ones downloaded and
recompile the library.
The choice of initialization numbers is crucial for the homogeneity properties of the sequence.
Jäckel’s initialization numbers are superior to the "unit initialization" suggested in "Numerical
Recipes in C" by Press, Teukolsky, Vetterling, and Flannery.
For more info on Sobol sequences see "Monte Carlo Methods in Finance", by Peter Jäckel, section
8.3 and "Numerical Recipes in C", 2nd edition, by Press, Teukolsky, Vetterling, and Flannery,
section 7.7.

Public Types
• typedef Sample< Array > sample_type

Public Member Functions


• SobolRsg (Size dimensionality, unsigned long seed=0, bool unitInitialization=false)
• const sample_type & nextSequence () const
• const sample_type & lastSequence () const
• Size dimension () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.368 Solver1D Class Template Reference 565

9.368 Solver1D Class Template Reference


#include <ql/solver1d.hpp>
Inheritance diagram for Solver1D:

CuriouslyRecurringTemplate<Impl>

Solver1D

9.368.1 Detailed Description

template<class Impl> class QuantLib::Solver1D< Impl >

Base class for 1-D solvers.


The implementation of this class uses the so-called "Barton-Nackman trick", also known as "the
curiously recurring template pattern". Concrete solvers will be declared as:

class Foo : public Solver1D<Foo> {


public:
...
template <class F>
double solveImpl(const F& f, double accuracy) const {
...
}
};

Before calling solveImpl, the base class will set its protected data members so that:

• xMin_ and xMax_ form a valid bracket;

• fxMin_ and fxMax_ contain the values of the function in xMin_ and xMax_;

• root_ is a valid initial guess. The implementation of solveImpl can safely assume all of the
above.

Todo
a) Clean up the interface so that it is clear whether the accuracy is specified for x or f(x). b)
Add target value (now the target value is 0.0)

Public Member Functions


Modifiers

• template<class F> double solve (const F &f, double accuracy, double guess, double step)
const
• template<class F> double solve (const F &f, double accuracy, double guess, double xMin,
double xMax) const
• void setMaxEvaluations (Size evaluations)
• void setLowerBound (double lowerBound)
sets the lower bound for the function domain

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


566 QuantLib Class Documentation

• void setUpperBound (double upperBound)


sets the upper bound for the function domain

Protected Attributes
• double root_
• double xMin_
• double xMax_
• double fxMin_
• double fxMax_
• Size maxEvaluations_
• Size evaluationNumber_

9.368.2 Member Function Documentation

9.368.2.1 double solve (const F & f, double accuracy, double guess, double step) const

This method returns the zero of the function f , determined with the given accuracy (i.e., x is
considered a zero if | f (x)| < accuracy). This method contains a bracketing routine to which an
initial guess must be supplied as well as a step used to scan the range of the possible bracketing
values.

9.368.2.2 double solve (const F & f, double accuracy, double guess, double xMin, double
xMax) const

This method returns the zero of the function f , determined with the given accuracy (i.e., x is
considered a zero if | f (x)| < accuracy). An initial guess must be supplied, as well as two values
xmin and xmax which must bracket the zero (i.e., either f (xmin ) ≤ 0 ≤ f (xmax ), or f (xmax ) ≤ 0 ≤ f (xmin )
must be true).

9.368.2.3 void setMaxEvaluations (Size evaluations)

This method sets the maximum number of function evaluations for the bracketing routine. An
error is thrown if a bracket is not found after this number of evaluations.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.369 SquareRootProcess Class Reference 567

9.369 SquareRootProcess Class Reference


#include <ql/diffusionprocess.hpp>
Inheritance diagram for SquareRootProcess:

DiffusionProcess

SquareRootProcess

9.369.1 Detailed Description

Square-root process class.


This class describes a square-root process governed by

dx = a(b − xt )dt + σ xt dWt .

Public Member Functions


• SquareRootProcess (double b, double a, double sigma, double x0=0)
• double drift (Time t, double x) const
returns the drift part of the equation, i.e. µ(t, xt )

• double diffusion (Time t, double x) const

9.369.2 Member Function Documentation

9.369.2.1 double diffusion (Time t, double x) const [virtual]

returns the diffusion part of the equation, i.e. σ(t, xt )


Implements DiffusionProcess (p. 246).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


568 QuantLib Class Documentation

9.370 StatsHolder Class Reference


#include <ql/Math/gaussianstatistics.hpp>

9.370.1 Detailed Description

Helper class for precomputed distributions.

Public Member Functions


• StatsHolder (double mean, double standardDeviation)
• double mean () const
• double standardDeviation () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.371 SteepestDescent Class Reference 569

9.371 SteepestDescent Class Reference


#include <ql/Optimization/steepestdescent.hpp>
Inheritance diagram for SteepestDescent:

OptimizationMethod

SteepestDescent

9.371.1 Detailed Description

Multi-dimensional steepest-descent class.


User has to provide line-search method and optimization end criteria
search direction = − f 0 (x)

Public Member Functions


• SteepestDescent ()
default default constructor (msvc bug)

• SteepestDescent (const Handle< LineSearch > &lineSearch)


default constructor

• virtual ∼SteepestDescent ()
destructor

• virtual void minimize (const Problem &P) const


minimize the optimization problem P

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


570 QuantLib Class Documentation

9.372 StepCondition Class Template Reference


#include <ql/FiniteDifferences/stepcondition.hpp>
Inheritance diagram for StepCondition:

StepCondition

AmericanCondition ShoutCondition

9.372.1 Detailed Description

template<class arrayType> class QuantLib::StepCondition< arrayType >

condition to be applied at every time step

Public Member Functions


• virtual void applyTo (arrayType &a, Time t) const=0
• virtual void applyTo (Handle< DiscretizedAsset > asset) const=0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.373 stepping_iterator Class Template Reference 571

9.373 stepping_iterator Class Template Reference

#include <ql/Utilities/steppingiterator.hpp>

9.373.1 Detailed Description

template<class RandomAccessIterator> class QuantLib::stepping_iterator< RandomAccess-


Iterator >

Iterator advancing in constant steps.


This iterator advances an underlying random access iterator in steps of n positions, where n is an
integer given upon construction.

Public Member Functions

• stepping_iterator (const RandomAccessIterator &it, difference_type step)

Dereferencing

• reference operator ∗ () const


• pointer operator → () const

Random access

• reference operator[ ] (int i) const

Increment and decrement

• stepping_iterator & operator++ ()


• stepping_iterator operator++ (int)
• stepping_iterator & operator– ()
• stepping_iterator operator– (int)
• stepping_iterator & operator+= (difference_type i)
• stepping_iterator & operator-= (difference_type i)
• stepping_iterator operator+ (difference_type i)
• stepping_iterator operator- (difference_type i)

Difference

• difference_type operator- (const stepping_iterator &i)

Comparisons

• bool operator== (const stepping_iterator &i)


• bool operator!= (const stepping_iterator &i)
• bool operator< (const stepping_iterator &i)
• bool operator> (const stepping_iterator &i)
• bool operator<= (const stepping_iterator &i)
• bool operator>= (const stepping_iterator &i)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


572 QuantLib Class Documentation

Public Attributes
• typedef< RandomAccessIterator >::difference_type difference_type
• typedef< RandomAccessIterator >::pointer pointer
• typedef< RandomAccessIterator >::reference reference

Related Functions

(Note that these are not member functions.)

• stepping_iterator< Iterator > make_stepping_iterator (Iterator it, typename stepping_-


iterator< Iterator >::difference_type step)
helper function to create stepping iterators

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.374 StochasticProcess Class Reference 573

9.374 StochasticProcess Class Reference


#include <ql/stochasticprocess.hpp>
Inheritance diagram for StochasticProcess:

Observer Observable

StochasticProcess

9.374.1 Detailed Description

Base stochastic process class.


Just an arguments placeholder for the time being. To be merged/refactored with Diffusion-
Process(p. 246)

Public Member Functions


• void update ()

9.374.2 Member Function Documentation

9.374.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


574 QuantLib Class Documentation

9.375 Stock Class Reference


#include <ql/Instruments/stock.hpp>
Inheritance diagram for Stock:

Observable Observer

LazyObject

Instrument

Stock

9.375.1 Detailed Description

Simple stock class.

Public Member Functions


• Stock (const RelinkableHandle< Quote > &quote)
• bool isExpired () const
returns whether the instrument is still tradable.

Protected Member Functions


• void performCalculations () const

9.375.2 Member Function Documentation

9.375.2.1 void performCalculations () const [protected, virtual]

In case a pricing engine is not used, this method must be overridden to perform the actual calcu-
lations and set any needed results. In case a pricing engine is used, the default implementation
can be used.
Reimplemented from Instrument (p. 369).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.376 Stockholm Class Reference 575

9.376 Stockholm Class Reference


#include <ql/Calendars/stockholm.hpp>
Inheritance diagram for Stockholm:

Bridge< Calendar, CalendarImpl >

Calendar

Stockholm

9.376.1 Detailed Description

Stockholm calendar
Holidays:

• Saturdays
• Sundays
• Good Friday
• Easter Monday
• Ascension
• Whit(Pentecost) Monday
• Midsummer Eve (Friday between June 18-24)
• New Year’s Day, January 1st
• Epiphany, January 6th
• May Day, May 1st
• National Day, June 6th
• Christmas Eve, December 24th
• Christmas Day, December 25th

• Boxing Day, December 26th


• New Year’s Eve, December 31th

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


576 QuantLib Class Documentation

9.377 StrikedTypePayoff Class Reference


#include <ql/Instruments/payoffs.hpp>
Inheritance diagram for StrikedTypePayoff:

AssetOrNothingPayoff

CashOrNothingPayoff

GapPayoff
TypePayoff StrikedTypePayoff
PercentageStrikePayoff

PlainVanillaPayoff

SuperSharePayoff

9.377.1 Detailed Description

Intermediate class for payoffs based on a fixed strike.

Public Member Functions


• StrikedTypePayoff (Option::Type type, double strike)
• double strike () const
• void setStrike (double strike)

Protected Attributes
• double strike_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.378 StringFormatter Class Reference 577

9.378 StringFormatter Class Reference


#include <ql/dataformatters.hpp>

9.378.1 Detailed Description

Formats strings as lower- or uppercase.

Static Public Member Functions


• std::string toLowercase (const std::string &s)
• std::string toUppercase (const std::string &s)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


578 QuantLib Class Documentation

9.379 StulzEngine Class Reference


#include <ql/PricingEngines/Basket/stulzengine.hpp>
Inheritance diagram for StulzEngine:

Observable

PricingEngine

GenericEngine< BasketOption::arguments, BasketOption::results >

BasketEngine

StulzEngine

9.379.1 Detailed Description

Pricing engine for 2D European Baskets.


This class implements formulae from "Options on the Minimum or the Maximum of Two Risky
Assets", Rene Stulz, Journal of Financial Ecomomics (1982) 10, 161-185.

Public Member Functions


• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.380 SuperSharePayoff Class Reference 579

9.380 SuperSharePayoff Class Reference


#include <ql/Instruments/payoffs.hpp>
Inheritance diagram for SuperSharePayoff:

Payoff

TypePayoff

StrikedTypePayoff

SuperSharePayoff

9.380.1 Detailed Description

Binary supershare payoff.

Public Member Functions


• SuperSharePayoff (Option::Type type, double strike, double strikeIncrement)
• double operator() (double price) const
• double strikeIncrement () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


580 QuantLib Class Documentation

9.381 SVD Class Reference


#include <ql/Math/svd.hpp>

9.381.1 Detailed Description

Singular value decomposition.


Refer to Golub and Van Loan: Matrix(p. 418) computation, The Johns Hopkins University Press

Public Member Functions


• SVD (const Matrix &)
• const Matrix & U () const
• const Matrix & V () const
• const Array & singularValues () const
• Disposable< Matrix > S () const
• double norm2 ()
• double cond ()
• int rank ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.382 Swap Class Reference 581

9.382 Swap Class Reference

#include <ql/Instruments/swap.hpp>
Inheritance diagram for Swap:

Observable Observer

LazyObject

Instrument

Swap

SimpleSwap

9.382.1 Detailed Description

Interest rate swap.


The cash flows belonging to the first leg are payed; the ones belonging to the first leg are received.

Public Member Functions

• Swap (const std::vector< Handle< CashFlow > > &firstLeg, const std::vector< Handle<
CashFlow > > &secondLeg, const RelinkableHandle< TermStructure > &termStructure)

Instrument interface

• bool isExpired () const


returns whether the instrument is still tradable.

Additional interface

• Date startDate () const


• Date maturity () const
• double firstLegBPS () const
• double secondLegBPS () const
• TimeBasket sensitivity (int basis=2) const

Protected Member Functions

• void setupExpired () const


• void performCalculations () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


582 QuantLib Class Documentation

Protected Attributes
• std::vector< Handle< CashFlow > > firstLeg_
• std::vector< Handle< CashFlow > > secondLeg_
• RelinkableHandle< TermStructure > termStructure_
• double firstLegBPS_
• double secondLegBPS_

9.382.2 Member Function Documentation

9.382.2.1 TimeBasket sensitivity (int basis = 2) const

Bug
This method must still be checked. It is not guaranteed to yield the right results.

9.382.2.2 void setupExpired () const [protected, virtual]

This method must leave the instrument in a consistent state when the expiration condition is met.
Reimplemented from Instrument (p. 369).

9.382.2.3 void performCalculations () const [protected, virtual]

In case a pricing engine is not used, this method must be overridden to perform the actual calcu-
lations and set any needed results. In case a pricing engine is used, the default implementation
can be used.
Reimplemented from Instrument (p. 369).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.383 SwapRateHelper Class Reference 583

9.383 SwapRateHelper Class Reference


#include <ql/TermStructures/ratehelpers.hpp>
Inheritance diagram for SwapRateHelper:

Observer Observable

RateHelper

SwapRateHelper

9.383.1 Detailed Description

Swap rate

Warning:
This class assumes that the settlement date does not change between calls of setTerm-
Structure()(p. 584).

Public Member Functions


• SwapRateHelper (const RelinkableHandle< Quote > &rate, int n, TimeUnit units, int
settlementDays, const Calendar &calendar, RollingConvention convention, int fixed-
Frequency, bool fixedIsAdjusted, const DayCounter &fixedDayCount, int floating-
Frequency)
• SwapRateHelper (double rate, int n, TimeUnit units, int settlementDays, const Calendar
&calendar, RollingConvention convention, int fixedFrequency, bool fixedIsAdjusted, const
DayCounter &fixedDayCount, int floatingFrequency)
• double impliedQuote () const
• Date maturity () const
maturity date

• void setTermStructure (TermStructure ∗)


sets the term structure to be used for pricing

Protected Attributes
• int n_
• TimeUnit units_
• int settlementDays_
• Calendar calendar_
• RollingConvention convention_
• int fixedFrequency_
• int floatingFrequency_
• bool fixedIsAdjusted_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


584 QuantLib Class Documentation

• DayCounter fixedDayCount_
• Date settlement_
• Handle< SimpleSwap > swap_
• RelinkableHandle< TermStructure > termStructureHandle_

9.383.2 Member Function Documentation

9.383.2.1 void setTermStructure (TermStructure ∗) [virtual]

sets the term structure to be used for pricing

Warning:
Being a pointer and not a Handle(p. 339), the term structure is not guaranteed to remain
allocated for the whole life of the rate helper. It is responsibility of the programmer to ensure
that the pointer remains valid. It is advised that rate helpers be used only in term structure
constructors, setting the term structure to this, i.e., the one being constructed.

Reimplemented from RateHelper (p. 537).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.384 Swaption Class Reference 585

9.384 Swaption Class Reference

#include <ql/Instruments/swaption.hpp>
Inheritance diagram for Swaption:

Observable Observer

LazyObject

Instrument

Option

Swaption

9.384.1 Detailed Description

Swaption class

Public Member Functions

• Swaption (const Handle< SimpleSwap > &swap, const Handle< Exercise > &exercise,
const RelinkableHandle< TermStructure > &termStructure, const Handle< PricingEngine
> &engine)
• bool isExpired () const
returns whether the instrument is still tradable.

• void setupArguments (Arguments ∗) const

Protected Member Functions

• void performCalculations () const

9.384.2 Member Function Documentation

9.384.2.1 void setupArguments (Arguments ∗) const [virtual]

When a derived argument structure is defined for an instrument, this method should be overrid-
den to fill it. This is mandatory in case a pricing engine is used.
Reimplemented from Instrument (p. 368).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


586 QuantLib Class Documentation

9.384.2.2 void performCalculations () const [protected, virtual]

In case a pricing engine is not used, this method must be overridden to perform the actual calcu-
lations and set any needed results. In case a pricing engine is used, the default implementation
can be used.
Reimplemented from Instrument (p. 369).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.385 Swaption::arguments Class Reference 587

9.385 Swaption::arguments Class Reference


#include <ql/Instruments/swaption.hpp>
Inheritance diagram for Swaption::arguments:

Arguments

arguments arguments

Swaption::arguments

9.385.1 Detailed Description

Arguments for swaption calculation

Public Member Functions


• void validate () const

Public Attributes
• Rate fairRate
• Rate fixedRate
• double fixedBPS

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


588 QuantLib Class Documentation

9.386 Swaption::results Class Reference


#include <ql/Instruments/swaption.hpp>
Inheritance diagram for Swaption::results:

Results

Value

Swaption::results

9.386.1 Detailed Description

Results from swaption calculation

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.387 SwaptionVolatilityMatrix Class Reference 589

9.387 SwaptionVolatilityMatrix Class Reference


#include <ql/Volatilities/swaptionvolmatrix.hpp>
Inheritance diagram for SwaptionVolatilityMatrix:

Observable

SwaptionVolatilityStructure

SwaptionVolatilityMatrix

9.387.1 Detailed Description

At-the-money swaption-volatility matrix.


This class provides the at-the-money volatility for a given swaption by interpolating a volatility
matrix whose elements are the market volatilities of a set of swaption with given exercise date
and length.

Todo
Either add correct copy behavior or inhibit copy. Right now, a copied instance would end up
with its own copy of the exercise date and length vector but an interpolation pointing to the
original ones.

Public Member Functions


• SwaptionVolatilityMatrix (const Date &todaysDate, const std::vector< Date > &exercise-
Dates, const std::vector< Period > &lengths, const Matrix &volatilities, const DayCounter
&dayCounter=Thirty360())
• Date todaysDate () const
returns today’s date

• DayCounter dayCounter () const


returns the day counter used for internal date/time conversions

• const std::vector< Date > & exerciseDates () const


• const std::vector< Period > & lengths () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


590 QuantLib Class Documentation

9.388 SwaptionVolatilityStructure Class Reference


#include <ql/swaptionvolstructure.hpp>
Inheritance diagram for SwaptionVolatilityStructure:

Observable

SwaptionVolatilityStructure

SwaptionVolatilityMatrix

9.388.1 Detailed Description

Swaption-volatility structure
This class is purely abstract and defines the interface of concrete swaption volatility structures
which will be derived from this one.

Public Member Functions


• virtual Date todaysDate () const=0
returns today’s date

• virtual DayCounter dayCounter () const=0


returns the day counter used for internal date/time conversions

• double volatility (const Date &start, const Period &length, Rate strike) const
returns the volatility for a given starting date and length

• double volatility (Time start, Time length, Rate strike) const


returns the volatility for a given starting time and length

Protected Member Functions


• virtual double volatilityImpl (Time start, Time length, Rate strike) const=0
implements the actual volatility calculation in derived classes

• virtual std::pair< Time, Time > convertDates (const Date &start, const Period &length)
const
implements the conversion between dates and times

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.389 Sydney Class Reference 591

9.389 Sydney Class Reference


#include <ql/Calendars/sydney.hpp>
Inheritance diagram for Sydney:

Bridge< Calendar, CalendarImpl >

Calendar

Sydney

9.389.1 Detailed Description

Sydney calendar (New South Wales, Australia)


Holidays:

• Saturdays
• Sundays
• New Year’s Day, January 1st
• Australia Day, January 26th (possibly moved to Monday)
• Good Friday
• Easter Monday
• ANZAC Day. April 25th (possibly moved to Monday)
• Queen’s Birthday, second Monday in June
• Bank Holiday, first Monday in August
• Labour Day, first Monday in October
• Christmas, December 25th (possibly moved to Monday or Tuesday)
• Boxing Day, December 26th (possibly moved to Monday or Tuesday)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


592 QuantLib Class Documentation

9.390 SymmetricSchurDecomposition Class Reference


#include <ql/Math/symmetricschurdecomposition.hpp>

9.390.1 Detailed Description

symmetric threshold Jacobi algorithm.


Given a real symmetric matrix S, the Schur decomposition finds the eigenvalues and eigenvectors
of S. If D is the diagonal matrix formed by the eigenvalues and U the unitarian matrix of the
eigenvectors we can write the Schur decomposition as

S = U · D · UT ,

where · is the standard matrix product and T is the transpose operator. This class implements the
Schur decomposition using the symmetric threshold Jacobi algorithm. For details on the different
Jacobi transfomations see "Matrix computation," second edition, by Golub and Van Loan, The
Johns Hopkins University Press

Public Member Functions


• SymmetricSchurDecomposition (const Matrix &s)
• const Array & eigenvalues () const
• const Matrix & eigenvectors () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.391 TARGET Class Reference 593

9.391 TARGET Class Reference


#include <ql/Calendars/target.hpp>
Inheritance diagram for TARGET:

Bridge< Calendar, CalendarImpl >

Calendar

TARGET

9.391.1 Detailed Description

TARGET calendar
Holidays:

• Saturdays
• Sundays
• New Year’s Day, January 1st
• Good Friday (since 2000)
• Easter Monday (since 2000)
• Labour Day, May 1st (since 2000)
• Christmas, December 25th
• Day of Goodwill, December 26th (since 2000)
• December 31st (1998, 1999, and 2001)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


594 QuantLib Class Documentation

9.392 TermStructure Class Reference


#include <ql/termstructure.hpp>
Inheritance diagram for TermStructure:

Observable

TermStructure

DiscountStructure ForwardRateStructure PiecewiseFlatForward ZeroYieldStructure

9.392.1 Detailed Description

Interest-rate term structure.


This abstract class defines the interface of concrete rate structures which will be derived from this
one.
Rates are assumed to be annual continuos compounding.

Todo
add derived class ParSwapTermStructure similar to ZeroYieldTermStructure, Discount-
Structure(p. 251), ForwardRateStructure(p. 311)
allow for different compounding rules and compounding frequencies

Public Member Functions


Rates and discount
These methods are either function of dates or times. In the latter case, times are calculated as fraction
of year from the reference date.

• Rate zeroYield (const Date &, bool extrapolate=false) const


zero-yield rate

• Rate zeroYield (Time, bool extrapolate=false) const


zero-yield rate

• DiscountFactor discount (const Date &, bool extrapolate=false) const


discount factor

• DiscountFactor discount (Time, bool extrapolate=false) const


discount factor

• Rate instantaneousForward (const Date &, bool extrapolate=false) const


instantaneous forward rate

• Rate instantaneousForward (Time, bool extrapolate=false) const


instantaneous forward rate

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.392 TermStructure Class Reference 595

• Rate compoundForward (const Date &, int, bool extrapolate=false) const


instantaneous forward rate at a given compounding frequency

• Rate compoundForward (Time, int, bool extrapolate=false) const


instantaneous forward rate at a given compounding frequency

• Rate forward (const Date &, const Date &, bool extrapolate=false) const
discrete forward rate between two dates

• Rate forward (Time, Time, bool extrapolate=false) const


discrete forward rate between two times

• Rate zeroCoupon (const Date &, int, bool extrapolate=false) const


zero-coupon rate

• Rate zeroCoupon (Time, int, bool extrapolate=false) const


zero-coupon rate

Dates

• virtual Date todaysDate () const=0


today’s date

• virtual Date referenceDate () const=0


the reference date, i.e., the date at which discount = 1

• virtual DayCounter dayCounter () const=0


the day counter used for date/time conversion

• virtual Date maxDate () const=0


the latest date for which the curve can return rates

• virtual Time maxTime () const


the latest time for which the curve can return rates

Protected Member Functions


Calculations
These methods must be implemented in derived classes to perform the actual discount and rate calcula-
tions
• virtual Rate zeroYieldImpl (Time, bool extrapolate=false) const=0
zero-yield calculation

• virtual DiscountFactor discountImpl (Time, bool extrapolate=false) const=0


discount calculation

• virtual Rate forwardImpl (Time, bool extrapolate=false) const=0


instantaneous forward-rate calculation

• virtual Rate compoundForwardImpl (Time, int, bool extrapolate=false) const=0


compound forward-rate calculation

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


596 QuantLib Class Documentation

9.393 TermStructureConsistentModel Class Reference


#include <ql/ShortRateModels/model.hpp>
Inheritance diagram for TermStructureConsistentModel:

Observable

TermStructureConsistentModel

BlackKarasinski ExtendedCoxIngersollRoss G2 HullWhite

9.393.1 Detailed Description

Term-structure consistent model class.


This is a base class for models that can reprice exactly any discount bond.

Public Member Functions


• TermStructureConsistentModel (const RelinkableHandle< TermStructure > &term-
Structure)
• const RelinkableHandle< TermStructure > & termStructure () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.394 TermStructureFittingParameter Class Reference 597

9.394 TermStructureFittingParameter Class Reference


#include <ql/ShortRateModels/parameter.hpp>
Inheritance diagram for TermStructureFittingParameter:

Bridge< Parameter, ParameterImpl >

Parameter

TermStructureFittingParameter

FittingParameter FittingParameter FittingParameter

9.394.1 Detailed Description

Deterministic time-dependent parameter used for yield-curve fitting.

Public Member Functions


• TermStructureFittingParameter (const Handle< Parameter::Impl > &impl)
• TermStructureFittingParameter (const RelinkableHandle< TermStructure > &term)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


598 QuantLib Class Documentation

9.395 Thirty360 Class Reference


#include <ql/DayCounters/thirty360.hpp>
Inheritance diagram for Thirty360:

Bridge< DayCounter, DayCounterImpl >

DayCounter

Thirty360

9.395.1 Detailed Description

30/360 day count convention


The day count can be calculated according to US, European, or Italian conventions.
US (NASD) convention: if the starting date is the 31st of a month, it becomes equal to the 30th
of the same month. If the ending date is the 31st of a month and the starting date is earlier than
the 30th of a month, the ending date becomes equal to the 1st of the next month, otherwise the
ending date becomes equal to the 30th of the same month.
European convention: starting dates or ending dates that occur on the 31st of a month become
equal to the 30th of the same month.
Italian convention: starting dates or ending dates that occur on February and are grater than 27
become equal to 30 for computational sake.

Public Types
• enum Convention { USA, European, Italian }

Public Member Functions


• Thirty360 (Convention c=Thirty360::USA)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.396 Tian Class Reference 599

9.396 Tian Class Reference


#include <ql/Lattices/binomialtree.hpp>
Inheritance diagram for Tian:

Tree

BinomialTree

Tian

9.396.1 Detailed Description

Tian tree: third moment matching, multiplicative approach

Public Member Functions


• Tian (const Handle< DiffusionProcess > &process, Time end, Size steps, double strike)
• double underlying (Size i, Size index) const
• double probability (Size, Size, Size) const

Protected Attributes
• double up_
• double down_
• double pu_
• double pd_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


600 QuantLib Class Documentation

9.397 TimeBasket Class Reference


#include <ql/CashFlows/timebasket.hpp>

9.397.1 Detailed Description

Distribution over a number of dates.

Map interface
• typedef super::iterator iterator
• typedef super::const_iterator const_iterator
• typedef super::reverse_iterator reverse_iterator
• typedef super::const_reverse_iterator const_reverse_iterator
• bool hasDate (const Date &) const
membership

Public Member Functions


• TimeBasket (const std::vector< Date > &dates, const std::vector< double > &values)

Algebra

• TimeBasket & operator+= (const TimeBasket &other)


• TimeBasket & operator-= (const TimeBasket &other)

Other methods

• TimeBasket rebin (const std::vector< Date > &buckets) const


redistribute the entries over the given dates

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.398 TimeGrid Class Reference 601

9.398 TimeGrid Class Reference


#include <ql/grid.hpp>

9.398.1 Detailed Description

time grid class

Todo
What was the rationale for limiting the grid to positive times? Investigate and see whether
we can use it for negative ones as well.

Public Member Functions


• TimeGrid (Time end, Size steps)
Regularly spaced time-grid.

• template<class Iterator> TimeGrid (Iterator begin, Iterator end)


Time grid with mandatory time points.

• template<class Iterator> TimeGrid (Iterator begin, Iterator end, Size steps)


Time grid with mandatory time points.

• Size findIndex (Time t) const


• const std::vector< Time > & mandatoryTimes () const
• Time dt (Size i) const

9.398.2 Constructor & Destructor Documentation

9.398.2.1 TimeGrid (Iterator begin, Iterator end)

Time grid with mandatory time points.


Mandatory points are guaranteed to belong to the grid. No additional points are added.

9.398.2.2 TimeGrid (Iterator begin, Iterator end, Size steps)

Time grid with mandatory time points.


Mandatory points are guaranteed to belong to the grid. Additional points are then added with
regular spacing between pairs of mandatory times in order to reach the desired number of steps.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


602 QuantLib Class Documentation

9.399 Tokyo Class Reference


#include <ql/Calendars/tokyo.hpp>
Inheritance diagram for Tokyo:

Bridge< Calendar, CalendarImpl >

Calendar

Tokyo

9.399.1 Detailed Description

Tokyo calendar
Holidays:

• Saturdays
• Sundays
• New Year’s Day, January 1st
• Bank Holiday, January 2nd
• Bank Holiday, January 3rd
• Coming of Age Day, 2nd Monday in January
• National Foundation Day, February 11th
• Vernal Equinox
• Greenery Day, April 29th
• Constitution Memorial Day, May 3rd
• Holiday for a Nation, May 4th
• Children’s Day, May 5th
• Marine Day, 3rd Monday in July
• Respect for the Aged Day, 3rd Monday in September
• Autumnal Equinox
• Health and Sports Day, 2nd Monday in October
• National Culture Day, November 3rd
• Labor Thanksgiving Day, November 23rd
• Emperor’s Birthday, December 23rd
• Bank Holiday, December 31st

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.399 Tokyo Class Reference 603

• a few one-shot holidays

Holidays falling on a Sunday are observed on the Monday following except for the Bank Holidays
associated with the New Year

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


604 QuantLib Class Documentation

9.400 Toronto Class Reference


#include <ql/Calendars/toronto.hpp>
Inheritance diagram for Toronto:

Bridge< Calendar, CalendarImpl >

Calendar

Toronto

9.400.1 Detailed Description

Toronto calendar
Holidays:

• Saturdays
• Sundays
• New Year’s Day, January 1st (possibly moved to Monday)
• Good Friday
• Easter Monday
• Victoria Day, The Monday on or preceding 24 May
• Canada Day, July 1st (possibly moved to Monday)
• Provincial Holiday, first Monday of August
• Labour Day, first Monday of September
• Thanksgiving Day, second Monday of October
• Remembrance Day, November 11th
• Christmas, December 25th (possibly moved to Monday or Tuesday)
• Boxing Day, December 26th (possibly moved to Monday or Tuesday)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.401 TrapezoidIntegral Class Reference 605

9.401 TrapezoidIntegral Class Reference

#include <ql/Math/trapezoidintegral.hpp>
Inheritance diagram for TrapezoidIntegral:

TrapezoidIntegral

SimpsonIntegral

9.401.1 Detailed Description

Integral of a one-dimensional function.


Given a target accuracy , the integral of a function f between a and b is calculated by means of
the trapezoid formula
Z b
1 1
f dx = f (x0 ) + f (x1 ) + f (x2 ) + . . . + f (xN−1 ) + f (xN )
a 2 2

where x0 = a, xN = b, and xi = a + i∆x with ∆x = (b − a)/N. The number N of intervals is repeatedly


increased until the target accuracy is reached.

Public Types

• enum Method { Default, MidPoint }

Public Member Functions

• TrapezoidIntegral (double accuracy, Method method=Default, Size maxIterations=Null<


int >())
• template<class F> double operator() (const F &f, double a, double b) const
• double accuracy () const
• double & accuracy ()
• Method method () const
• Method & method ()
• Size maxIterations () const
• Size & maxIterations ()

Protected Member Functions

• template<class F> double defaultIteration (const F &f, double a, double b, double I, Size
N) const
• template<class F> double midPointIteration (const F &f, double a, double b, double I, Size
N) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


606 QuantLib Class Documentation

Protected Attributes
• double accuracy_
• Method method_
• Size maxIterations_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.402 Tree Class Reference 607

9.402 Tree Class Reference


#include <ql/Lattices/tree.hpp>
Inheritance diagram for Tree:

Tree

BinomialTree TrinomialTree

EqualJumpsBinomialTree EqualProbabilitiesBinomialTree LeisenReimer Tian

CoxRossRubinstein Trigeorgis AdditiveEQPBinomialTree JarrowRudd

9.402.1 Detailed Description

Tree approximating a single-factor diffusion

Public Member Functions


• Tree (Size nColumns)
• virtual double underlying (Size i, Size index) const=0
• virtual Size size (Size i) const=0
• virtual Size descendant (Size i, Size index, Size branch) const=0
• virtual double probability (Size i, Size index, Size branch) const=0
• Size nColumns () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


608 QuantLib Class Documentation

9.403 TreeCapFloor Class Reference


#include <ql/PricingEngines/CapFloor/treecapfloor.hpp>
Inheritance diagram for TreeCapFloor:

Observable

PricingEngine

GenericEngine< Arguments, Results > Observer

GenericModelEngine< ShortRateModel, Arguments, Results >

LatticeShortRateModelEngine< CapFloor::arguments, CapFloor::results >

TreeCapFloor

9.403.1 Detailed Description

Cap/floor priced on a lattice.

Public Member Functions


• TreeCapFloor (const Handle< ShortRateModel > &model, Size timeSteps)
• TreeCapFloor (const Handle< ShortRateModel > &model, const TimeGrid &timeGrid)
• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.404 TreeSwaption Class Reference 609

9.404 TreeSwaption Class Reference


#include <ql/PricingEngines/Swaption/treeswaption.hpp>
Inheritance diagram for TreeSwaption:

Observable

PricingEngine

GenericEngine< Arguments, Results > Observer

GenericModelEngine< ShortRateModel, Arguments, Results >

LatticeShortRateModelEngine< Swaption::arguments, Swaption::results >

TreeSwaption

9.404.1 Detailed Description

Swaption priced on a lattice

Public Member Functions


• TreeSwaption (const Handle< ShortRateModel > &model, Size timeSteps)
• TreeSwaption (const Handle< ShortRateModel > &model, const TimeGrid &timeGrid)
• void calculate () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


610 QuantLib Class Documentation

9.405 TridiagonalOperator Class Reference


#include <ql/FiniteDifferences/tridiagonaloperator.hpp>
Inheritance diagram for TridiagonalOperator:

TridiagonalOperator

BSMOperator DMinus DPlus DPlusDMinus DZero OneFactorOperator

9.405.1 Detailed Description

Base implementation for tridiagonal operator.

Warning:
to use real time-dependant algebra, you must overload the corresponding operators in the
inheriting time-dependent class

Operator interface
• Disposable< Array > applyTo (const Array &v) const
apply operator to a given array

• Disposable< Array > solveFor (const Array &rhs) const


solve linear system for a given right-hand side

• Disposable< Array > SOR (const Array &rhs, double tol) const
solve linear system with SOR approach

• Disposable< TridiagonalOperator > identity (Size size)


identity instance

Public Types
• typedef Array arrayType

Public Member Functions


• TridiagonalOperator (Size size=0)
• TridiagonalOperator (const Array &low, const Array &mid, const Array &high)
• TridiagonalOperator (const Disposable< TridiagonalOperator > &)
• TridiagonalOperator & operator= (const Disposable< TridiagonalOperator > &)

Inspectors

• Size size () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.405 TridiagonalOperator Class Reference 611

• bool isTimeDependent ()
• const Array & lowerDiagonal () const
• const Array & diagonal () const
• const Array & upperDiagonal () const

Modifiers

• void setFirstRow (double, double)


• void setMidRow (Size, double, double, double)
• void setMidRows (double, double, double)
• void setLastRow (double, double)
• void setTime (Time t)

Utilities

• void swap (TridiagonalOperator &)

Protected Attributes
• Array diagonal_
• Array lowerDiagonal_
• Array upperDiagonal_
• Handle< TimeSetter > timeSetter_

Friends
• Disposable< TridiagonalOperator > operator+ (const TridiagonalOperator &)
• Disposable< TridiagonalOperator > operator- (const TridiagonalOperator &)
• Disposable< TridiagonalOperator > operator+ (const TridiagonalOperator &, const
TridiagonalOperator &)
• Disposable< TridiagonalOperator > operator- (const TridiagonalOperator &, const
TridiagonalOperator &)
• Disposable< TridiagonalOperator > operator ∗ (double, const TridiagonalOperator &)
• Disposable< TridiagonalOperator > operator ∗ (const TridiagonalOperator &, double)
• Disposable< TridiagonalOperator > operator/ (const TridiagonalOperator &, double)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


612 QuantLib Class Documentation

9.406 TridiagonalOperator::TimeSetter Class Reference


#include <ql/FiniteDifferences/tridiagonaloperator.hpp>

9.406.1 Detailed Description

encapsulation of time-setting logic

Public Member Functions


• virtual void setTime (Time t, TridiagonalOperator &L) const=0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.407 Trigeorgis Class Reference 613

9.407 Trigeorgis Class Reference


#include <ql/Lattices/binomialtree.hpp>
Inheritance diagram for Trigeorgis:

Tree

BinomialTree

EqualJumpsBinomialTree

Trigeorgis

9.407.1 Detailed Description

Trigeorgis (additive equal jumps) binomial tree

Public Member Functions


• Trigeorgis (const Handle< DiffusionProcess > &process, Time end, Size steps, double
strike)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


614 QuantLib Class Documentation

9.408 TrinomialBranching Class Reference


#include <ql/Lattices/trinomialtree.hpp>

9.408.1 Detailed Description

Branching scheme for a trinomial node.


Each node has three descendants, with the middle branch linked to the node which is closest to
the expectation of the variable.

Public Member Functions


• Size descendant (Size index, Size branch) const
• double probability (Size index, Size branch) const
• int jMin () const

Friends
• class TrinomialTree

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.409 TrinomialTree Class Reference 615

9.409 TrinomialTree Class Reference


#include <ql/Lattices/trinomialtree.hpp>
Inheritance diagram for TrinomialTree:

Tree

TrinomialTree

9.409.1 Detailed Description

Recombining trinomial tree class.


This class defines a recombining trinomial tree approximating a a diffusion.

Warning:
The diffusion term of the SDE must be independent of the underlying process.

Public Member Functions


• TrinomialTree (const Handle< DiffusionProcess > &process, const TimeGrid &timeGrid,
bool isPositive=false)
• double dx (Size i) const
• Size size (Size i) const
• double underlying (Size i, Size index) const
• const TimeGrid & timeGrid () const
• Size descendant (Size i, Size index, Size branch) const
• double probability (Size i, Size index, Size branch) const

Protected Attributes
• std::vector< Handle< TrinomialBranching > > branchings_
• double x0_
• std::vector< double > dx_
• TimeGrid timeGrid_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


616 QuantLib Class Documentation

9.410 TwoFactorModel Class Reference


#include <ql/ShortRateModels/twofactormodel.hpp>
Inheritance diagram for TwoFactorModel:

Observer Observable

ShortRateModel

TwoFactorModel

G2

9.410.1 Detailed Description

Abstract base-class for two-factor models.

Public Member Functions


• TwoFactorModel (Size nParams)
• virtual Handle< ShortRateDynamics > dynamics () const=0
Returns the short-rate dynamics.

• virtual Handle< Lattice > tree (const TimeGrid &grid) const


Returns a two-dimensional trinomial tree.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.411 TwoFactorModel::ShortRateDynamics Class Reference 617

9.411 TwoFactorModel::ShortRateDynamics Class Reference


#include <ql/ShortRateModels/twofactormodel.hpp>

9.411.1 Detailed Description

Class describing the dynamics of the two state variables.


We assume here that the short-rate is a function of two state variables x and y.

rt = f (t, xt , yt )

of two state variables xt and yt . These stochastic processes satisfy

xt = µx (t, xt )dt + σx (t, xt )dWtx

and
y
yt = µ y (t, yt )dt + σ y (t, yt )dWt
where W x and W y are two brownian motions satisfying
y
dWtx dWt = ρdt

Public Member Functions


• ShortRateDynamics (const Handle< DiffusionProcess > &xProcess, const Handle<
DiffusionProcess > &yProcess, double correlation)
• virtual Rate shortRate (Time t, double x, double y) const=0
• const Handle< DiffusionProcess > & xProcess () const
Risk-neutral dynamics of the first state variable x.

• const Handle< DiffusionProcess > & yProcess () const


Risk-neutral dynamics of the second state variable y.

• double correlation () const


Correlation ρ between the two brownian motions.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


618 QuantLib Class Documentation

9.412 TwoFactorModel::ShortRateTree Class Reference


#include <ql/ShortRateModels/twofactormodel.hpp>
Inheritance diagram for TwoFactorModel::ShortRateTree:

NumericalMethod

Lattice

Lattice2D

TwoFactorModel::ShortRateTree

9.412.1 Detailed Description

Recombining two-dimensional tree discretizing the state variable.

Public Member Functions


• ShortRateTree (const Handle< TrinomialTree > &tree1, const Handle< TrinomialTree >
&tree2, const Handle< ShortRateDynamics > &dynamics)
Plain tree build-up from short-rate dynamics.

• DiscountFactor discount (Size i, Size index) const


Discount factor at time t_i and node indexed by index.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.413 TypePayoff Class Reference 619

9.413 TypePayoff Class Reference


#include <ql/Instruments/payoffs.hpp>
Inheritance diagram for TypePayoff:

Payoff

TypePayoff

StrikedTypePayoff

9.413.1 Detailed Description

Intermediate class for call/put/straddle payoffs.

Public Member Functions


• TypePayoff (Option::Type type)
• Option::Type optionType () const

Protected Attributes
• Option::Type type_

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


620 QuantLib Class Documentation

9.414 UpFrontIndexedCoupon Class Reference


#include <ql/CashFlows/upfrontindexedcoupon.hpp>
Inheritance diagram for UpFrontIndexedCoupon:

Observable

CashFlow

Coupon

FloatingRateCoupon Observer

IndexedCoupon

UpFrontIndexedCoupon

9.414.1 Detailed Description

up front indexed coupon class

Warning:
This class does not perform any date adjustment, i.e., the start and end date passed upon
construction should be already rolled to a business day.

Public Member Functions


• UpFrontIndexedCoupon (double nominal, const Date &paymentDate, const Handle<
Xibor > &index, const Date &startDate, const Date &endDate, int fixingDays, Spread
spread=0.0, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date(), const
DayCounter &dayCounter=DayCounter())

FloatingRateCoupon interface

• Date fixingDate () const

Visitability

• virtual void accept (AcyclicVisitor &)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.415 USDLibor Class Reference 621

9.415 USDLibor Class Reference


#include <ql/Indexes/usdlibor.hpp>
Inheritance diagram for USDLibor:

Observable

Index Observer

Xibor

USDLibor

9.415.1 Detailed Description

USD Libor index

Public Member Functions


• USDLibor (int n, TimeUnit units, const RelinkableHandle< TermStructure > &h, const
DayCounter &dc=Actual360())

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


622 QuantLib Class Documentation

9.416 Value Class Reference


#include <ql/instrument.hpp>
Inheritance diagram for Value:

Results

Value

results results results results results

9.416.1 Detailed Description

pricing results

Public Member Functions


• void reset ()

Public Attributes
• double value
• double errorEstimate

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.417 VanillaEngine Class Reference 623

9.417 VanillaEngine Class Reference


#include <ql/Instruments/vanillaoption.hpp>
Inheritance diagram for VanillaEngine:

AnalyticDigitalAmericanEngine

AnalyticEuropeanEngine

BaroneAdesiWhaleyApproximationEngine

GenericEngine< VanillaOption::arguments, VanillaOption::results > VanillaEngine BinomialVanillaEngine

BjerksundStenslandApproximationEngine

IntegralEngine

MCVanillaEngine

9.417.1 Detailed Description

Vanilla option engine base class.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


624 QuantLib Class Documentation

9.418 VanillaOption Class Reference


#include <ql/Instruments/vanillaoption.hpp>
Inheritance diagram for VanillaOption:

Observable Observer

LazyObject

Instrument

Option

OneAssetOption

OneAssetStrikedOption

VanillaOption

ForwardVanillaOption QuantoVanillaOption

QuantoForwardVanillaOption

9.418.1 Detailed Description

Vanilla option (no discrete dividends, no barriers) on a single asset.

Public Member Functions


• VanillaOption (const Handle< BlackScholesStochasticProcess > &stochProc, const
Handle< StrikedTypePayoff > &payoff, const Handle< Exercise > &exercise, const
Handle< PricingEngine > &engine=Handle< PricingEngine >())

Protected Member Functions


• void performCalculations () const

9.418.2 Member Function Documentation

9.418.2.1 void performCalculations () const [protected, virtual]

In case a pricing engine is not used, this method must be overridden to perform the actual calcu-
lations and set any needed results. In case a pricing engine is used, the default implementation
can be used.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.418 VanillaOption Class Reference 625

Reimplemented from OneAssetStrikedOption (p. 482).


Reimplemented in ForwardVanillaOption (p. 316), and QuantoVanillaOption (p. 531).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


626 QuantLib Class Documentation

9.419 Vasicek Class Reference


#include <ql/ShortRateModels/OneFactorModels/vasicek.hpp>
Inheritance diagram for Vasicek:

Observer Observable

ShortRateModel

OneFactorModel AffineModel

OneFactorAffineModel

Vasicek

HullWhite

9.419.1 Detailed Description

Vasicek model class


This class implements the Vasicek(p. 626) model defined by

drt = a(b − rt )dt + σdWt ,

where a, b and σ are constants.

Public Member Functions


• Vasicek (Rate r0=0.05, double a=0.1, double b=0.05, double sigma=0.01)
• virtual double discountBondOption (Option::Type type, double strike, Time maturity, Time
bondMaturity) const
• virtual Handle< ShortRateDynamics > dynamics () const
returns the short-rate dynamics

Protected Member Functions


• virtual double A (Time t, Time T) const
• virtual double B (Time t, Time T) const
• double a () const
• double b () const
• double sigma () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.420 Vasicek::Dynamics Class Reference 627

9.420 Vasicek::Dynamics Class Reference


#include <ql/ShortRateModels/OneFactorModels/vasicek.hpp>

9.420.1 Detailed Description

Short-rate dynamics in the Vasicek model.


The short-rate follows an Ornstein-Uhlenbeck process with mean b.

Public Member Functions


• Dynamics (double a, double b, double sigma, double r0)
• virtual double variable (Time t, Rate r) const
• virtual double shortRate (Time t, double x) const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


628 QuantLib Class Documentation

9.421 Visitor Class Template Reference


#include <ql/Patterns/visitor.hpp>

9.421.1 Detailed Description

template<class T> class QuantLib::Visitor< T >

Visitor for a specific class

Public Member Functions


• virtual void visit (T &)=0

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.422 Warsaw Class Reference 629

9.422 Warsaw Class Reference


#include <ql/Calendars/warsaw.hpp>
Inheritance diagram for Warsaw:

Bridge< Calendar, CalendarImpl >

Calendar

Warsaw

9.422.1 Detailed Description

Warsaw calendar
Holidays:

• Saturdays
• Sundays
• Easter Monday
• Corpus Christi
• New Year’s Day, January 1st
• May Day, May 1st
• Constitution Day, May 3rd
• Assumption of the Blessed Virgin Mary, August 15th
• All Saints Day, November 1st
• Independence Day, November 11th
• Christmas, December 25th
• 2nd Day of Christmas, December 26th

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


630 QuantLib Class Documentation

9.423 Wellington Class Reference


#include <ql/Calendars/wellington.hpp>
Inheritance diagram for Wellington:

Bridge< Calendar, CalendarImpl >

Calendar

Wellington

9.423.1 Detailed Description

Wellington calendar
Holidays:

• Saturdays
• Sundays
• New Year’s Day, January 1st (possibly moved to Monday or Tuesday)
• Day after New Year’s Day, January 2st (possibly moved to Monday or Tuesday)
• Anniversary Day, Monday nearest January 22nd
• Waitangi Day. February 6th
• Good Friday
• Easter Monday
• ANZAC Day. April 25th
• Queen’s Birthday, first Monday in June
• Labour Day, fourth Monday in October
• Christmas, December 25th (possibly moved to Monday or Tuesday)
• Boxing Day, December 26th (possibly moved to Monday or Tuesday)

Note:
The holiday rules for Wellington(p. 630) were documented by David Gilbert for IDB
(http://www.jrefinery.com/ibd/)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.424 Xibor Class Reference 631

9.424 Xibor Class Reference

#include <ql/Indexes/xibor.hpp>
Inheritance diagram for Xibor:

Index Observer

Xibor

AUDLibor CADLibor CHFLibor Euribor GBPLibor JPYLibor USDLibor ZARLibor

9.424.1 Detailed Description

base class for libor indexes

Public Member Functions

• Xibor (const std::string &familyName, int n, TimeUnit units, int settlementDays, Cur-
rency currency, const Calendar &calendar, bool isAdjusted, RollingConvention rolling-
Convention, const DayCounter &dayCounter, const RelinkableHandle< TermStructure >
&h)

Index interface

• Rate fixing (const Date &fixingDate) const


returns the fixing at the given date

Observer interface

• void update ()

Inspectors

• std::string name () const


Returns the name of the index.

• Period tenor () const


• int frequency () const
• int settlementDays () const
• Currency currency () const
• Calendar calendar () const
• bool isAdjusted () const
• RollingConvention rollingConvention () const
• DayCounter dayCounter () const
• Handle< TermStructure > termStructure () const

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


632 QuantLib Class Documentation

9.424.2 Member Function Documentation

9.424.2.1 Rate fixing (const Date & fixingDate) const [virtual]

returns the fixing at the given date

Note:
any date passed as arguments must be a value date, i.e., the real calendar date advanced by
a number of settlement days.

Implements Index (p. 363).

9.424.2.2 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

9.424.2.3 std::string name () const [virtual]

Returns the name of the index.

Warning:
This method is used for output and comparison between indexes. It is not meant to be used
for writing switch-on-type code.

Implements Index (p. 363).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.425 XiborManager Class Reference 633

9.425 XiborManager Class Reference


#include <ql/Indexes/xibormanager.hpp>

9.425.1 Detailed Description

global repository for libor histories

Public Types
• typedef std::map< std::string, History > HistoryMap

Static Public Member Functions


• void setHistory (const std::string &name, const History &)
• const History & getHistory (const std::string &name)
• bool hasHistory (const std::string &name)
• std::vector< std::string > histories ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


634 QuantLib Class Documentation

9.426 ZARLibor Class Reference


#include <ql/Indexes/zarlibor.hpp>
Inheritance diagram for ZARLibor:

Observable

Index Observer

Xibor

ZARLibor

9.426.1 Detailed Description

ZAR Libor index, also known as JIBAR

Todo
check settlement days

Public Member Functions


• ZARLibor (int n, TimeUnit units, const RelinkableHandle< TermStructure > &h, const
DayCounter &dc=Actual365())

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.427 ZeroCurve Class Reference 635

9.427 ZeroCurve Class Reference


#include <ql/TermStructures/zerocurve.hpp>
Inheritance diagram for ZeroCurve:

Observable

TermStructure

ZeroYieldStructure

ZeroCurve

9.427.1 Detailed Description

Term structure based on linear interpolation of zero yields.

Public Member Functions


• ZeroCurve (const Date &todaysDate, const std::vector< Date > &dates, const std::vector<
Rate > &yields, const DayCounter &dayCounter=Actual365())
• DayCounter dayCounter () const
the day counter used for date/time conversion

• Date todaysDate () const


today’s date

• Date referenceDate () const


the reference date, i.e., the date at which discount = 1

• const std::vector< Date > & dates () const


• Date maxDate () const
the latest date for which the curve can return rates

• const std::vector< Time > & times () const


• Time maxTime () const
the latest time for which the curve can return rates

Protected Member Functions


• Rate zeroYieldImpl (Time t, bool extrapolate=false) const
zero-yield calculation

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


636 QuantLib Class Documentation

9.428 ZeroSpreadedTermStructure Class Reference


#include <ql/TermStructures/zerospreadedtermstructure.hpp>
Inheritance diagram for ZeroSpreadedTermStructure:

Observable

TermStructure

ZeroYieldStructure Observer

ZeroSpreadedTermStructure

9.428.1 Detailed Description

Term structure with an added spread on the zero yield rate.

Note:
This term structure will remain linked to the original structure, i.e., any changes in the latter
will be reflected in this structure as well.

Public Member Functions


• ZeroSpreadedTermStructure (const RelinkableHandle< TermStructure > &, const
RelinkableHandle< Quote > &spread)

TermStructure interface

• DayCounter dayCounter () const


the day counter used for date/time conversion

• Date referenceDate () const


the reference date, i.e., the date at which discount = 1

• Date todaysDate () const


today’s date

• Date maxDate () const


the latest date for which the curve can return rates

• Time maxTime () const


the latest time for which the curve can return rates

Observer interface

• void update ()

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.428 ZeroSpreadedTermStructure Class Reference 637

Protected Member Functions


• Rate zeroYieldImpl (Time, bool extrapolate=false) const
returns the spreaded zero yield rate

• Rate forwardImpl (Time, bool extrapolate=false) const


returns the spreaded forward rate

9.428.2 Member Function Documentation

9.428.2.1 void update () [virtual]

This method must be implemented in derived classes. An instance of Observer does not call this
method directly: instead, it will be called by the observables the instance registered with when
they need to notify any changes.
Implements Observer (p. 475).

9.428.2.2 Rate forwardImpl (Time, bool extrapolate = false) const [protected, virtual]

returns the spreaded forward rate

Warning:
This method must disappear should the spread become a curve

Reimplemented from ZeroYieldStructure (p. 638).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


638 QuantLib Class Documentation

9.429 ZeroYieldStructure Class Reference

#include <ql/termstructure.hpp>
Inheritance diagram for ZeroYieldStructure:

Observable

TermStructure

ZeroYieldStructure

DriftTermStructure QuantoTermStructure ZeroCurve ZeroSpreadedTermStructure

9.429.1 Detailed Description

Zero yield term structure.


This abstract class acts as an adapter to TermStructure(p. 594) allowing the programmer to im-
plement only the zeroYieldImpl(Time, bool) method in derived classes.
Rates are assumed to be annual continuos compounding.

Protected Member Functions

• DiscountFactor discountImpl (Time, bool extrapolate=false) const


• Rate forwardImpl (Time, bool extrapolate=false) const
• Rate compoundForwardImpl (Time, int, bool extrapolate=false) const

9.429.2 Member Function Documentation

9.429.2.1 DiscountFactor discountImpl (Time, bool extrapolate = false) const [protected,


virtual]

Returns the discount factor for the given date calculating it from the zero yield.
Implements TermStructure (p. 595).

9.429.2.2 Rate forwardImpl (Time, bool extrapolate = false) const [protected, virtual]

Returns the instantaneous forward rate for the given date calculating it from the zero yield.
Implements TermStructure (p. 595).
Reimplemented in ZeroSpreadedTermStructure (p. 637).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


9.429 ZeroYieldStructure Class Reference 639

9.429.2.3 Rate compoundForwardImpl (Time, int, bool extrapolate = false) const


[protected, virtual]

Returns the forward rate at a specified compound frequency for the given date calculating it from
the zero yield.
Implements TermStructure (p. 595).

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


640 QuantLib Class Documentation

9.430 Zurich Class Reference


#include <ql/Calendars/zurich.hpp>
Inheritance diagram for Zurich:

Bridge< Calendar, CalendarImpl >

Calendar

Zurich

9.430.1 Detailed Description

Zurich calendar
Holidays:

• Saturdays
• Sundays
• New Year’s Day, January 1st
• Berchtoldstag, January 2nd
• Good Friday
• Easter Monday
• Ascension Day
• Whit Monday
• Labour Day, May 1st
• National Day, August 1st
• Christmas, December 25th
• St. Stephen’s Day, December 26th

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


Chapter 10

QuantLib File Documentation

10.1 ql/argsandresults.hpp File Reference

10.1.1 Detailed Description

Base classes for generic arguments and results.


#include <ql/null.hpp>
Include dependency graph for argsandresults.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

ql/null.hpp

argsandresults.hpp

Namespaces
• namespace QuantLib

Defines
• #define QL_MIN_VOLATILITY 0.0
• #define QL_MIN_DIVYIELD 1.0e-7
• #define QL_MAX_VOLATILITY 4.0
• #define QL_MAX_DIVYIELD 4.0
642 QuantLib File Documentation

10.2 ql/calendar.hpp File Reference

10.2.1 Detailed Description

calendar class
#include <ql/date.hpp>
#include <ql/Patterns/bridge.hpp>
Include dependency graph for calendar.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

calendar.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.3 ql/Calendars/budapest.hpp File Reference 643

10.3 ql/Calendars/budapest.hpp File Reference

10.3.1 Detailed Description

Budapest calendar.
#include <ql/calendar.hpp>
Include dependency graph for budapest.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

budapest.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


644 QuantLib File Documentation

10.4 ql/Calendars/copenhagen.hpp File Reference

10.4.1 Detailed Description

Copenhagen calendar.
#include <ql/calendar.hpp>
Include dependency graph for copenhagen.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

copenhagen.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.5 ql/Calendars/frankfurt.hpp File Reference 645

10.5 ql/Calendars/frankfurt.hpp File Reference

10.5.1 Detailed Description

Frankfurt calendar.
#include <ql/calendar.hpp>
Include dependency graph for frankfurt.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

frankfurt.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


646 QuantLib File Documentation

10.6 ql/Calendars/helsinki.hpp File Reference

10.6.1 Detailed Description

Helsinki calendar.
#include <ql/calendar.hpp>
Include dependency graph for helsinki.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

helsinki.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.7 ql/Calendars/johannesburg.hpp File Reference 647

10.7 ql/Calendars/johannesburg.hpp File Reference

10.7.1 Detailed Description

Johannesburg calendar.
#include <ql/calendar.hpp>
Include dependency graph for johannesburg.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

johannesburg.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


648 QuantLib File Documentation

10.8 ql/Calendars/jointcalendar.hpp File Reference

10.8.1 Detailed Description

Joint calendar.
#include <ql/calendar.hpp>
#include <vector>
Include dependency graph for jointcalendar.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp vector

jointcalendar.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.9 ql/Calendars/london.hpp File Reference 649

10.9 ql/Calendars/london.hpp File Reference

10.9.1 Detailed Description

London calendar.
#include <ql/calendar.hpp>
Include dependency graph for london.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

london.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


650 QuantLib File Documentation

10.10 ql/Calendars/milan.hpp File Reference

10.10.1 Detailed Description

Milan calendar.
#include <ql/calendar.hpp>
Include dependency graph for milan.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

milan.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.11 ql/Calendars/newyork.hpp File Reference 651

10.11 ql/Calendars/newyork.hpp File Reference

10.11.1 Detailed Description

New York calendar.


#include <ql/calendar.hpp>
Include dependency graph for newyork.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

newyork.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


652 QuantLib File Documentation

10.12 ql/Calendars/nullcalendar.hpp File Reference

10.12.1 Detailed Description

Calendar for reproducing theoretical calculations.


#include <ql/calendar.hpp>
Include dependency graph for nullcalendar.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

nullcalendar.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.13 ql/Calendars/oslo.hpp File Reference 653

10.13 ql/Calendars/oslo.hpp File Reference

10.13.1 Detailed Description

Oslo calendar.
#include <ql/calendar.hpp>
Include dependency graph for oslo.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

oslo.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


654 QuantLib File Documentation

10.14 ql/Calendars/stockholm.hpp File Reference

10.14.1 Detailed Description

Stockholm calendar.
#include <ql/calendar.hpp>
Include dependency graph for stockholm.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

stockholm.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.15 ql/Calendars/sydney.hpp File Reference 655

10.15 ql/Calendars/sydney.hpp File Reference

10.15.1 Detailed Description

Sydney calendar.
#include <ql/calendar.hpp>
Include dependency graph for sydney.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

sydney.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


656 QuantLib File Documentation

10.16 ql/Calendars/target.hpp File Reference

10.16.1 Detailed Description

TARGET calendar.
#include <ql/calendar.hpp>
Include dependency graph for target.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

target.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.17 ql/Calendars/tokyo.hpp File Reference 657

10.17 ql/Calendars/tokyo.hpp File Reference

10.17.1 Detailed Description

Tokyo calendar.
#include <ql/calendar.hpp>
Include dependency graph for tokyo.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

tokyo.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


658 QuantLib File Documentation

10.18 ql/Calendars/toronto.hpp File Reference

10.18.1 Detailed Description

Toronto calendar.
#include <ql/calendar.hpp>
Include dependency graph for toronto.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

toronto.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.19 ql/Calendars/warsaw.hpp File Reference 659

10.19 ql/Calendars/warsaw.hpp File Reference

10.19.1 Detailed Description

Warsaw calendar.
#include <ql/calendar.hpp>
Include dependency graph for warsaw.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

warsaw.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


660 QuantLib File Documentation

10.20 ql/Calendars/wellington.hpp File Reference

10.20.1 Detailed Description

Wellington calendar.
#include <ql/calendar.hpp>
Include dependency graph for wellington.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

wellington.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.21 ql/Calendars/zurich.hpp File Reference 661

10.21 ql/Calendars/zurich.hpp File Reference

10.21.1 Detailed Description

Zurich calendar.
#include <ql/calendar.hpp>
Include dependency graph for zurich.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/calendar.hpp

zurich.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


662 QuantLib File Documentation

10.22 ql/capvolstructures.hpp File Reference

10.22.1 Detailed Description

Cap/Floor volatility structures.


#include <ql/daycounter.hpp>
#include <ql/Patterns/observable.hpp>
Include dependency graph for capvolstructures.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

list ql/handle.hpp ql/date.hpp

ql/Patterns/observable.hpp ql/Patterns/bridge.hpp

ql/daycounter.hpp

capvolstructures.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.23 ql/cashflow.hpp File Reference 663

10.23 ql/cashflow.hpp File Reference

10.23.1 Detailed Description

Base class for cash flows.


#include <ql/date.hpp>
#include <ql/Patterns/observable.hpp>
#include <ql/Patterns/visitor.hpp>
Include dependency graph for cashflow.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

list ql/handle.hpp ql/date.hpp

ql/Patterns/observable.hpp ql/Patterns/visitor.hpp

cashflow.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


664 QuantLib File Documentation

10.24 ql/CashFlows/basispointsensitivity.hpp File Reference

10.24.1 Detailed Description

basis point sensitivity calculator


#include <ql/termstructure.hpp>
#include <ql/CashFlows/fixedratecoupon.hpp>
#include <ql/CashFlows/timebasket.hpp>
Include dependency graph for basispointsensitivity.hpp:

ql/termstructure.hpp ql/CashFlows/fixedratecoupon.hpp ql/CashFlows/timebasket.hpp

basispointsensitivity.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.25 ql/CashFlows/cashflowvectors.hpp File Reference 665

10.25 ql/CashFlows/cashflowvectors.hpp File Reference

10.25.1 Detailed Description

Cash flow vector builders.


#include <ql/cashflow.hpp>
#include <ql/Indexes/xibor.hpp>
#include <ql/scheduler.hpp>
Include dependency graph for cashflowvectors.hpp:

ql/date.hpp

ql/Patterns/visitor.hpp ql/Patterns/observable.hpp ql/calendar.hpp vector ql/null.hpp

ql/cashflow.hpp ql/index.hpp ql/termstructure.hpp ql/scheduler.hpp

ql/Indexes/xibor.hpp

cashflowvectors.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


666 QuantLib File Documentation

10.26 ql/CashFlows/coupon.hpp File Reference

10.26.1 Detailed Description

Coupon accruing over a fixed period.


#include <ql/cashflow.hpp>
#include <ql/calendar.hpp>
#include <ql/daycounter.hpp>
Include dependency graph for coupon.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp

ql/handle.hpp list utility functional

ql/Patterns/bridge.hpp ql/Patterns/observable.hpp ql/date.hpp ql/Patterns/visitor.hpp

ql/daycounter.hpp ql/calendar.hpp ql/cashflow.hpp

coupon.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.27 ql/CashFlows/fixedratecoupon.hpp File Reference 667

10.27 ql/CashFlows/fixedratecoupon.hpp File Reference

10.27.1 Detailed Description

Coupon paying a fixed annual rate.


#include <ql/CashFlows/coupon.hpp>
Include dependency graph for fixedratecoupon.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp

ql/handle.hpp list utility functional

ql/Patterns/bridge.hpp ql/Patterns/observable.hpp ql/date.hpp ql/Patterns/visitor.hpp

ql/daycounter.hpp ql/calendar.hpp ql/cashflow.hpp

ql/CashFlows/coupon.hpp

fixedratecoupon.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


668 QuantLib File Documentation

10.28 ql/CashFlows/floatingratecoupon.hpp File Reference

10.28.1 Detailed Description

Coupon at par on a term structure.


#include <ql/CashFlows/coupon.hpp>
Include dependency graph for floatingratecoupon.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp

ql/handle.hpp list utility functional

ql/Patterns/bridge.hpp ql/Patterns/observable.hpp ql/date.hpp ql/Patterns/visitor.hpp

ql/daycounter.hpp ql/calendar.hpp ql/cashflow.hpp

ql/CashFlows/coupon.hpp

floatingratecoupon.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.29 ql/CashFlows/inarrearindexedcoupon.hpp File Reference 669

10.29 ql/CashFlows/inarrearindexedcoupon.hpp File Reference

10.29.1 Detailed Description

in arrear indexed coupon


#include <ql/CashFlows/indexedcoupon.hpp>
Include dependency graph for inarrearindexedcoupon.hpp:

ql/CashFlows/coupon.hpp ql/index.hpp ql/termstructure.hpp

ql/CashFlows/floatingratecoupon.hpp ql/Indexes/xibor.hpp

ql/CashFlows/indexedcoupon.hpp

inarrearindexedcoupon.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


670 QuantLib File Documentation

10.30 ql/CashFlows/indexcashflowvectors.hpp File Reference

10.30.1 Detailed Description

Index Cash flow vector builders.


#include <ql/CashFlows/shortindexedcoupon.hpp>
#include <ql/scheduler.hpp>
Include dependency graph for indexcashflowvectors.hpp:

ql/calendar.hpp vector ql/null.hpp

ql/CashFlows/coupon.hpp ql/index.hpp ql/termstructure.hpp ql/scheduler.hpp

ql/CashFlows/floatingratecoupon.hpp ql/Indexes/xibor.hpp

ql/CashFlows/indexedcoupon.hpp

ql/CashFlows/shortindexedcoupon.hpp

indexcashflowvectors.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.31 ql/CashFlows/indexedcoupon.hpp File Reference 671

10.31 ql/CashFlows/indexedcoupon.hpp File Reference

10.31.1 Detailed Description

indexed coupon
#include <ql/CashFlows/floatingratecoupon.hpp>
#include <ql/Indexes/xibor.hpp>
Include dependency graph for indexedcoupon.hpp:

ql/CashFlows/coupon.hpp ql/index.hpp ql/termstructure.hpp

ql/CashFlows/floatingratecoupon.hpp ql/Indexes/xibor.hpp

indexedcoupon.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


672 QuantLib File Documentation

10.32 ql/CashFlows/parcoupon.hpp File Reference

10.32.1 Detailed Description

Coupon at par on a term structure.


#include <ql/CashFlows/floatingratecoupon.hpp>
#include <ql/Indexes/xibor.hpp>
Include dependency graph for parcoupon.hpp:

ql/CashFlows/coupon.hpp ql/index.hpp ql/termstructure.hpp

ql/CashFlows/floatingratecoupon.hpp ql/Indexes/xibor.hpp

parcoupon.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.33 ql/CashFlows/shortfloatingcoupon.hpp File Reference 673

10.33 ql/CashFlows/shortfloatingcoupon.hpp File Reference

10.33.1 Detailed Description

Short (or long) coupon at par on a term structure.


#include <ql/CashFlows/parcoupon.hpp>
Include dependency graph for shortfloatingcoupon.hpp:

ql/CashFlows/coupon.hpp ql/index.hpp ql/termstructure.hpp

ql/CashFlows/floatingratecoupon.hpp ql/Indexes/xibor.hpp

ql/CashFlows/parcoupon.hpp

shortfloatingcoupon.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


674 QuantLib File Documentation

10.34 ql/CashFlows/shortindexedcoupon.hpp File Reference

10.34.1 Detailed Description

Short (or long) indexed coupon.


#include <ql/CashFlows/indexedcoupon.hpp>
Include dependency graph for shortindexedcoupon.hpp:

ql/CashFlows/coupon.hpp ql/index.hpp ql/termstructure.hpp

ql/CashFlows/floatingratecoupon.hpp ql/Indexes/xibor.hpp

ql/CashFlows/indexedcoupon.hpp

shortindexedcoupon.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.35 ql/CashFlows/simplecashflow.hpp File Reference 675

10.35 ql/CashFlows/simplecashflow.hpp File Reference

10.35.1 Detailed Description

Predetermined cash flow.


#include <ql/cashflow.hpp>
Include dependency graph for simplecashflow.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

list ql/handle.hpp ql/date.hpp

ql/Patterns/observable.hpp ql/Patterns/visitor.hpp

ql/cashflow.hpp

simplecashflow.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


676 QuantLib File Documentation

10.36 ql/CashFlows/timebasket.hpp File Reference

10.36.1 Detailed Description

Distribution over a number of dates


#include <ql/date.hpp>
#include <ql/null.hpp>
#include <vector>
#include <map>
Include dependency graph for timebasket.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp utility functional

ql/date.hpp ql/null.hpp vector map

timebasket.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.37 ql/CashFlows/upfrontindexedcoupon.hpp File Reference 677

10.37 ql/CashFlows/upfrontindexedcoupon.hpp File Reference

10.37.1 Detailed Description

Up front indexed coupon.


#include <ql/CashFlows/indexedcoupon.hpp>
Include dependency graph for upfrontindexedcoupon.hpp:

ql/CashFlows/coupon.hpp ql/index.hpp ql/termstructure.hpp

ql/CashFlows/floatingratecoupon.hpp ql/Indexes/xibor.hpp

ql/CashFlows/indexedcoupon.hpp

upfrontindexedcoupon.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


678 QuantLib File Documentation

10.38 ql/currency.hpp File Reference

10.38.1 Detailed Description

Known currencies.
#include <ql/qldefines.hpp>
Include dependency graph for currency.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

currency.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.39 ql/dataformatters.hpp File Reference 679

10.39 ql/dataformatters.hpp File Reference

10.39.1 Detailed Description

Classes used to format data for output.


#include <ql/currency.hpp>
#include <ql/option.hpp>
#include <ql/Math/matrix.hpp>
Include dependency graph for dataformatters.hpp:

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

dataformatters.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


680 QuantLib File Documentation

10.40 ql/dataparsers.hpp File Reference

10.40.1 Detailed Description

Classes used to parse data for input.


#include <ql/date.hpp>
#include <vector>
Include dependency graph for dataparsers.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp utility functional

ql/date.hpp vector

dataparsers.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.41 ql/date.hpp File Reference 681

10.41 ql/date.hpp File Reference

10.41.1 Detailed Description

date- and time-related classes, typedefs and enumerations


#include <ql/errors.hpp>
#include <ql/types.hpp>
#include <utility>
#include <functional>
Include dependency graph for date.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp utility functional

date.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


682 QuantLib File Documentation

10.42 ql/daycounter.hpp File Reference

10.42.1 Detailed Description

day counter class


#include <ql/date.hpp>
#include <ql/Patterns/bridge.hpp>
Include dependency graph for daycounter.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

daycounter.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.43 ql/DayCounters/actual360.hpp File Reference 683

10.43 ql/DayCounters/actual360.hpp File Reference

10.43.1 Detailed Description

act/360 day counter


#include <ql/daycounter.hpp>
Include dependency graph for actual360.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/daycounter.hpp

actual360.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


684 QuantLib File Documentation

10.44 ql/DayCounters/actual365.hpp File Reference

10.44.1 Detailed Description

act/365 day counter


#include <ql/daycounter.hpp>
Include dependency graph for actual365.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/daycounter.hpp

actual365.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.45 ql/DayCounters/actualactual.hpp File Reference 685

10.45 ql/DayCounters/actualactual.hpp File Reference

10.45.1 Detailed Description

act/act day counters


#include <ql/daycounter.hpp>
Include dependency graph for actualactual.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/daycounter.hpp

actualactual.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


686 QuantLib File Documentation

10.46 ql/DayCounters/simpledaycounter.hpp File Reference

10.46.1 Detailed Description

Simple day counter for reproducing theoretical calculations.


#include <ql/daycounter.hpp>
Include dependency graph for simpledaycounter.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/daycounter.hpp

simpledaycounter.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.47 ql/DayCounters/thirty360.hpp File Reference 687

10.47 ql/DayCounters/thirty360.hpp File Reference

10.47.1 Detailed Description

30/360 day counters


#include <ql/daycounter.hpp>
Include dependency graph for thirty360.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/daycounter.hpp

thirty360.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


688 QuantLib File Documentation

10.48 ql/diffusionprocess.hpp File Reference

10.48.1 Detailed Description

Diffusion process.
#include <ql/termstructure.hpp>
#include <ql/voltermstructure.hpp>
Include dependency graph for diffusionprocess.hpp:

ql/termstructure.hpp ql/voltermstructure.hpp

diffusionprocess.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.49 ql/discretizedasset.hpp File Reference 689

10.49 ql/discretizedasset.hpp File Reference

10.49.1 Detailed Description

Discretized asset classes.


#include <ql/numericalmethod.hpp>
#include <ql/Math/comparison.hpp>
Include dependency graph for discretizedasset.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp list vector

ql/grid.hpp ql/handle.hpp

ql/numericalmethod.hpp ql/Math/comparison.hpp

discretizedasset.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


690 QuantLib File Documentation

10.50 ql/disposable.hpp File Reference

10.50.1 Detailed Description

generic disposable object with move semantics


#include <ql/qldefines.hpp>
Include dependency graph for disposable.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

disposable.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.51 ql/errors.hpp File Reference 691

10.51 ql/errors.hpp File Reference

10.51.1 Detailed Description

Classes and functions for error handling.


#include <ql/qldefines.hpp>
#include <exception>
#include <string>
Include dependency graph for errors.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp exception string

errors.hpp

Namespaces
• namespace QuantLib

Defines
• #define QL_FAIL(message)
throw an error (possibly with file and line information)

• #define QL_ASSERT(condition, description)


throw an error if the given condition is not verified

• #define QL_REQUIRE(condition, description)


throw an error if the given pre-condition is not verified

• #define QL_ENSURE(condition, description)


throw an error if the given post-condition is not verified

10.51.2 Define Documentation

10.51.2.1 #define QL_FAIL(message)

Value:

throw QuantLib::Error(\
QuantLib::Error::where(__FILE__,__LINE__) + message)

throw an error (possibly with file and line information)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


692 QuantLib File Documentation

10.51.2.2 #define QL_ASSERT(condition, description)

Value:

if (!(condition)) \
throw QuantLib::AssertionFailedError(\
QuantLib::Error::where(__FILE__,__LINE__) + description); \
else

throw an error if the given condition is not verified

10.51.2.3 #define QL_REQUIRE(condition, description)

Value:

if (!(condition)) \
throw QuantLib::PreconditionNotSatisfiedError(\
QuantLib::Error::where(__FILE__,__LINE__) + description); \
else

throw an error if the given pre-condition is not verified

Examples:
DiscreteHedging.cpp, and swapvaluation.cpp.

10.51.2.4 #define QL_ENSURE(condition, description)

Value:

if (!(condition)) \
throw QuantLib::PostconditionNotSatisfiedError(\
QuantLib::Error::where(__FILE__,__LINE__) + description); \
else

throw an error if the given post-condition is not verified

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.52 ql/exercise.hpp File Reference 693

10.52 ql/exercise.hpp File Reference

10.52.1 Detailed Description

Option exercise classes and payoff function.


#include <ql/date.hpp>
#include <vector>
Include dependency graph for exercise.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp utility functional

ql/date.hpp vector

exercise.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


694 QuantLib File Documentation

10.53 ql/FiniteDifferences/americancondition.hpp File Refer-


ence

10.53.1 Detailed Description

american option exercise condition


#include <ql/FiniteDifferences/fdtypedefs.hpp>
#include <ql/discretizedasset.hpp>
#include <ql/Instruments/payoffs.hpp>
Include dependency graph for americancondition.hpp:

ql/FiniteDifferences/mixedscheme.hpp ql/qldefines.hpp

ql/FiniteDifferences/cranknicolson.hpp ql/numericalmethod.hpp ql/Math/comparison.hpp ql/option.hpp

ql/FiniteDifferences/fdtypedefs.hpp ql/discretizedasset.hpp ql/Instruments/payoffs.hpp

americancondition.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.54 ql/FiniteDifferences/boundarycondition.hpp File Reference 695

10.54 ql/FiniteDifferences/boundarycondition.hpp File Refer-


ence

10.54.1 Detailed Description

boundary conditions for differential operators


#include <ql/null.hpp>
#include <ql/FiniteDifferences/tridiagonaloperator.hpp>
Include dependency graph for boundarycondition.hpp:

ql/qldefines.hpp ql/Math/array.hpp ql/handle.hpp

ql/null.hpp ql/FiniteDifferences/tridiagonaloperator.hpp

boundarycondition.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


696 QuantLib File Documentation

10.55 ql/FiniteDifferences/bsmoperator.hpp File Reference

10.55.1 Detailed Description

differential operator for Black-Scholes-Merton equation


#include <ql/FiniteDifferences/tridiagonaloperator.hpp>
Include dependency graph for bsmoperator.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/handle.hpp ql/Math/array.hpp

ql/FiniteDifferences/tridiagonaloperator.hpp

bsmoperator.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.56 ql/FiniteDifferences/cranknicolson.hpp File Reference 697

10.56 ql/FiniteDifferences/cranknicolson.hpp File Reference

10.56.1 Detailed Description

Crank-Nicolson scheme for finite difference methods.


#include <ql/FiniteDifferences/mixedscheme.hpp>
Include dependency graph for cranknicolson.hpp:

ql/Math/array.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp list vector

ql/grid.hpp ql/handle.hpp

ql/numericalmethod.hpp ql/FiniteDifferences/tridiagonaloperator.hpp ql/null.hpp

ql/FiniteDifferences/stepcondition.hpp ql/FiniteDifferences/boundarycondition.hpp

ql/FiniteDifferences/finitedifferencemodel.hpp

ql/FiniteDifferences/mixedscheme.hpp

cranknicolson.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


698 QuantLib File Documentation

10.57 ql/FiniteDifferences/dminus.hpp File Reference

10.57.1 Detailed Description

D− matricial representation
#include <ql/FiniteDifferences/tridiagonaloperator.hpp>
Include dependency graph for dminus.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/handle.hpp ql/Math/array.hpp

ql/FiniteDifferences/tridiagonaloperator.hpp

dminus.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.58 ql/FiniteDifferences/dplus.hpp File Reference 699

10.58 ql/FiniteDifferences/dplus.hpp File Reference

10.58.1 Detailed Description

D+ matricial representation
#include <ql/FiniteDifferences/tridiagonaloperator.hpp>
Include dependency graph for dplus.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/handle.hpp ql/Math/array.hpp

ql/FiniteDifferences/tridiagonaloperator.hpp

dplus.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


700 QuantLib File Documentation

10.59 ql/FiniteDifferences/dplusdminus.hpp File Reference

10.59.1 Detailed Description

D+ D− matricial representation
#include <ql/FiniteDifferences/tridiagonaloperator.hpp>
Include dependency graph for dplusdminus.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/handle.hpp ql/Math/array.hpp

ql/FiniteDifferences/tridiagonaloperator.hpp

dplusdminus.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.60 ql/FiniteDifferences/dzero.hpp File Reference 701

10.60 ql/FiniteDifferences/dzero.hpp File Reference

10.60.1 Detailed Description

D0 matricial representation
#include <ql/FiniteDifferences/tridiagonaloperator.hpp>
Include dependency graph for dzero.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/handle.hpp ql/Math/array.hpp

ql/FiniteDifferences/tridiagonaloperator.hpp

dzero.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


702 QuantLib File Documentation

10.61 ql/FiniteDifferences/expliciteuler.hpp File Reference

10.61.1 Detailed Description

explicit Euler scheme for finite difference methods


#include <ql/FiniteDifferences/mixedscheme.hpp>
Include dependency graph for expliciteuler.hpp:

ql/Math/array.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp list vector

ql/grid.hpp ql/handle.hpp

ql/numericalmethod.hpp ql/FiniteDifferences/tridiagonaloperator.hpp ql/null.hpp

ql/FiniteDifferences/stepcondition.hpp ql/FiniteDifferences/boundarycondition.hpp

ql/FiniteDifferences/finitedifferencemodel.hpp

ql/FiniteDifferences/mixedscheme.hpp

expliciteuler.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.62 ql/FiniteDifferences/fdtypedefs.hpp File Reference 703

10.62 ql/FiniteDifferences/fdtypedefs.hpp File Reference

10.62.1 Detailed Description

default choices for template instantiations


#include <ql/FiniteDifferences/cranknicolson.hpp>
Include dependency graph for fdtypedefs.hpp:

ql/dataformatters.hpp list vector

ql/grid.hpp ql/handle.hpp ql/Math/array.hpp

ql/numericalmethod.hpp ql/FiniteDifferences/tridiagonaloperator.hpp ql/null.hpp

ql/FiniteDifferences/stepcondition.hpp ql/FiniteDifferences/boundarycondition.hpp

ql/FiniteDifferences/finitedifferencemodel.hpp

ql/FiniteDifferences/mixedscheme.hpp

ql/FiniteDifferences/cranknicolson.hpp

fdtypedefs.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


704 QuantLib File Documentation

10.63 ql/FiniteDifferences/finitedifferencemodel.hpp File Ref-


erence

10.63.1 Detailed Description

generic finite difference model


#include <ql/FiniteDifferences/stepcondition.hpp>
#include <ql/FiniteDifferences/boundarycondition.hpp>
Include dependency graph for finitedifferencemodel.hpp:

ql/Math/array.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp list vector

ql/grid.hpp ql/handle.hpp

ql/numericalmethod.hpp ql/FiniteDifferences/tridiagonaloperator.hpp ql/null.hpp

ql/FiniteDifferences/stepcondition.hpp ql/FiniteDifferences/boundarycondition.hpp

finitedifferencemodel.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.64 ql/FiniteDifferences/impliciteuler.hpp File Reference 705

10.64 ql/FiniteDifferences/impliciteuler.hpp File Reference

10.64.1 Detailed Description

implicit Euler scheme for finite difference methods


#include <ql/FiniteDifferences/mixedscheme.hpp>
Include dependency graph for impliciteuler.hpp:

ql/Math/array.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp list vector

ql/grid.hpp ql/handle.hpp

ql/numericalmethod.hpp ql/FiniteDifferences/tridiagonaloperator.hpp ql/null.hpp

ql/FiniteDifferences/stepcondition.hpp ql/FiniteDifferences/boundarycondition.hpp

ql/FiniteDifferences/finitedifferencemodel.hpp

ql/FiniteDifferences/mixedscheme.hpp

impliciteuler.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


706 QuantLib File Documentation

10.65 ql/FiniteDifferences/mixedscheme.hpp File Reference

10.65.1 Detailed Description

Mixed (explicit/implicit) scheme for finite difference methods.


#include <ql/FiniteDifferences/finitedifferencemodel.hpp>
Include dependency graph for mixedscheme.hpp:

ql/Math/array.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp list vector

ql/grid.hpp ql/handle.hpp

ql/numericalmethod.hpp ql/FiniteDifferences/tridiagonaloperator.hpp ql/null.hpp

ql/FiniteDifferences/stepcondition.hpp ql/FiniteDifferences/boundarycondition.hpp

ql/FiniteDifferences/finitedifferencemodel.hpp

mixedscheme.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.66 ql/FiniteDifferences/onefactoroperator.hpp File Reference 707

10.66 ql/FiniteDifferences/onefactoroperator.hpp File Reference

10.66.1 Detailed Description

general differential operator for one-factor interest rate models


#include <ql/FiniteDifferences/tridiagonaloperator.hpp>
#include <ql/ShortRateModels/onefactormodel.hpp>
Include dependency graph for onefactoroperator.hpp:

ql/FiniteDifferences/tridiagonaloperator.hpp ql/ShortRateModels/onefactormodel.hpp

onefactoroperator.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


708 QuantLib File Documentation

10.67 ql/FiniteDifferences/shoutcondition.hpp File Reference

10.67.1 Detailed Description

shout option exercise condition


#include <ql/FiniteDifferences/fdtypedefs.hpp>
#include <ql/discretizedasset.hpp>
Include dependency graph for shoutcondition.hpp:

ql/qldefines.hpp

ql/numericalmethod.hpp ql/Math/comparison.hpp

ql/FiniteDifferences/stepcondition.hpp ql/FiniteDifferences/boundarycondition.hpp ql/discretizedasset.hpp

ql/FiniteDifferences/finitedifferencemodel.hpp

ql/FiniteDifferences/mixedscheme.hpp

ql/FiniteDifferences/cranknicolson.hpp

ql/FiniteDifferences/fdtypedefs.hpp

shoutcondition.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.68 ql/FiniteDifferences/stepcondition.hpp File Reference 709

10.68 ql/FiniteDifferences/stepcondition.hpp File Reference

10.68.1 Detailed Description

conditions to be applied at every time step


#include <ql/numericalmethod.hpp>
Include dependency graph for stepcondition.hpp:

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp list vector

ql/grid.hpp ql/handle.hpp

ql/numericalmethod.hpp

stepcondition.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


710 QuantLib File Documentation

10.69 ql/FiniteDifferences/tridiagonaloperator.hpp File Refer-


ence

10.69.1 Detailed Description

tridiagonal operator
#include <ql/Math/array.hpp>
#include <ql/handle.hpp>
Include dependency graph for tridiagonaloperator.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/handle.hpp ql/Math/array.hpp

tridiagonaloperator.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.70 ql/FiniteDifferences/valueatcenter.hpp File Reference 711

10.70 ql/FiniteDifferences/valueatcenter.hpp File Reference

10.70.1 Detailed Description

compute value, first, and second derivatives at grid center


#include <ql/Math/array.hpp>
Include dependency graph for valueatcenter.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/Math/array.hpp

valueatcenter.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


712 QuantLib File Documentation

10.71 ql/functions/daycounters.hpp File Reference

10.71.1 Detailed Description

day counters functions


#include <ql/daycounter.hpp>
Include dependency graph for daycounters.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp

ql/daycounter.hpp

daycounters.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.72 ql/functions/mathf.hpp File Reference 713

10.72 ql/functions/mathf.hpp File Reference

10.72.1 Detailed Description

math functions
#include <ql/Math/matrix.hpp>
#include <ql/Math/loglinearinterpolation.hpp>
#include <ql/Math/cubicspline.hpp>
Include dependency graph for mathf.hpp:

ql/Math/matrix.hpp ql/Math/loglinearinterpolation.hpp ql/Math/cubicspline.hpp

mathf.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


714 QuantLib File Documentation

10.73 ql/functions/vols.hpp File Reference

10.73.1 Detailed Description

Volatility functions.
#include <ql/Math/matrix.hpp>
#include <ql/daycounter.hpp>
#include <vector>
Include dependency graph for vols.hpp:

ql/qldefines.hpp

utility ql/errors.hpp ql/types.hpp functional ql/disposable.hpp numeric iostream

ql/handle.hpp ql/date.hpp ql/Math/array.hpp ql/Utilities/steppingiterator.hpp

ql/Patterns/bridge.hpp ql/Math/matrix.hpp

ql/daycounter.hpp vector

vols.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.74 ql/grid.hpp File Reference 715

10.74 ql/grid.hpp File Reference

10.74.1 Detailed Description

Grid classes with useful constructors for trees and finite diffs.
#include <ql/dataformatters.hpp>
#include <list>
#include <vector>
Include dependency graph for grid.hpp:

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp list vector

grid.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


716 QuantLib File Documentation

10.75 ql/handle.hpp File Reference

10.75.1 Detailed Description

Reference-counted pointer.
#include <ql/errors.hpp>
#include <typeinfo>
Include dependency graph for handle.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp exception string

ql/errors.hpp typeinfo

handle.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.76 ql/history.hpp File Reference 717

10.76 ql/history.hpp File Reference

10.76.1 Detailed Description

history class
#include <ql/null.hpp>
#include <ql/Utilities/filteringiterator.hpp>
#include <ql/dataformatters.hpp>
#include <vector>
Include dependency graph for history.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/null.hpp ql/Utilities/filteringiterator.hpp ql/dataformatters.hpp vector

history.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


718 QuantLib File Documentation

10.77 ql/index.hpp File Reference

10.77.1 Detailed Description

purely virtual base class for indexes


#include <ql/calendar.hpp>
#include <ql/currency.hpp>
#include <ql/daycounter.hpp>
#include <ql/Patterns/observable.hpp>
Include dependency graph for index.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

string exception ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

list ql/handle.hpp ql/date.hpp

ql/Patterns/observable.hpp ql/Patterns/bridge.hpp ql/currency.hpp

ql/daycounter.hpp ql/calendar.hpp

index.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.78 ql/Indexes/audlibor.hpp File Reference 719

10.78 ql/Indexes/audlibor.hpp File Reference

10.78.1 Detailed Description

AUD Libor index (check settlement days)


#include <ql/Indexes/xibor.hpp>
#include <ql/Calendars/sydney.hpp>
#include <ql/DayCounters/actual365.hpp>
Include dependency graph for audlibor.hpp:

ql/calendar.hpp ql/daycounter.hpp

ql/index.hpp ql/termstructure.hpp

ql/Calendars/sydney.hpp ql/Indexes/xibor.hpp ql/DayCounters/actual365.hpp

audlibor.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


720 QuantLib File Documentation

10.79 ql/Indexes/cadlibor.hpp File Reference

10.79.1 Detailed Description

CAD Libor index (Also known as CDOR)


#include <ql/Indexes/xibor.hpp>
#include <ql/Calendars/toronto.hpp>
#include <ql/DayCounters/actual365.hpp>
Include dependency graph for cadlibor.hpp:

ql/calendar.hpp ql/daycounter.hpp

ql/index.hpp ql/termstructure.hpp

ql/Calendars/toronto.hpp ql/Indexes/xibor.hpp ql/DayCounters/actual365.hpp

cadlibor.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.80 ql/Indexes/chflibor.hpp File Reference 721

10.80 ql/Indexes/chflibor.hpp File Reference

10.80.1 Detailed Description

CHF Libor index (Also known as ZIBOR)


#include <ql/Indexes/xibor.hpp>
#include <ql/Calendars/zurich.hpp>
#include <ql/DayCounters/actual360.hpp>
Include dependency graph for chflibor.hpp:

ql/calendar.hpp ql/daycounter.hpp

ql/index.hpp ql/termstructure.hpp

ql/Calendars/zurich.hpp ql/Indexes/xibor.hpp ql/DayCounters/actual360.hpp

chflibor.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


722 QuantLib File Documentation

10.81 ql/Indexes/euribor.hpp File Reference

10.81.1 Detailed Description

Euribor index
#include <ql/Indexes/xibor.hpp>
#include <ql/Calendars/target.hpp>
#include <ql/DayCounters/actual360.hpp>
Include dependency graph for euribor.hpp:

ql/calendar.hpp ql/daycounter.hpp

ql/index.hpp ql/termstructure.hpp

ql/Calendars/target.hpp ql/Indexes/xibor.hpp ql/DayCounters/actual360.hpp

euribor.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.82 ql/Indexes/gbplibor.hpp File Reference 723

10.82 ql/Indexes/gbplibor.hpp File Reference

10.82.1 Detailed Description

GBP Libor index


#include <ql/Indexes/xibor.hpp>
#include <ql/Calendars/london.hpp>
#include <ql/DayCounters/actual365.hpp>
Include dependency graph for gbplibor.hpp:

ql/calendar.hpp ql/daycounter.hpp

ql/index.hpp ql/termstructure.hpp

ql/Calendars/london.hpp ql/Indexes/xibor.hpp ql/DayCounters/actual365.hpp

gbplibor.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


724 QuantLib File Documentation

10.83 ql/Indexes/jpylibor.hpp File Reference

10.83.1 Detailed Description

JPY Libor index (Also known as TIBOR, check settlement days)


#include <ql/Indexes/xibor.hpp>
#include <ql/Calendars/tokyo.hpp>
#include <ql/DayCounters/actual360.hpp>
Include dependency graph for jpylibor.hpp:

ql/calendar.hpp ql/daycounter.hpp

ql/index.hpp ql/termstructure.hpp

ql/Calendars/tokyo.hpp ql/Indexes/xibor.hpp ql/DayCounters/actual360.hpp

jpylibor.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.84 ql/Indexes/usdlibor.hpp File Reference 725

10.84 ql/Indexes/usdlibor.hpp File Reference

10.84.1 Detailed Description

USD Libor index


#include <ql/Indexes/xibor.hpp>
#include <ql/Calendars/newyork.hpp>
#include <ql/DayCounters/actual360.hpp>
Include dependency graph for usdlibor.hpp:

ql/calendar.hpp ql/daycounter.hpp

ql/index.hpp ql/termstructure.hpp

ql/Calendars/newyork.hpp ql/Indexes/xibor.hpp ql/DayCounters/actual360.hpp

usdlibor.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


726 QuantLib File Documentation

10.85 ql/Indexes/xibor.hpp File Reference

10.85.1 Detailed Description

base class for libor indexes


#include <ql/index.hpp>
#include <ql/termstructure.hpp>
Include dependency graph for xibor.hpp:

ql/index.hpp ql/termstructure.hpp

xibor.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.86 ql/Indexes/xibormanager.hpp File Reference 727

10.86 ql/Indexes/xibormanager.hpp File Reference

10.86.1 Detailed Description

global repository for Xibor histories


#include <ql/history.hpp>
#include <ql/termstructure.hpp>
#include <map>
Include dependency graph for xibormanager.hpp:

ql/history.hpp ql/termstructure.hpp map

xibormanager.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


728 QuantLib File Documentation

10.87 ql/Indexes/zarlibor.hpp File Reference

10.87.1 Detailed Description

ZAR Libor index (also known as JIBAR)


#include <ql/Indexes/xibor.hpp>
#include <ql/Calendars/johannesburg.hpp>
#include <ql/DayCounters/actual365.hpp>
Include dependency graph for zarlibor.hpp:

ql/calendar.hpp ql/daycounter.hpp

ql/index.hpp ql/termstructure.hpp

ql/Calendars/johannesburg.hpp ql/Indexes/xibor.hpp ql/DayCounters/actual365.hpp

zarlibor.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.88 ql/instrument.hpp File Reference 729

10.88 ql/instrument.hpp File Reference

10.88.1 Detailed Description

Abstract instrument class.


#include <ql/Patterns/lazyobject.hpp>
#include <ql/pricingengine.hpp>
Include dependency graph for instrument.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp

ql/handle.hpp list ql/null.hpp

ql/Patterns/observable.hpp ql/argsandresults.hpp

ql/Patterns/lazyobject.hpp ql/pricingengine.hpp

instrument.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


730 QuantLib File Documentation

10.89 ql/Instruments/asianoption.hpp File Reference

10.89.1 Detailed Description

Asian option on a single asset.


#include <ql/Instruments/oneassetstrikedoption.hpp>
#include <vector>
Include dependency graph for asianoption.hpp:

ql/stochasticprocess.hpp ql/option.hpp

ql/Instruments/oneassetoption.hpp ql/Instruments/payoffs.hpp

ql/Instruments/oneassetstrikedoption.hpp vector

asianoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.90 ql/Instruments/barrieroption.hpp File Reference 731

10.90 ql/Instruments/barrieroption.hpp File Reference

10.90.1 Detailed Description

Barrier option on a single asset.


#include <ql/Instruments/oneassetstrikedoption.hpp>
Include dependency graph for barrieroption.hpp:

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp

ql/Instruments/payoffs.hpp ql/Instruments/oneassetoption.hpp

ql/Instruments/oneassetstrikedoption.hpp

barrieroption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


732 QuantLib File Documentation

10.91 ql/Instruments/basketoption.hpp File Reference

10.91.1 Detailed Description

Basket option on a number of assets.


#include <ql/Instruments/payoffs.hpp>
#include <ql/Instruments/multiassetoption.hpp>
Include dependency graph for basketoption.hpp:

ql/termstructure.hpp ql/voltermstructure.hpp ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp

ql/stochasticprocess.hpp ql/option.hpp

ql/Instruments/multiassetoption.hpp ql/Instruments/payoffs.hpp

basketoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.92 ql/Instruments/capfloor.hpp File Reference 733

10.92 ql/Instruments/capfloor.hpp File Reference

10.92.1 Detailed Description

Cap and Floor class.


#include <ql/numericalmethod.hpp>
#include <ql/instrument.hpp>
#include <ql/cashflow.hpp>
#include <ql/termstructure.hpp>
Include dependency graph for capfloor.hpp:

ql/numericalmethod.hpp ql/instrument.hpp ql/cashflow.hpp ql/termstructure.hpp

capfloor.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


734 QuantLib File Documentation

10.93 ql/Instruments/cliquetoption.hpp File Reference

10.93.1 Detailed Description

Cliquet option.
#include <ql/Instruments/vanillaoption.hpp>
Include dependency graph for cliquetoption.hpp:

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp

ql/Instruments/payoffs.hpp ql/Instruments/oneassetoption.hpp

ql/Instruments/oneassetstrikedoption.hpp

ql/Instruments/vanillaoption.hpp

cliquetoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.94 ql/Pricers/cliquetoption.hpp File Reference 735

10.94 ql/Pricers/cliquetoption.hpp File Reference

10.94.1 Detailed Description

Cliquet option.
#include <ql/Pricers/europeanoption.hpp>
Include dependency graph for cliquetoption.hpp:

ql/qldefines.hpp functional

ql/option.hpp ql/currency.hpp ql/Math/matrix.hpp ql/Math/errorfunction.hpp

ql/Instruments/payoffs.hpp ql/dataformatters.hpp

ql/Pricers/singleassetoption.hpp ql/Math/normaldistribution.hpp

ql/Pricers/europeanoption.hpp

cliquetoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


736 QuantLib File Documentation

10.95 ql/Instruments/forwardvanillaoption.hpp File Reference

10.95.1 Detailed Description

Forward version of a vanilla option.


#include <ql/Instruments/vanillaoption.hpp>
Include dependency graph for forwardvanillaoption.hpp:

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp

ql/Instruments/payoffs.hpp ql/Instruments/oneassetoption.hpp

ql/Instruments/oneassetstrikedoption.hpp

ql/Instruments/vanillaoption.hpp

forwardvanillaoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.96 ql/Instruments/multiassetoption.hpp File Reference 737

10.96 ql/Instruments/multiassetoption.hpp File Reference

10.96.1 Detailed Description

Option on multiple assets.


#include <ql/option.hpp>
#include <ql/stochasticprocess.hpp>
Include dependency graph for multiassetoption.hpp:

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp

multiassetoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


738 QuantLib File Documentation

10.97 ql/Instruments/oneassetoption.hpp File Reference

10.97.1 Detailed Description

Option on a single asset.


#include <ql/option.hpp>
#include <ql/stochasticprocess.hpp>
Include dependency graph for oneassetoption.hpp:

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp

oneassetoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.98 ql/Instruments/oneassetstrikedoption.hpp File Reference 739

10.98 ql/Instruments/oneassetstrikedoption.hpp File Reference

10.98.1 Detailed Description

Option on a single asset with striked payoff.


#include <ql/Instruments/oneassetoption.hpp>
#include <ql/Instruments/payoffs.hpp>
Include dependency graph for oneassetstrikedoption.hpp:

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp

ql/Instruments/payoffs.hpp ql/Instruments/oneassetoption.hpp

oneassetstrikedoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


740 QuantLib File Documentation

10.99 ql/Instruments/payoffs.hpp File Reference

10.99.1 Detailed Description

Payoffs for various options.


#include <ql/option.hpp>
Include dependency graph for payoffs.hpp:

ql/qldefines.hpp functional

ql/Patterns/lazyobject.hpp ql/pricingengine.hpp ql/payoff.hpp ql/date.hpp vector

ql/instrument.hpp ql/exercise.hpp

ql/option.hpp

payoffs.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.100 ql/Instruments/quantoforwardvanillaoption.hpp File Reference 741

10.100 ql/Instruments/quantoforwardvanillaoption.hpp File


Reference

10.100.1 Detailed Description

Quanto version of a forward vanilla option.


#include <ql/Instruments/quantovanillaoption.hpp>
#include <ql/Instruments/forwardvanillaoption.hpp>
Include dependency graph for quantoforwardvanillaoption.hpp:

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp

ql/Instruments/payoffs.hpp ql/Instruments/oneassetoption.hpp

ql/Instruments/oneassetstrikedoption.hpp

ql/Instruments/vanillaoption.hpp

ql/Instruments/quantovanillaoption.hpp ql/Instruments/forwardvanillaoption.hpp

quantoforwardvanillaoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


742 QuantLib File Documentation

10.101 ql/Instruments/quantovanillaoption.hpp File Reference

10.101.1 Detailed Description

Quanto version of a vanilla option.


#include <ql/Instruments/vanillaoption.hpp>
Include dependency graph for quantovanillaoption.hpp:

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp

ql/Instruments/payoffs.hpp ql/Instruments/oneassetoption.hpp

ql/Instruments/oneassetstrikedoption.hpp

ql/Instruments/vanillaoption.hpp

quantovanillaoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.102 ql/Instruments/simpleswap.hpp File Reference 743

10.102 ql/Instruments/simpleswap.hpp File Reference

10.102.1 Detailed Description

Simple fixed-rate vs Libor swap.


#include <ql/Instruments/swap.hpp>
#include <ql/Indexes/xibor.hpp>
#include <ql/scheduler.hpp>
Include dependency graph for simpleswap.hpp:

ql/Instruments/swap.hpp ql/Indexes/xibor.hpp ql/scheduler.hpp

simpleswap.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


744 QuantLib File Documentation

10.103 ql/Instruments/stock.hpp File Reference

10.103.1 Detailed Description

concrete stock class


#include <ql/instrument.hpp>
#include <ql/marketelement.hpp>
Include dependency graph for stock.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

string exception ql/qldefines.hpp

typeinfo ql/errors.hpp

list ql/handle.hpp ql/null.hpp

ql/Patterns/observable.hpp ql/argsandresults.hpp

ql/relinkablehandle.hpp ql/Patterns/lazyobject.hpp ql/pricingengine.hpp

ql/marketelement.hpp ql/instrument.hpp

stock.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.104 ql/Instruments/swap.hpp File Reference 745

10.104 ql/Instruments/swap.hpp File Reference

10.104.1 Detailed Description

Interest rate swap.


#include <ql/instrument.hpp>
#include <ql/termstructure.hpp>
#include <ql/cashflow.hpp>
#include <ql/CashFlows/timebasket.hpp>
Include dependency graph for swap.hpp:

ql/instrument.hpp ql/termstructure.hpp ql/cashflow.hpp ql/CashFlows/timebasket.hpp

swap.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


746 QuantLib File Documentation

10.105 ql/Instruments/swaption.hpp File Reference

10.105.1 Detailed Description

Swaption class.
#include <ql/numericalmethod.hpp>
#include <ql/option.hpp>
#include <ql/Instruments/simpleswap.hpp>
Include dependency graph for swaption.hpp:

ql/grid.hpp ql/handle.hpp ql/Instruments/swap.hpp ql/Indexes/xibor.hpp ql/scheduler.hpp

ql/numericalmethod.hpp ql/option.hpp ql/Instruments/simpleswap.hpp

swaption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.106 ql/Instruments/vanillaoption.hpp File Reference 747

10.106 ql/Instruments/vanillaoption.hpp File Reference

10.106.1 Detailed Description

Vanilla option on a single asset.


#include <ql/Instruments/oneassetstrikedoption.hpp>
Include dependency graph for vanillaoption.hpp:

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp

ql/Instruments/payoffs.hpp ql/Instruments/oneassetoption.hpp

ql/Instruments/oneassetstrikedoption.hpp

vanillaoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


748 QuantLib File Documentation

10.107 ql/Lattices/binomialtree.hpp File Reference

10.107.1 Detailed Description

Binomial tree class.


#include <ql/diffusionprocess.hpp>
#include <ql/Lattices/tree.hpp>
Include dependency graph for binomialtree.hpp:

ql/termstructure.hpp ql/voltermstructure.hpp ql/numericalmethod.hpp

ql/diffusionprocess.hpp ql/Lattices/tree.hpp

binomialtree.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.108 ql/Lattices/bsmlattice.hpp File Reference 749

10.108 ql/Lattices/bsmlattice.hpp File Reference

10.108.1 Detailed Description

Binomial trees under the BSM model.


#include <ql/Lattices/tree.hpp>
#include <ql/Lattices/lattice.hpp>
Include dependency graph for bsmlattice.hpp:

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp list vector

ql/grid.hpp ql/handle.hpp

ql/numericalmethod.hpp

ql/Lattices/tree.hpp ql/Lattices/lattice.hpp

bsmlattice.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


750 QuantLib File Documentation

10.109 ql/Lattices/lattice.hpp File Reference

10.109.1 Detailed Description

Lattice method class.


#include <ql/numericalmethod.hpp>
Include dependency graph for lattice.hpp:

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp list vector

ql/grid.hpp ql/handle.hpp

ql/numericalmethod.hpp

lattice.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.110 ql/Lattices/lattice2d.hpp File Reference 751

10.110 ql/Lattices/lattice2d.hpp File Reference

10.110.1 Detailed Description

Two-dimensional tree class.


#include <ql/Lattices/lattice.hpp>
#include <ql/Lattices/trinomialtree.hpp>
#include <ql/Math/matrix.hpp>
Include dependency graph for lattice2d.hpp:

ql/grid.hpp ql/handle.hpp

ql/termstructure.hpp ql/voltermstructure.hpp ql/numericalmethod.hpp

ql/diffusionprocess.hpp ql/Lattices/tree.hpp

ql/Lattices/trinomialtree.hpp ql/Lattices/lattice.hpp ql/Math/matrix.hpp

lattice2d.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


752 QuantLib File Documentation

10.111 ql/Lattices/tree.hpp File Reference

10.111.1 Detailed Description

Tree class.
#include <ql/numericalmethod.hpp>
Include dependency graph for tree.hpp:

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp list vector

ql/grid.hpp ql/handle.hpp

ql/numericalmethod.hpp

tree.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.112 ql/Lattices/trinomialtree.hpp File Reference 753

10.112 ql/Lattices/trinomialtree.hpp File Reference

10.112.1 Detailed Description

Trinomial tree class.


#include <ql/diffusionprocess.hpp>
#include <ql/Lattices/tree.hpp>
Include dependency graph for trinomialtree.hpp:

ql/termstructure.hpp ql/voltermstructure.hpp ql/numericalmethod.hpp

ql/diffusionprocess.hpp ql/Lattices/tree.hpp

trinomialtree.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


754 QuantLib File Documentation

10.113 ql/marketelement.hpp File Reference

10.113.1 Detailed Description

purely virtual base class for market observables


#include <ql/relinkablehandle.hpp>
Include dependency graph for marketelement.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp exception string

ql/errors.hpp typeinfo

ql/handle.hpp list

ql/Patterns/observable.hpp

ql/relinkablehandle.hpp

marketelement.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.114 ql/Math/array.hpp File Reference 755

10.114 ql/Math/array.hpp File Reference

10.114.1 Detailed Description

1-D array used in linear algebra.


#include <ql/types.hpp>
#include <ql/errors.hpp>
#include <ql/disposable.hpp>
#include <functional>
#include <numeric>
#include <iostream>
Include dependency graph for array.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

array.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


756 QuantLib File Documentation

10.115 ql/Math/beta.hpp File Reference

10.115.1 Detailed Description

Beta and beta incomplete functions.


#include <ql/Math/gammadistribution.hpp>
Include dependency graph for beta.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp functional

ql/Math/gammadistribution.hpp

beta.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.116 ql/Math/bicubicsplineinterpolation.hpp File Reference 757

10.116 ql/Math/bicubicsplineinterpolation.hpp File Reference

10.116.1 Detailed Description

bicubic spline interpolation between discrete points


#include <ql/Math/interpolation2D.hpp>
#include <ql/Math/cubicspline.hpp>
Include dependency graph for bicubicsplineinterpolation.hpp:

ql/Math/interpolation2D.hpp ql/Math/cubicspline.hpp

bicubicsplineinterpolation.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


758 QuantLib File Documentation

10.117 ql/Math/bilinearinterpolation.hpp File Reference

10.117.1 Detailed Description

bilinear interpolation between discrete points


#include <ql/Math/interpolation2D.hpp>
Include dependency graph for bilinearinterpolation.hpp:

ql/qldefines.hpp

typeinfo ql/errors.hpp ql/payoff.hpp ql/instrument.hpp ql/exercise.hpp

ql/handle.hpp ql/Math/array.hpp ql/Utilities/steppingiterator.hpp ql/option.hpp

ql/Math/matrix.hpp ql/currency.hpp

ql/Patterns/bridge.hpp ql/dataformatters.hpp

ql/Math/interpolation2D.hpp

bilinearinterpolation.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.118 ql/Math/binomialdistribution.hpp File Reference 759

10.118 ql/Math/binomialdistribution.hpp File Reference

10.118.1 Detailed Description

Binomial distribution.
#include <ql/Math/factorial.hpp>
#include <ql/Math/beta.hpp>
Include dependency graph for binomialdistribution.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp exception string

ql/types.hpp ql/errors.hpp functional

ql/Math/gammadistribution.hpp

ql/Math/factorial.hpp ql/Math/beta.hpp

binomialdistribution.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


760 QuantLib File Documentation

10.119 ql/Math/bivariatenormaldistribution.hpp File Reference

10.119.1 Detailed Description

bivariate cumulative normal distribution


#include <ql/dataformatters.hpp>
Include dependency graph for bivariatenormaldistribution.hpp:

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp

bivariatenormaldistribution.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.120 ql/Math/chisquaredistribution.hpp File Reference 761

10.120 ql/Math/chisquaredistribution.hpp File Reference

10.120.1 Detailed Description

Chi-square (central and non-central) distributions.


#include <ql/dataformatters.hpp>
Include dependency graph for chisquaredistribution.hpp:

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp

chisquaredistribution.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


762 QuantLib File Documentation

10.121 ql/Math/choleskydecomposition.hpp File Reference

10.121.1 Detailed Description

Cholesky decomposition.
#include <ql/Math/matrix.hpp>
Include dependency graph for choleskydecomposition.hpp:

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/Math/array.hpp ql/Utilities/steppingiterator.hpp

ql/Math/matrix.hpp

choleskydecomposition.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.122 ql/Math/comparison.hpp File Reference 763

10.122 ql/Math/comparison.hpp File Reference

10.122.1 Detailed Description

floating-point comparisons
#include <ql/qldefines.hpp>
Include dependency graph for comparison.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

comparison.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


764 QuantLib File Documentation

10.123 ql/Math/cubicspline.hpp File Reference

10.123.1 Detailed Description

cubic spline interpolation between discrete points


#include <ql/Math/interpolation.hpp>
#include <ql/FiniteDifferences/tridiagonaloperator.hpp>
#include <ql/null.hpp>
#include <vector>
Include dependency graph for cubicspline.hpp:

ql/Math/array.hpp

ql/Math/matrix.hpp ql/currency.hpp ql/option.hpp ql/handle.hpp

ql/dataformatters.hpp ql/Patterns/bridge.hpp ql/FiniteDifferences/tridiagonaloperator.hpp

ql/Math/interpolation.hpp ql/null.hpp vector

cubicspline.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.124 ql/Math/discrepancystatistics.hpp File Reference 765

10.124 ql/Math/discrepancystatistics.hpp File Reference

10.124.1 Detailed Description

Statistic tool for sequences with discrepancy calculation.


#include <ql/Math/sequencestatistics.hpp>
Include dependency graph for discrepancystatistics.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/null.hpp ql/dataformatters.hpp

ql/Math/generalstatistics.hpp

ql/Math/statistics.hpp

ql/Math/sequencestatistics.hpp

discrepancystatistics.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


766 QuantLib File Documentation

10.125 ql/Math/errorfunction.hpp File Reference

10.125.1 Detailed Description

Error function.
#include <ql/qldefines.hpp>
#include <functional>
Include dependency graph for errorfunction.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp functional

errorfunction.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.126 ql/Math/factorial.hpp File Reference 767

10.126 ql/Math/factorial.hpp File Reference

10.126.1 Detailed Description

Factorial numbers calculator.


#include <ql/types.hpp>
Include dependency graph for factorial.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

ql/types.hpp

factorial.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


768 QuantLib File Documentation

10.127 ql/Math/functional.hpp File Reference

10.127.1 Detailed Description

functionals and combinators not included in the STL


#include <ql/qldefines.hpp>
#include <functional>
Include dependency graph for functional.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp functional

functional.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.128 ql/Math/gammadistribution.hpp File Reference 769

10.128 ql/Math/gammadistribution.hpp File Reference

10.128.1 Detailed Description

Gamma distribution.
#include <ql/errors.hpp>
#include <ql/types.hpp>
#include <functional>
Include dependency graph for gammadistribution.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp functional

gammadistribution.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


770 QuantLib File Documentation

10.129 ql/Math/gaussianstatistics.hpp File Reference

10.129.1 Detailed Description

statistics tool for gaussian-assumption risk measures


#include <ql/Math/normaldistribution.hpp>
Include dependency graph for gaussianstatistics.hpp:

ql/qldefines.hpp functional

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp ql/Math/errorfunction.hpp

ql/dataformatters.hpp

ql/Math/normaldistribution.hpp

gaussianstatistics.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.130 ql/Math/generalstatistics.hpp File Reference 771

10.130 ql/Math/generalstatistics.hpp File Reference

10.130.1 Detailed Description

statistics tool
#include <ql/null.hpp>
#include <ql/dataformatters.hpp>
Include dependency graph for generalstatistics.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/null.hpp ql/dataformatters.hpp

generalstatistics.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


772 QuantLib File Documentation

10.131 ql/Math/incompletegamma.hpp File Reference

10.131.1 Detailed Description

Incomplete Gamma function.


#include <ql/errors.hpp>
#include <ql/types.hpp>
#include <functional>
Include dependency graph for incompletegamma.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp functional

incompletegamma.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.132 ql/Math/incrementalstatistics.hpp File Reference 773

10.132 ql/Math/incrementalstatistics.hpp File Reference

10.132.1 Detailed Description

statistics tool based on incremental accumulation


#include <ql/null.hpp>
#include <ql/dataformatters.hpp>
Include dependency graph for incrementalstatistics.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/null.hpp ql/dataformatters.hpp

incrementalstatistics.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


774 QuantLib File Documentation

10.133 ql/Math/interpolation.hpp File Reference

10.133.1 Detailed Description

base class for 1-D interpolations


#include <ql/Patterns/bridge.hpp>
#include <ql/dataformatters.hpp>
Include dependency graph for interpolation.hpp:

ql/qldefines.hpp

typeinfo ql/errors.hpp ql/payoff.hpp ql/instrument.hpp ql/exercise.hpp

ql/handle.hpp ql/Math/array.hpp ql/Utilities/steppingiterator.hpp ql/option.hpp

ql/Math/matrix.hpp ql/currency.hpp

ql/Patterns/bridge.hpp ql/dataformatters.hpp

interpolation.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.134 ql/Math/interpolation2D.hpp File Reference 775

10.134 ql/Math/interpolation2D.hpp File Reference

10.134.1 Detailed Description

abstract base classes for 2-D interpolations


#include <ql/Patterns/bridge.hpp>
#include <ql/dataformatters.hpp>
Include dependency graph for interpolation2D.hpp:

ql/qldefines.hpp

typeinfo ql/errors.hpp ql/payoff.hpp ql/instrument.hpp ql/exercise.hpp

ql/handle.hpp ql/Math/array.hpp ql/Utilities/steppingiterator.hpp ql/option.hpp

ql/Math/matrix.hpp ql/currency.hpp

ql/Patterns/bridge.hpp ql/dataformatters.hpp

interpolation2D.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


776 QuantLib File Documentation

10.135 ql/Math/interpolationtraits.hpp File Reference

10.135.1 Detailed Description

traits classes for interpolation algorithms


#include <ql/Math/loglinearinterpolation.hpp>
#include <ql/Math/bilinearinterpolation.hpp>
#include <ql/Math/bicubicsplineinterpolation.hpp>
Include dependency graph for interpolationtraits.hpp:

ql/Math/linearinterpolation.hpp vector

ql/Math/loglinearinterpolation.hpp ql/Math/cubicspline.hpp ql/Math/interpolation2D.hpp

ql/Math/bicubicsplineinterpolation.hpp ql/Math/bilinearinterpolation.hpp

interpolationtraits.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.136 ql/Math/kronrodintegral.hpp File Reference 777

10.136 ql/Math/kronrodintegral.hpp File Reference

10.136.1 Detailed Description

Integral of a 1-dimensional function using the Gauss-Kronrod method.


#include <ql/errors.hpp>
#include <ql/dataformatters.hpp>
Include dependency graph for kronrodintegral.hpp:

exception string ql/qldefines.hpp

ql/errors.hpp ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp

kronrodintegral.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


778 QuantLib File Documentation

10.137 ql/Math/lexicographicalview.hpp File Reference

10.137.1 Detailed Description

Lexicographical 2-D view of a contiguous set of data.


#include <ql/Utilities/steppingiterator.hpp>
Include dependency graph for lexicographicalview.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

ql/Utilities/steppingiterator.hpp

lexicographicalview.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.138 ql/Math/linearinterpolation.hpp File Reference 779

10.138 ql/Math/linearinterpolation.hpp File Reference

10.138.1 Detailed Description

linear interpolation between discrete points


#include <ql/Math/interpolation.hpp>
Include dependency graph for linearinterpolation.hpp:

ql/qldefines.hpp

typeinfo ql/errors.hpp ql/payoff.hpp ql/instrument.hpp ql/exercise.hpp

ql/handle.hpp ql/Math/array.hpp ql/Utilities/steppingiterator.hpp ql/option.hpp

ql/Math/matrix.hpp ql/currency.hpp

ql/Patterns/bridge.hpp ql/dataformatters.hpp

ql/Math/interpolation.hpp

linearinterpolation.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


780 QuantLib File Documentation

10.139 ql/Math/loglinearinterpolation.hpp File Reference

10.139.1 Detailed Description

log-linear interpolation between discrete points


#include <ql/Math/linearinterpolation.hpp>
#include <vector>
Include dependency graph for loglinearinterpolation.hpp:

ql/handle.hpp ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/Patterns/bridge.hpp ql/dataformatters.hpp

ql/Math/interpolation.hpp

ql/Math/linearinterpolation.hpp vector

loglinearinterpolation.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.140 ql/Math/matrix.hpp File Reference 781

10.140 ql/Math/matrix.hpp File Reference

10.140.1 Detailed Description

matrix used in linear algebra.


#include <ql/Math/array.hpp>
#include <ql/Utilities/steppingiterator.hpp>
Include dependency graph for matrix.hpp:

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/Math/array.hpp ql/Utilities/steppingiterator.hpp

matrix.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


782 QuantLib File Documentation

10.141 ql/Math/normaldistribution.hpp File Reference

10.141.1 Detailed Description

normal, cumulative and inverse cumulative distributions


#include <ql/dataformatters.hpp>
#include <ql/Math/errorfunction.hpp>
Include dependency graph for normaldistribution.hpp:

ql/qldefines.hpp functional

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp ql/Math/errorfunction.hpp

ql/dataformatters.hpp

normaldistribution.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.142 ql/Math/poissondistribution.hpp File Reference 783

10.142 ql/Math/poissondistribution.hpp File Reference

10.142.1 Detailed Description

Poisson distribution.
#include <ql/dataformatters.hpp>
#include <ql/Math/factorial.hpp>
#include <ql/Math/incompletegamma.hpp>
Include dependency graph for poissondistribution.hpp:

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp ql/types.hpp ql/errors.hpp functional

ql/dataformatters.hpp ql/Math/factorial.hpp ql/Math/incompletegamma.hpp

poissondistribution.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


784 QuantLib File Documentation

10.143 ql/Math/primenumbers.hpp File Reference

10.143.1 Detailed Description

Prime numbers calculator.


#include <ql/types.hpp>
#include <vector>
Include dependency graph for primenumbers.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

ql/types.hpp vector

primenumbers.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.144 ql/Math/pseudosqrt.hpp File Reference 785

10.144 ql/Math/pseudosqrt.hpp File Reference

10.144.1 Detailed Description

pseudo square root of a real symmetric matrix


#include <ql/Math/matrix.hpp>
Include dependency graph for pseudosqrt.hpp:

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/Math/array.hpp ql/Utilities/steppingiterator.hpp

ql/Math/matrix.hpp

pseudosqrt.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


786 QuantLib File Documentation

10.145 ql/Math/riskstatistics.hpp File Reference

10.145.1 Detailed Description

empirical-distribution risk measures


#include <ql/Math/functional.hpp>
#include <ql/Math/generalstatistics.hpp>
#include <ql/Math/gaussianstatistics.hpp>
Include dependency graph for riskstatistics.hpp:

functional ql/qldefines.hpp ql/dataformatters.hpp

ql/Math/functional.hpp ql/null.hpp ql/Math/normaldistribution.hpp

ql/Math/generalstatistics.hpp ql/Math/gaussianstatistics.hpp

riskstatistics.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.146 ql/Math/segmentintegral.hpp File Reference 787

10.146 ql/Math/segmentintegral.hpp File Reference

10.146.1 Detailed Description

Integral of a one-dimensional function.


#include <ql/types.hpp>
#include <ql/errors.hpp>
Include dependency graph for segmentintegral.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp

segmentintegral.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


788 QuantLib File Documentation

10.147 ql/Math/sequencestatistics.hpp File Reference

10.147.1 Detailed Description

Statistics tools for sequence (vector, list, array) samples.


#include <ql/Math/statistics.hpp>
Include dependency graph for sequencestatistics.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/null.hpp ql/dataformatters.hpp

ql/Math/generalstatistics.hpp

ql/Math/statistics.hpp

sequencestatistics.hpp

Namespaces
• namespace QuantLib

Defines
• #define DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID(METHOD)
• #define DEFINE_SEQUENCE_STAT_CONST_METHOD_DOUBLE(METHOD)

10.147.2 Define Documentation

10.147.2.1 #define DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID(METHOD)

Value:

template <class Stat> \


std::vector<double> \
SequenceStatistics<Stat>::METHOD() const { \
for (Size i=0; i<dimension_; i++) \
results_[i] = stats_[i].METHOD(); \
return results_; \
}

10.147.2.2 #define DEFINE_SEQUENCE_STAT_CONST_METHOD_DOUBLE(METHOD)

Value:

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.147 ql/Math/sequencestatistics.hpp File Reference 789

template <class Stat> \


std::vector<double> \
SequenceStatistics<Stat>::METHOD(double x) const { \
for (Size i=0; i<dimension_; i++) \
results_[i] = stats_[i].METHOD(x); \
return results_; \
}

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


790 QuantLib File Documentation

10.148 ql/Math/simpsonintegral.hpp File Reference

10.148.1 Detailed Description

integral of a one-dimensional function


#include <ql/Math/trapezoidintegral.hpp>
Include dependency graph for simpsonintegral.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

ql/null.hpp

ql/Math/trapezoidintegral.hpp

simpsonintegral.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.149 ql/Math/statistics.hpp File Reference 791

10.149 ql/Math/statistics.hpp File Reference

10.149.1 Detailed Description

statistics tool with risk measures


#include <ql/Math/generalstatistics.hpp>
Include dependency graph for statistics.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/null.hpp ql/dataformatters.hpp

ql/Math/generalstatistics.hpp

statistics.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


792 QuantLib File Documentation

10.150 ql/Math/svd.hpp File Reference

10.150.1 Detailed Description

singular value decomposition


#include <ql/Math/matrix.hpp>
Include dependency graph for svd.hpp:

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/Math/array.hpp ql/Utilities/steppingiterator.hpp

ql/Math/matrix.hpp

svd.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.151 ql/Math/symmetriceigenvalues.hpp File Reference 793

10.151 ql/Math/symmetriceigenvalues.hpp File Reference

10.151.1 Detailed Description

Eigenvalues / eigenvectors of a real symmetric matrix.


#include <ql/Math/symmetricschurdecomposition.hpp>
Include dependency graph for symmetriceigenvalues.hpp:

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/Math/array.hpp ql/Utilities/steppingiterator.hpp

ql/Math/matrix.hpp

ql/Math/symmetricschurdecomposition.hpp

symmetriceigenvalues.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


794 QuantLib File Documentation

10.152 ql/Math/symmetricschurdecomposition.hpp File Refer-


ence

10.152.1 Detailed Description

Eigenvalues / eigenvectors of a real symmetric matrix.


#include <ql/Math/matrix.hpp>
Include dependency graph for symmetricschurdecomposition.hpp:

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/Math/array.hpp ql/Utilities/steppingiterator.hpp

ql/Math/matrix.hpp

symmetricschurdecomposition.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.153 ql/Math/trapezoidintegral.hpp File Reference 795

10.153 ql/Math/trapezoidintegral.hpp File Reference

10.153.1 Detailed Description

integral of a one-dimensional function


#include <ql/null.hpp>
Include dependency graph for trapezoidintegral.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

ql/null.hpp

trapezoidintegral.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


796 QuantLib File Documentation

10.154 ql/MonteCarlo/brownianbridge.hpp File Reference

10.154.1 Detailed Description

Browian bridge.
#include <ql/MonteCarlo/path.hpp>
#include <ql/MonteCarlo/sample.hpp>
Include dependency graph for brownianbridge.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp list vector

ql/grid.hpp ql/handle.hpp

ql/MonteCarlo/path.hpp ql/MonteCarlo/sample.hpp

brownianbridge.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.155 ql/MonteCarlo/getcovariance.hpp File Reference 797

10.155 ql/MonteCarlo/getcovariance.hpp File Reference

10.155.1 Detailed Description

Covariance matrix calculation.


#include <ql/Math/matrix.hpp>
Include dependency graph for getcovariance.hpp:

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/Math/array.hpp ql/Utilities/steppingiterator.hpp

ql/Math/matrix.hpp

getcovariance.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


798 QuantLib File Documentation

10.156 ql/MonteCarlo/mctraits.hpp File Reference

10.156.1 Detailed Description

Monte Carlo policies.


#include <ql/MonteCarlo/pathgenerator.hpp>
#include <ql/MonteCarlo/multipathgenerator.hpp>
#include <ql/MonteCarlo/pathpricer.hpp>
#include <ql/RandomNumbers/rngtraits.hpp>
Include dependency graph for mctraits.hpp:

ql/MonteCarlo/pathgenerator.hpp
ql/RandomNumbers/rngtraits.hpp
mctraits.hpp
ql/MonteCarlo/multipathgenerator.hpp

ql/MonteCarlo/pathpricer.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.157 ql/MonteCarlo/mctypedefs.hpp File Reference 799

10.157 ql/MonteCarlo/mctypedefs.hpp File Reference

10.157.1 Detailed Description

Default choices for template instantiations.


#include <ql/RandomNumbers/rngtypedefs.hpp>
#include <ql/MonteCarlo/montecarlomodel.hpp>
#include <ql/MonteCarlo/brownianbridge.hpp>
Include dependency graph for mctypedefs.hpp:

ql/RandomNumbers/rngtypedefs.hpp

ql/MonteCarlo/montecarlomodel.hpp mctypedefs.hpp

ql/MonteCarlo/brownianbridge.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


800 QuantLib File Documentation

10.158 ql/MonteCarlo/montecarlomodel.hpp File Reference

10.158.1 Detailed Description

General purpose Monte Carlo model.


#include <ql/handle.hpp>
#include <ql/MonteCarlo/mctraits.hpp>
#include <ql/Math/statistics.hpp>
Include dependency graph for montecarlomodel.hpp:

ql/handle.hpp ql/MonteCarlo/mctraits.hpp ql/Math/statistics.hpp

montecarlomodel.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.159 ql/MonteCarlo/multipath.hpp File Reference 801

10.159 ql/MonteCarlo/multipath.hpp File Reference

10.159.1 Detailed Description

Correlated multiple asset paths.


#include <ql/MonteCarlo/path.hpp>
Include dependency graph for multipath.hpp:

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp list vector

ql/grid.hpp ql/handle.hpp

ql/MonteCarlo/path.hpp

multipath.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


802 QuantLib File Documentation

10.160 ql/MonteCarlo/multipathgenerator.hpp File Reference

10.160.1 Detailed Description

Generates a multi path from a random-array generator.


#include <ql/diffusionprocess.hpp>
#include <ql/MonteCarlo/multipath.hpp>
#include <ql/MonteCarlo/sample.hpp>
Include dependency graph for multipathgenerator.hpp:

ql/termstructure.hpp ql/voltermstructure.hpp ql/MonteCarlo/path.hpp ql/qldefines.hpp

ql/diffusionprocess.hpp ql/MonteCarlo/multipath.hpp ql/MonteCarlo/sample.hpp

multipathgenerator.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.161 ql/MonteCarlo/path.hpp File Reference 803

10.161 ql/MonteCarlo/path.hpp File Reference

10.161.1 Detailed Description

single factor random walk


#include <ql/grid.hpp>
#include <ql/handle.hpp>
Include dependency graph for path.hpp:

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp list vector

ql/grid.hpp ql/handle.hpp

path.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


804 QuantLib File Documentation

10.162 ql/MonteCarlo/pathgenerator.hpp File Reference

10.162.1 Detailed Description

Generates random paths using a sequence generator.


#include <ql/diffusionprocess.hpp>
#include <ql/MonteCarlo/brownianbridge.hpp>
#include <ql/RandomNumbers/randomarraygenerator.hpp>
Include dependency graph for pathgenerator.hpp:

ql/diffusionprocess.hpp ql/MonteCarlo/brownianbridge.hpp ql/RandomNumbers/randomarraygenerator.hpp

pathgenerator.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.163 ql/MonteCarlo/pathpricer.hpp File Reference 805

10.163 ql/MonteCarlo/pathpricer.hpp File Reference

10.163.1 Detailed Description

base class for single-path pricers


#include <ql/option.hpp>
#include <ql/types.hpp>
#include <ql/termstructure.hpp>
#include <functional>
Include dependency graph for pathpricer.hpp:

ql/option.hpp ql/types.hpp ql/termstructure.hpp functional

pathpricer.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


806 QuantLib File Documentation

10.164 ql/MonteCarlo/sample.hpp File Reference

10.164.1 Detailed Description

weighted sample
#include <ql/qldefines.hpp>
Include dependency graph for sample.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

sample.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.165 ql/null.hpp File Reference 807

10.165 ql/null.hpp File Reference

10.165.1 Detailed Description

null values
#include <ql/qldefines.hpp>
Include dependency graph for null.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

null.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


808 QuantLib File Documentation

10.166 ql/numericalmethod.hpp File Reference

10.166.1 Detailed Description

Numerical method class.


#include <ql/grid.hpp>
#include <ql/handle.hpp>
Include dependency graph for numericalmethod.hpp:

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/dataformatters.hpp list vector

ql/grid.hpp ql/handle.hpp

numericalmethod.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.167 ql/Optimization/armijo.hpp File Reference 809

10.167 ql/Optimization/armijo.hpp File Reference

10.167.1 Detailed Description

Armijo line-search class.


#include <ql/Optimization/linesearch.hpp>
Include dependency graph for armijo.hpp:

ql/Patterns/bridge.hpp ql/Math/array.hpp

ql/Optimization/constraint.hpp ql/Optimization/costfunction.hpp ql/Optimization/criteria.hpp

ql/Optimization/method.hpp

ql/Optimization/problem.hpp

ql/Optimization/linesearch.hpp

armijo.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


810 QuantLib File Documentation

10.168 ql/Optimization/conjugategradient.hpp File Reference

10.168.1 Detailed Description

Conjugate gradient optimization method.


#include <ql/Optimization/armijo.hpp>
Include dependency graph for conjugategradient.hpp:

ql/Patterns/bridge.hpp ql/Math/array.hpp

ql/Optimization/constraint.hpp ql/Optimization/costfunction.hpp ql/Optimization/criteria.hpp

ql/Optimization/method.hpp

ql/Optimization/problem.hpp

ql/Optimization/linesearch.hpp

ql/Optimization/armijo.hpp

conjugategradient.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.169 ql/Optimization/constraint.hpp File Reference 811

10.169 ql/Optimization/constraint.hpp File Reference

10.169.1 Detailed Description

Abstract constraint class.


#include <ql/Math/array.hpp>
#include <ql/Patterns/bridge.hpp>
Include dependency graph for constraint.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/handle.hpp ql/Math/array.hpp

ql/Patterns/bridge.hpp

constraint.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


812 QuantLib File Documentation

10.170 ql/Optimization/costfunction.hpp File Reference

10.170.1 Detailed Description

Optimization cost function class.


#include <ql/Math/array.hpp>
Include dependency graph for costfunction.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/Math/array.hpp

costfunction.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.171 ql/Optimization/criteria.hpp File Reference 813

10.171 ql/Optimization/criteria.hpp File Reference

10.171.1 Detailed Description

Optimization criteria class.

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


814 QuantLib File Documentation

10.172 ql/Optimization/leastsquare.hpp File Reference

10.172.1 Detailed Description

Least square cost function.


#include <ql/Math/matrix.hpp>
#include <ql/Optimization/conjugategradient.hpp>
Include dependency graph for leastsquare.hpp:

ql/Math/array.hpp ql/Utilities/steppingiterator.hpp ql/Optimization/armijo.hpp

ql/Math/matrix.hpp ql/Optimization/conjugategradient.hpp

leastsquare.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.173 ql/Optimization/linesearch.hpp File Reference 815

10.173 ql/Optimization/linesearch.hpp File Reference

10.173.1 Detailed Description

Line search abstract class.


#include <ql/Optimization/problem.hpp>
Include dependency graph for linesearch.hpp:

ql/Patterns/bridge.hpp ql/Math/array.hpp

ql/Optimization/constraint.hpp ql/Optimization/costfunction.hpp ql/Optimization/criteria.hpp

ql/Optimization/method.hpp

ql/Optimization/problem.hpp

linesearch.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


816 QuantLib File Documentation

10.174 ql/Optimization/method.hpp File Reference

10.174.1 Detailed Description

Abstract optimization method class.


#include <ql/Optimization/constraint.hpp>
#include <ql/Optimization/costfunction.hpp>
#include <ql/Optimization/criteria.hpp>
Include dependency graph for method.hpp:

ql/Patterns/bridge.hpp ql/Math/array.hpp

ql/Optimization/constraint.hpp ql/Optimization/costfunction.hpp ql/Optimization/criteria.hpp

method.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.175 ql/Optimization/problem.hpp File Reference 817

10.175 ql/Optimization/problem.hpp File Reference

10.175.1 Detailed Description

Abstract optimization class.


#include <ql/Optimization/method.hpp>
Include dependency graph for problem.hpp:

ql/Patterns/bridge.hpp ql/Math/array.hpp

ql/Optimization/constraint.hpp ql/Optimization/costfunction.hpp ql/Optimization/criteria.hpp

ql/Optimization/method.hpp

problem.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


818 QuantLib File Documentation

10.176 ql/Optimization/simplex.hpp File Reference

10.176.1 Detailed Description

Simplex optimization method.


#include <ql/Optimization/problem.hpp>
#include <vector>
Include dependency graph for simplex.hpp:

ql/Patterns/bridge.hpp ql/Math/array.hpp

ql/Optimization/constraint.hpp ql/Optimization/costfunction.hpp ql/Optimization/criteria.hpp

ql/Optimization/method.hpp

ql/Optimization/problem.hpp vector

simplex.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.177 ql/Optimization/steepestdescent.hpp File Reference 819

10.177 ql/Optimization/steepestdescent.hpp File Reference

10.177.1 Detailed Description

Steepest descent optimization method.


#include <ql/Optimization/armijo.hpp>
Include dependency graph for steepestdescent.hpp:

ql/Patterns/bridge.hpp ql/Math/array.hpp

ql/Optimization/constraint.hpp ql/Optimization/costfunction.hpp ql/Optimization/criteria.hpp

ql/Optimization/method.hpp

ql/Optimization/problem.hpp

ql/Optimization/linesearch.hpp

ql/Optimization/armijo.hpp

steepestdescent.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


820 QuantLib File Documentation

10.178 ql/option.hpp File Reference

10.178.1 Detailed Description

Base option class.


#include <ql/instrument.hpp>
#include <ql/payoff.hpp>
#include <ql/exercise.hpp>
Include dependency graph for option.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

string exception ql/qldefines.hpp

typeinfo ql/errors.hpp functional utility ql/types.hpp

ql/handle.hpp list ql/null.hpp ql/payoff.hpp ql/date.hpp vector

ql/Patterns/observable.hpp ql/argsandresults.hpp ql/exercise.hpp

ql/Patterns/lazyobject.hpp ql/pricingengine.hpp

ql/instrument.hpp

option.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.179 ql/Patterns/bridge.hpp File Reference 821

10.179 ql/Patterns/bridge.hpp File Reference

10.179.1 Detailed Description

bridge pattern (a.k.a. handle-body idiom)


#include <ql/handle.hpp>
Include dependency graph for bridge.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp exception string

ql/errors.hpp typeinfo

ql/handle.hpp

bridge.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


822 QuantLib File Documentation

10.180 ql/Patterns/composite.hpp File Reference

10.180.1 Detailed Description

composite pattern
#include <ql/handle.hpp>
Include dependency graph for composite.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp exception string

ql/errors.hpp typeinfo

ql/handle.hpp

composite.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.181 ql/Patterns/curiouslyrecurring.hpp File Reference 823

10.181 ql/Patterns/curiouslyrecurring.hpp File Reference

10.181.1 Detailed Description

Curiously recurring template pattern.


#include <ql/qldefines.hpp>
Include dependency graph for curiouslyrecurring.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

curiouslyrecurring.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


824 QuantLib File Documentation

10.182 ql/Patterns/lazyobject.hpp File Reference

10.182.1 Detailed Description

framework for calculation on demand and result caching


#include <ql/Patterns/observable.hpp>
Include dependency graph for lazyobject.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp exception string

ql/errors.hpp typeinfo

ql/handle.hpp list

ql/Patterns/observable.hpp

lazyobject.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.183 ql/Patterns/observable.hpp File Reference 825

10.183 ql/Patterns/observable.hpp File Reference

10.183.1 Detailed Description

observer/observable pattern
#include <ql/handle.hpp>
#include <list>
Include dependency graph for observable.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp exception string

ql/errors.hpp typeinfo

ql/handle.hpp list

observable.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


826 QuantLib File Documentation

10.184 ql/Patterns/visitor.hpp File Reference

10.184.1 Detailed Description

degenerate base class for the Acyclic Visitor pattern


#include <ql/qldefines.hpp>
Include dependency graph for visitor.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

visitor.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.185 ql/payoff.hpp File Reference 827

10.185 ql/payoff.hpp File Reference

10.185.1 Detailed Description

Option payoff classes.


#include <ql/qldefines.hpp>
#include <functional>
Include dependency graph for payoff.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp functional

payoff.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


828 QuantLib File Documentation

10.186 ql/Pricers/continuousgeometricapo.hpp File Reference

10.186.1 Detailed Description

Continuous Geometric Average Price Option (European exercise).


#include <ql/Pricers/europeanoption.hpp>
Include dependency graph for continuousgeometricapo.hpp:

ql/qldefines.hpp functional

ql/option.hpp ql/currency.hpp ql/Math/matrix.hpp ql/Math/errorfunction.hpp

ql/Instruments/payoffs.hpp ql/dataformatters.hpp

ql/Pricers/singleassetoption.hpp ql/Math/normaldistribution.hpp

ql/Pricers/europeanoption.hpp

continuousgeometricapo.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.187 ql/Pricers/discretegeometricapo.hpp File Reference 829

10.187 ql/Pricers/discretegeometricapo.hpp File Reference

10.187.1 Detailed Description

Discrete Geometric Average Price Option.


#include <ql/Pricers/singleassetoption.hpp>
#include <ql/Math/normaldistribution.hpp>
Include dependency graph for discretegeometricapo.hpp:

ql/qldefines.hpp functional

ql/option.hpp ql/currency.hpp ql/Math/matrix.hpp ql/Math/errorfunction.hpp

ql/Instruments/payoffs.hpp ql/dataformatters.hpp

ql/Pricers/singleassetoption.hpp ql/Math/normaldistribution.hpp

discretegeometricapo.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


830 QuantLib File Documentation

10.188 ql/Pricers/discretegeometricaso.hpp File Reference

10.188.1 Detailed Description

Discrete Geometric Average Strike Option.


#include <ql/Pricers/singleassetoption.hpp>
#include <ql/Math/normaldistribution.hpp>
Include dependency graph for discretegeometricaso.hpp:

ql/qldefines.hpp functional

ql/option.hpp ql/currency.hpp ql/Math/matrix.hpp ql/Math/errorfunction.hpp

ql/Instruments/payoffs.hpp ql/dataformatters.hpp

ql/Pricers/singleassetoption.hpp ql/Math/normaldistribution.hpp

discretegeometricaso.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.189 ql/Pricers/europeanoption.hpp File Reference 831

10.189 ql/Pricers/europeanoption.hpp File Reference

10.189.1 Detailed Description

european option
#include <ql/Pricers/singleassetoption.hpp>
#include <ql/Math/normaldistribution.hpp>
Include dependency graph for europeanoption.hpp:

ql/qldefines.hpp functional

ql/option.hpp ql/currency.hpp ql/Math/matrix.hpp ql/Math/errorfunction.hpp

ql/Instruments/payoffs.hpp ql/dataformatters.hpp

ql/Pricers/singleassetoption.hpp ql/Math/normaldistribution.hpp

europeanoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


832 QuantLib File Documentation

10.190 ql/Pricers/fdamericanoption.hpp File Reference

10.190.1 Detailed Description

american option
#include <ql/Pricers/fdstepconditionoption.hpp>
#include <ql/FiniteDifferences/americancondition.hpp>
Include dependency graph for fdamericanoption.hpp:

ql/Pricers/fdstepconditionoption.hpp ql/FiniteDifferences/americancondition.hpp

fdamericanoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.191 ql/Pricers/fdbermudanoption.hpp File Reference 833

10.191 ql/Pricers/fdbermudanoption.hpp File Reference

10.191.1 Detailed Description

finite-difference evaluation of Bermudan option


#include <ql/Pricers/fdmultiperiodoption.hpp>
Include dependency graph for fdbermudanoption.hpp:

ql/Pricers/fdbsmoption.hpp ql/FiniteDifferences/fdtypedefs.hpp

ql/Pricers/fdmultiperiodoption.hpp

fdbermudanoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


834 QuantLib File Documentation

10.192 ql/Pricers/fdbsmoption.hpp File Reference

10.192.1 Detailed Description

common code for numerical option evaluation


#include <ql/Pricers/singleassetoption.hpp>
#include <ql/FiniteDifferences/bsmoperator.hpp>
#include <ql/FiniteDifferences/boundarycondition.hpp>
Include dependency graph for fdbsmoption.hpp:

ql/Pricers/singleassetoption.hpp

ql/FiniteDifferences/bsmoperator.hpp fdbsmoption.hpp

ql/FiniteDifferences/boundarycondition.hpp

Namespaces
• namespace QuantLib

Defines
• #define QL_NUM_OPT_MIN_GRID_POINTS 10
This is a safety check to be sure we have enough grid points.

• #define QL_NUM_OPT_GRID_POINTS_PER_YEAR 2
This is a safety check to be sure we have enough grid points.

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.193 ql/Pricers/fddividendamericanoption.hpp File Reference 835

10.193 ql/Pricers/fddividendamericanoption.hpp File Reference

10.193.1 Detailed Description

american option with discrete deterministic dividends


#include <ql/Pricers/fddividendoption.hpp>
Include dependency graph for fddividendamericanoption.hpp:

ql/Pricers/fdbsmoption.hpp ql/FiniteDifferences/fdtypedefs.hpp

ql/Pricers/fdmultiperiodoption.hpp

ql/Pricers/fddividendoption.hpp

fddividendamericanoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


836 QuantLib File Documentation

10.194 ql/Pricers/fddividendeuropeanoption.hpp File Refer-


ence

10.194.1 Detailed Description

european option with discrete deterministic dividends


#include <ql/Pricers/europeanoption.hpp>
Include dependency graph for fddividendeuropeanoption.hpp:

ql/qldefines.hpp functional

ql/option.hpp ql/currency.hpp ql/Math/matrix.hpp ql/Math/errorfunction.hpp

ql/Instruments/payoffs.hpp ql/dataformatters.hpp

ql/Pricers/singleassetoption.hpp ql/Math/normaldistribution.hpp

ql/Pricers/europeanoption.hpp

fddividendeuropeanoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.195 ql/Pricers/fddividendoption.hpp File Reference 837

10.195 ql/Pricers/fddividendoption.hpp File Reference

10.195.1 Detailed Description

base class for option with dividends


#include <ql/Pricers/fdmultiperiodoption.hpp>
Include dependency graph for fddividendoption.hpp:

ql/Pricers/fdbsmoption.hpp ql/FiniteDifferences/fdtypedefs.hpp

ql/Pricers/fdmultiperiodoption.hpp

fddividendoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


838 QuantLib File Documentation

10.196 ql/Pricers/fddividendshoutoption.hpp File Reference

10.196.1 Detailed Description

base class for shout option with dividends


#include <ql/Pricers/fddividendoption.hpp>
#include <ql/FiniteDifferences/shoutcondition.hpp>
Include dependency graph for fddividendshoutoption.hpp:

ql/FiniteDifferences/fdtypedefs.hpp ql/discretizedasset.hpp

ql/Pricers/fdmultiperiodoption.hpp ql/FiniteDifferences/shoutcondition.hpp

ql/Pricers/fddividendoption.hpp

fddividendshoutoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.197 ql/Pricers/fdeuropean.hpp File Reference 839

10.197 ql/Pricers/fdeuropean.hpp File Reference

10.197.1 Detailed Description

Example of European option calculated using finite differences.


#include <ql/Pricers/fdbsmoption.hpp>
#include <ql/FiniteDifferences/fdtypedefs.hpp>
Include dependency graph for fdeuropean.hpp:

ql/Pricers/fdbsmoption.hpp ql/FiniteDifferences/fdtypedefs.hpp

fdeuropean.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


840 QuantLib File Documentation

10.198 ql/Pricers/fdmultiperiodoption.hpp File Reference

10.198.1 Detailed Description

base class for option with events happening at different periods


#include <ql/Pricers/fdbsmoption.hpp>
#include <ql/FiniteDifferences/fdtypedefs.hpp>
Include dependency graph for fdmultiperiodoption.hpp:

ql/Pricers/fdbsmoption.hpp ql/FiniteDifferences/fdtypedefs.hpp

fdmultiperiodoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.199 ql/Pricers/fdshoutoption.hpp File Reference 841

10.199 ql/Pricers/fdshoutoption.hpp File Reference

10.199.1 Detailed Description

shout option
#include <ql/Pricers/fdstepconditionoption.hpp>
#include <ql/FiniteDifferences/shoutcondition.hpp>
Include dependency graph for fdshoutoption.hpp:

ql/Pricers/fdbsmoption.hpp ql/FiniteDifferences/fdtypedefs.hpp ql/discretizedasset.hpp

ql/Pricers/fdstepconditionoption.hpp ql/FiniteDifferences/shoutcondition.hpp

fdshoutoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


842 QuantLib File Documentation

10.200 ql/Pricers/fdstepconditionoption.hpp File Reference

10.200.1 Detailed Description

Option requiring additional code to be executed at each time step.


#include <ql/Pricers/fdbsmoption.hpp>
#include <ql/FiniteDifferences/fdtypedefs.hpp>
Include dependency graph for fdstepconditionoption.hpp:

ql/Pricers/fdbsmoption.hpp ql/FiniteDifferences/fdtypedefs.hpp

fdstepconditionoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.201 ql/Pricers/mcbasket.hpp File Reference 843

10.201 ql/Pricers/mcbasket.hpp File Reference

10.201.1 Detailed Description

simple example of multi-factor Monte Carlo pricer


#include <ql/Pricers/mcpricer.hpp>
#include <ql/MonteCarlo/mctypedefs.hpp>
Include dependency graph for mcbasket.hpp:

ql/Pricers/mcpricer.hpp ql/MonteCarlo/mctypedefs.hpp

mcbasket.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


844 QuantLib File Documentation

10.202 ql/Pricers/mccliquetoption.hpp File Reference

10.202.1 Detailed Description

Cliquet option priced with Monte Carlo simulation.


#include <ql/option.hpp>
#include <ql/types.hpp>
#include <ql/Pricers/mcpricer.hpp>
#include <ql/MonteCarlo/mctypedefs.hpp>
Include dependency graph for mccliquetoption.hpp:

ql/option.hpp ql/types.hpp ql/Pricers/mcpricer.hpp ql/MonteCarlo/mctypedefs.hpp

mccliquetoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.203 ql/Pricers/mcdiscretearithmeticapo.hpp File Reference 845

10.203 ql/Pricers/mcdiscretearithmeticapo.hpp File Reference

10.203.1 Detailed Description

Discrete Arithmetic Average Price Option.


#include <ql/option.hpp>
#include <ql/types.hpp>
#include <ql/Pricers/mcpricer.hpp>
#include <ql/MonteCarlo/mctypedefs.hpp>
Include dependency graph for mcdiscretearithmeticapo.hpp:

ql/option.hpp ql/types.hpp ql/Pricers/mcpricer.hpp ql/MonteCarlo/mctypedefs.hpp

mcdiscretearithmeticapo.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


846 QuantLib File Documentation

10.204 ql/Pricers/mcdiscretearithmeticaso.hpp File Reference

10.204.1 Detailed Description

Discrete Arithmetic Average Strike Option.


#include <ql/option.hpp>
#include <ql/types.hpp>
#include <ql/Pricers/mcpricer.hpp>
#include <ql/MonteCarlo/mctypedefs.hpp>
Include dependency graph for mcdiscretearithmeticaso.hpp:

ql/option.hpp ql/types.hpp ql/Pricers/mcpricer.hpp ql/MonteCarlo/mctypedefs.hpp

mcdiscretearithmeticaso.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.205 ql/Pricers/mceverest.hpp File Reference 847

10.205 ql/Pricers/mceverest.hpp File Reference

10.205.1 Detailed Description

Everest-type option pricer


#include <ql/Pricers/mcpricer.hpp>
#include <ql/MonteCarlo/mctypedefs.hpp>
Include dependency graph for mceverest.hpp:

ql/Pricers/mcpricer.hpp ql/MonteCarlo/mctypedefs.hpp

mceverest.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


848 QuantLib File Documentation

10.206 ql/Pricers/mchimalaya.hpp File Reference

10.206.1 Detailed Description

Himalayan-type option pricer.


#include <ql/Pricers/mcpricer.hpp>
Include dependency graph for mchimalaya.hpp:

ql/dataformatters.hpp ql/MonteCarlo/montecarlomodel.hpp

ql/Pricers/mcpricer.hpp

mchimalaya.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.207 ql/Pricers/mcmaxbasket.hpp File Reference 849

10.207 ql/Pricers/mcmaxbasket.hpp File Reference

10.207.1 Detailed Description

Max Basket Monte Carlo pricer.


#include <ql/Pricers/mcpricer.hpp>
#include <ql/MonteCarlo/mctypedefs.hpp>
Include dependency graph for mcmaxbasket.hpp:

ql/Pricers/mcpricer.hpp ql/MonteCarlo/mctypedefs.hpp

mcmaxbasket.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


850 QuantLib File Documentation

10.208 ql/Pricers/mcpagoda.hpp File Reference

10.208.1 Detailed Description

Roofed multi asset Asian option.


#include <ql/Pricers/mcpricer.hpp>
#include <ql/MonteCarlo/mctypedefs.hpp>
Include dependency graph for mcpagoda.hpp:

ql/Pricers/mcpricer.hpp ql/MonteCarlo/mctypedefs.hpp

mcpagoda.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.209 ql/Pricers/mcperformanceoption.hpp File Reference 851

10.209 ql/Pricers/mcperformanceoption.hpp File Reference

10.209.1 Detailed Description

Performance option priced with Monte Carlo simulation.


#include <ql/option.hpp>
#include <ql/types.hpp>
#include <ql/Pricers/mcpricer.hpp>
#include <ql/MonteCarlo/mctypedefs.hpp>
Include dependency graph for mcperformanceoption.hpp:

ql/option.hpp ql/types.hpp ql/Pricers/mcpricer.hpp ql/MonteCarlo/mctypedefs.hpp

mcperformanceoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


852 QuantLib File Documentation

10.210 ql/Pricers/mcpricer.hpp File Reference

10.210.1 Detailed Description

base class for Monte Carlo pricers


#include <ql/dataformatters.hpp>
#include <ql/MonteCarlo/montecarlomodel.hpp>
Include dependency graph for mcpricer.hpp:

ql/dataformatters.hpp ql/MonteCarlo/montecarlomodel.hpp

mcpricer.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.211 ql/Pricers/performanceoption.hpp File Reference 853

10.211 ql/Pricers/performanceoption.hpp File Reference

10.211.1 Detailed Description

Performance option.
#include <ql/Pricers/europeanoption.hpp>
Include dependency graph for performanceoption.hpp:

ql/qldefines.hpp functional

ql/option.hpp ql/currency.hpp ql/Math/matrix.hpp ql/Math/errorfunction.hpp

ql/Instruments/payoffs.hpp ql/dataformatters.hpp

ql/Pricers/singleassetoption.hpp ql/Math/normaldistribution.hpp

ql/Pricers/europeanoption.hpp

performanceoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


854 QuantLib File Documentation

10.212 ql/Pricers/singleassetoption.hpp File Reference

10.212.1 Detailed Description

common code for option evaluation


#include <ql/Instruments/payoffs.hpp>
Include dependency graph for singleassetoption.hpp:

ql/qldefines.hpp functional

ql/Patterns/lazyobject.hpp ql/pricingengine.hpp ql/payoff.hpp ql/date.hpp vector

ql/instrument.hpp ql/exercise.hpp

ql/option.hpp

ql/Instruments/payoffs.hpp

singleassetoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.213 ql/pricingengine.hpp File Reference 855

10.213 ql/pricingengine.hpp File Reference

10.213.1 Detailed Description

Base class for pricing engines.


#include <ql/argsandresults.hpp>
#include <ql/Patterns/observable.hpp>
Include dependency graph for pricingengine.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp

list ql/handle.hpp ql/null.hpp

ql/Patterns/observable.hpp ql/argsandresults.hpp

pricingengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


856 QuantLib File Documentation

10.214 ql/PricingEngines/americanpayoffatexpiry.hpp File Ref-


erence

10.214.1 Detailed Description

Analytical formulae for american exercise with payoff at expiry.


#include <ql/Instruments/payoffs.hpp>
#include <ql/Math/normaldistribution.hpp>
Include dependency graph for americanpayoffatexpiry.hpp:

ql/option.hpp

ql/dataformatters.hpp ql/Math/errorfunction.hpp

ql/Instruments/payoffs.hpp ql/Math/normaldistribution.hpp

americanpayoffatexpiry.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.215 ql/PricingEngines/americanpayoffathit.hpp File Reference 857

10.215 ql/PricingEngines/americanpayoffathit.hpp File Refer-


ence

10.215.1 Detailed Description

Analytical formulae for american exercise with payoff at hit.


#include <ql/Instruments/payoffs.hpp>
#include <ql/Math/normaldistribution.hpp>
Include dependency graph for americanpayoffathit.hpp:

ql/option.hpp

ql/dataformatters.hpp ql/Math/errorfunction.hpp

ql/Instruments/payoffs.hpp ql/Math/normaldistribution.hpp

americanpayoffathit.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


858 QuantLib File Documentation

10.216 ql/PricingEngines/Asian/analyticasianengine.hpp File


Reference

10.216.1 Detailed Description

Analytic Asian option engine.


#include <ql/Instruments/asianoption.hpp>
Include dependency graph for analyticasianengine.hpp:

ql/stochasticprocess.hpp ql/option.hpp

ql/Instruments/oneassetoption.hpp ql/Instruments/payoffs.hpp

ql/Instruments/oneassetstrikedoption.hpp vector

ql/Instruments/asianoption.hpp

analyticasianengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.217 ql/PricingEngines/Barrier/analyticbarrierengine.hpp File Reference 859

10.217 ql/PricingEngines/Barrier/analyticbarrierengine.hpp File


Reference

10.217.1 Detailed Description

Analytic barrier option engines.


#include <ql/Instruments/barrieroption.hpp>
#include <ql/Math/normaldistribution.hpp>
Include dependency graph for analyticbarrierengine.hpp:

ql/Instruments/oneassetoption.hpp ql/Instruments/payoffs.hpp ql/qldefines.hpp functional

ql/Instruments/oneassetstrikedoption.hpp ql/dataformatters.hpp ql/Math/errorfunction.hpp

ql/Instruments/barrieroption.hpp ql/Math/normaldistribution.hpp

analyticbarrierengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


860 QuantLib File Documentation

10.218 ql/PricingEngines/Barrier/mcbarrierengine.hpp File Ref-


erence

10.218.1 Detailed Description

Monte Carlo barrier option engines.


#include <ql/Instruments/barrieroption.hpp>
#include <ql/PricingEngines/mcsimulation.hpp>
Include dependency graph for mcbarrierengine.hpp:

ql/Instruments/oneassetstrikedoption.hpp ql/grid.hpp ql/MonteCarlo/montecarlomodel.hpp

ql/Instruments/barrieroption.hpp ql/PricingEngines/mcsimulation.hpp

mcbarrierengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.219 ql/PricingEngines/Basket/mcamericanbasketengine.hpp File Reference 861

10.219 ql/PricingEngines/Basket/mcamericanbasketengine.hpp
File Reference

10.219.1 Detailed Description

Least-square Monte Carlo engines.


#include <ql/Instruments/basketoption.hpp>
#include <ql/MonteCarlo/path.hpp>
Include dependency graph for mcamericanbasketengine.hpp:

vector

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp

ql/option.hpp ql/voltermstructure.hpp

ql/dataformatters.hpp list

ql/termstructure.hpp ql/grid.hpp ql/handle.hpp

ql/stochasticprocess.hpp ql/MonteCarlo/path.hpp

ql/Instruments/payoffs.hpp ql/Instruments/multiassetoption.hpp

ql/Instruments/basketoption.hpp

mcamericanbasketengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


862 QuantLib File Documentation

10.220 ql/PricingEngines/Basket/mcbasketengine.hpp File Ref-


erence

10.220.1 Detailed Description

European Basket MC Engine.


#include <ql/Instruments/basketoption.hpp>
#include <ql/PricingEngines/mcsimulation.hpp>
Include dependency graph for mcbasketengine.hpp:

ql/Instruments/basketoption.hpp ql/PricingEngines/mcsimulation.hpp

mcbasketengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.221 ql/PricingEngines/Basket/stulzengine.hpp File Reference 863

10.221 ql/PricingEngines/Basket/stulzengine.hpp File Refer-


ence

10.221.1 Detailed Description

2D European Basket formulae, due to Stulz (1982)


#include <ql/Instruments/basketoption.hpp>
Include dependency graph for stulzengine.hpp:

ql/termstructure.hpp ql/voltermstructure.hpp ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp

ql/stochasticprocess.hpp ql/option.hpp

ql/Instruments/multiassetoption.hpp ql/Instruments/payoffs.hpp

ql/Instruments/basketoption.hpp

stulzengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


864 QuantLib File Documentation

10.222 ql/PricingEngines/blackformula.hpp File Reference

10.222.1 Detailed Description

Black formula.
#include <ql/Instruments/payoffs.hpp>
#include <ql/Math/normaldistribution.hpp>
Include dependency graph for blackformula.hpp:

ql/option.hpp

ql/dataformatters.hpp ql/Math/errorfunction.hpp

ql/Instruments/payoffs.hpp ql/Math/normaldistribution.hpp

blackformula.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.223 ql/PricingEngines/blackmodel.hpp File Reference 865

10.223 ql/PricingEngines/blackmodel.hpp File Reference

10.223.1 Detailed Description

Abstract class for Black-type models (market models).


#include <ql/termstructure.hpp>
#include <ql/Math/normaldistribution.hpp>
Include dependency graph for blackmodel.hpp:

ql/termstructure.hpp ql/Math/normaldistribution.hpp

blackmodel.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


866 QuantLib File Documentation

10.224 ql/PricingEngines/CapFloor/analyticalcapfloor.hpp File


Reference

10.224.1 Detailed Description

Analytical pricer for caps/floors.


#include <ql/PricingEngines/CapFloor/capfloorpricer.hpp>
#include <ql/PricingEngines/genericmodelengine.hpp>
#include <ql/ShortRateModels/model.hpp>
Include dependency graph for analyticalcapfloor.hpp:

ql/PricingEngines/CapFloor/capfloorpricer.hpp

ql/PricingEngines/genericmodelengine.hpp analyticalcapfloor.hpp

ql/ShortRateModels/model.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.225 ql/PricingEngines/CapFloor/blackcapfloor.hpp File Reference 867

10.225 ql/PricingEngines/CapFloor/blackcapfloor.hpp File Ref-


erence

10.225.1 Detailed Description

CapFloor calculated using the Black formula.


#include <ql/PricingEngines/blackmodel.hpp>
#include <ql/PricingEngines/CapFloor/capfloorpricer.hpp>
#include <ql/PricingEngines/genericmodelengine.hpp>
Include dependency graph for blackcapfloor.hpp:

ql/PricingEngines/blackmodel.hpp

ql/PricingEngines/CapFloor/capfloorpricer.hpp blackcapfloor.hpp

ql/PricingEngines/genericmodelengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


868 QuantLib File Documentation

10.226 ql/PricingEngines/CapFloor/capfloorpricer.hpp File Ref-


erence

10.226.1 Detailed Description

cap and floor pricer class


#include <ql/Instruments/capfloor.hpp>
#include <ql/discretizedasset.hpp>
Include dependency graph for capfloorpricer.hpp:

ql/Instruments/capfloor.hpp ql/discretizedasset.hpp

capfloorpricer.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.227 ql/PricingEngines/CapFloor/treecapfloor.hpp File Reference 869

10.227 ql/PricingEngines/CapFloor/treecapfloor.hpp File Refer-


ence

10.227.1 Detailed Description

Cap/Floor calculated using a tree.


#include <ql/PricingEngines/latticeshortratemodelengine.hpp>
#include <ql/Instruments/capfloor.hpp>
Include dependency graph for treecapfloor.hpp:

ql/PricingEngines/latticeshortratemodelengine.hpp ql/Instruments/capfloor.hpp

treecapfloor.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


870 QuantLib File Documentation

10.228 ql/PricingEngines/Forward/forwardengine.hpp File Ref-


erence

10.228.1 Detailed Description

Forward (strike-resetting) option engine.


#include <ql/Instruments/forwardvanillaoption.hpp>
#include <ql/Volatilities/impliedvoltermstructure.hpp>
#include <ql/TermStructures/impliedtermstructure.hpp>
Include dependency graph for forwardengine.hpp:

ql/Instruments/forwardvanillaoption.hpp

ql/Volatilities/impliedvoltermstructure.hpp forwardengine.hpp

ql/TermStructures/impliedtermstructure.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.229 ql/PricingEngines/Forward/forwardperformanceengine.hpp File Reference 871

10.229 ql/PricingEngines/Forward/forwardperformanceengine.hpp
File Reference

10.229.1 Detailed Description

Forward (strike-resetting) performance option engines.


#include <ql/PricingEngines/Forward/forwardengine.hpp>
Include dependency graph for forwardperformanceengine.hpp:

ql/PricingEngines/Forward/forwardengine.hpp

forwardperformanceengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


872 QuantLib File Documentation

10.230 ql/PricingEngines/genericmodelengine.hpp File Refer-


ence

10.230.1 Detailed Description

Generic option engine based on a model.


#include <ql/pricingengine.hpp>
Include dependency graph for genericmodelengine.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp

list ql/handle.hpp ql/null.hpp

ql/Patterns/observable.hpp ql/argsandresults.hpp

ql/pricingengine.hpp

genericmodelengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.231 ql/PricingEngines/latticeshortratemodelengine.hpp File Reference 873

10.231 ql/PricingEngines/latticeshortratemodelengine.hpp File


Reference

10.231.1 Detailed Description

Engine for a short-rate model specialized on a lattice.


#include <ql/ShortRateModels/model.hpp>
#include <ql/PricingEngines/genericmodelengine.hpp>
Include dependency graph for latticeshortratemodelengine.hpp:

ql/ShortRateModels/model.hpp ql/PricingEngines/genericmodelengine.hpp

latticeshortratemodelengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


874 QuantLib File Documentation

10.232 ql/PricingEngines/mcsimulation.hpp File Reference

10.232.1 Detailed Description

framework for Monte Carlo engines


#include <ql/grid.hpp>
#include <ql/MonteCarlo/montecarlomodel.hpp>
Include dependency graph for mcsimulation.hpp:

ql/grid.hpp ql/MonteCarlo/montecarlomodel.hpp

mcsimulation.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.233 ql/PricingEngines/Quanto/quantoengine.hpp File Reference 875

10.233 ql/PricingEngines/Quanto/quantoengine.hpp File Refer-


ence

10.233.1 Detailed Description

Quanto option engine.


#include <ql/Instruments/quantovanillaoption.hpp>
#include <ql/TermStructures/quantotermstructure.hpp>
Include dependency graph for quantoengine.hpp:

ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp ql/TermStructures/quantotermstructure.hpp

ql/Instruments/payoffs.hpp ql/Instruments/oneassetoption.hpp

ql/Instruments/oneassetstrikedoption.hpp

ql/Instruments/vanillaoption.hpp

ql/Instruments/quantovanillaoption.hpp

quantoengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


876 QuantLib File Documentation

10.234 ql/PricingEngines/Swaption/blackswaption.hpp File


Reference

10.234.1 Detailed Description

Swaption calculated using the Black formula.


#include <ql/PricingEngines/blackmodel.hpp>
#include <ql/PricingEngines/Swaption/swaptionpricer.hpp>
#include <ql/PricingEngines/genericmodelengine.hpp>
Include dependency graph for blackswaption.hpp:

ql/PricingEngines/blackmodel.hpp

ql/PricingEngines/Swaption/swaptionpricer.hpp blackswaption.hpp

ql/PricingEngines/genericmodelengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.235 ql/PricingEngines/Swaption/jamshidianswaption.hpp File Reference 877

10.235 ql/PricingEngines/Swaption/jamshidianswaption.hpp
File Reference

10.235.1 Detailed Description

Swaption pricer using Jamshidian’s decomposition.


#include <ql/PricingEngines/Swaption/swaptionpricer.hpp>
#include <ql/ShortRateModels/onefactormodel.hpp>
#include <ql/PricingEngines/genericmodelengine.hpp>
Include dependency graph for jamshidianswaption.hpp:

ql/PricingEngines/Swaption/swaptionpricer.hpp

ql/ShortRateModels/onefactormodel.hpp jamshidianswaption.hpp

ql/PricingEngines/genericmodelengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


878 QuantLib File Documentation

10.236 ql/PricingEngines/Swaption/swaptionpricer.hpp File


Reference

10.236.1 Detailed Description

Swaption pricer class.


#include <ql/Instruments/swaption.hpp>
#include <ql/discretizedasset.hpp>
Include dependency graph for swaptionpricer.hpp:

ql/option.hpp ql/Instruments/simpleswap.hpp ql/numericalmethod.hpp ql/Math/comparison.hpp

ql/Instruments/swaption.hpp ql/discretizedasset.hpp

swaptionpricer.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.237 ql/PricingEngines/Swaption/treeswaption.hpp File Reference 879

10.237 ql/PricingEngines/Swaption/treeswaption.hpp File Ref-


erence

10.237.1 Detailed Description

Swaption computed using a lattice.


#include <ql/PricingEngines/latticeshortratemodelengine.hpp>
#include <ql/Instruments/swaption.hpp>
Include dependency graph for treeswaption.hpp:

ql/PricingEngines/latticeshortratemodelengine.hpp ql/Instruments/swaption.hpp

treeswaption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


880 QuantLib File Documentation

10.238 ql/PricingEngines/Vanilla/analyticdigitalamericanengine.hpp
File Reference

10.238.1 Detailed Description

analytic digital American option engine


#include <ql/Instruments/vanillaoption.hpp>
Include dependency graph for analyticdigitalamericanengine.hpp:

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp

ql/Instruments/payoffs.hpp ql/Instruments/oneassetoption.hpp

ql/Instruments/oneassetstrikedoption.hpp

ql/Instruments/vanillaoption.hpp

analyticdigitalamericanengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.239 ql/PricingEngines/Vanilla/analyticeuropeanengine.hpp File Reference 881

10.239 ql/PricingEngines/Vanilla/analyticeuropeanengine.hpp
File Reference

10.239.1 Detailed Description

Analytic European engine.


#include <ql/Instruments/vanillaoption.hpp>
Include dependency graph for analyticeuropeanengine.hpp:

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp

ql/Instruments/payoffs.hpp ql/Instruments/oneassetoption.hpp

ql/Instruments/oneassetstrikedoption.hpp

ql/Instruments/vanillaoption.hpp

analyticeuropeanengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


882 QuantLib File Documentation

10.240 ql/PricingEngines/Vanilla/baroneadesiwhaleyengine.hpp
File Reference

10.240.1 Detailed Description

Barone-Adesi and Whaley approximation engine.


#include <ql/Instruments/vanillaoption.hpp>
Include dependency graph for baroneadesiwhaleyengine.hpp:

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp

ql/Instruments/payoffs.hpp ql/Instruments/oneassetoption.hpp

ql/Instruments/oneassetstrikedoption.hpp

ql/Instruments/vanillaoption.hpp

baroneadesiwhaleyengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.241 ql/PricingEngines/Vanilla/binomialengine.hpp File Reference 883

10.241 ql/PricingEngines/Vanilla/binomialengine.hpp File Ref-


erence

10.241.1 Detailed Description

Binomial option engine.


#include <ql/Lattices/binomialtree.hpp>
#include <ql/Math/normaldistribution.hpp>
#include <ql/PricingEngines/Vanilla/discretizedvanillaoption.hpp>
#include <ql/TermStructures/flatforward.hpp>
#include <ql/Volatilities/blackconstantvol.hpp>
Include dependency graph for binomialengine.hpp:

ql/Lattices/binomialtree.hpp

ql/Math/normaldistribution.hpp

ql/PricingEngines/Vanilla/discretizedvanillaoption.hpp binomialengine.hpp

ql/TermStructures/flatforward.hpp

ql/Volatilities/blackconstantvol.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


884 QuantLib File Documentation

10.242 ql/PricingEngines/Vanilla/bjerksundstenslandengine.hpp
File Reference

10.242.1 Detailed Description

Bjerksund and Stensland approximation engine.


#include <ql/Instruments/vanillaoption.hpp>
Include dependency graph for bjerksundstenslandengine.hpp:

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp

ql/Instruments/payoffs.hpp ql/Instruments/oneassetoption.hpp

ql/Instruments/oneassetstrikedoption.hpp

ql/Instruments/vanillaoption.hpp

bjerksundstenslandengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.243 ql/PricingEngines/Vanilla/discretizedvanillaoption.hpp File Reference 885

10.243 ql/PricingEngines/Vanilla/discretizedvanillaoption.hpp
File Reference

10.243.1 Detailed Description

discretized vanilla option


#include <ql/discretizedasset.hpp>
#include <ql/Lattices/bsmlattice.hpp>
#include <ql/Pricers/singleassetoption.hpp>
#include <ql/Instruments/vanillaoption.hpp>
Include dependency graph for discretizedvanillaoption.hpp:

ql/discretizedasset.hpp

ql/Lattices/bsmlattice.hpp
discretizedvanillaoption.hpp
ql/Pricers/singleassetoption.hpp

ql/Instruments/vanillaoption.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


886 QuantLib File Documentation

10.244 ql/PricingEngines/Vanilla/integralengine.hpp File Refer-


ence

10.244.1 Detailed Description

Integral option engine.


#include <ql/Instruments/vanillaoption.hpp>
Include dependency graph for integralengine.hpp:

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp

ql/Instruments/payoffs.hpp ql/Instruments/oneassetoption.hpp

ql/Instruments/oneassetstrikedoption.hpp

ql/Instruments/vanillaoption.hpp

integralengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.245 ql/PricingEngines/Vanilla/jumpdiffusionengine.hpp File Reference 887

10.245 ql/PricingEngines/Vanilla/jumpdiffusionengine.hpp
File Reference

10.245.1 Detailed Description

Jump diffusion (Merton 1976) engine.


#include <ql/Instruments/vanillaoption.hpp>
Include dependency graph for jumpdiffusionengine.hpp:

ql/instrument.hpp ql/payoff.hpp ql/exercise.hpp ql/termstructure.hpp ql/voltermstructure.hpp

ql/option.hpp ql/stochasticprocess.hpp

ql/Instruments/payoffs.hpp ql/Instruments/oneassetoption.hpp

ql/Instruments/oneassetstrikedoption.hpp

ql/Instruments/vanillaoption.hpp

jumpdiffusionengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


888 QuantLib File Documentation

10.246 ql/PricingEngines/Vanilla/mcdigitalengine.hpp File Ref-


erence

10.246.1 Detailed Description

digital option Monte Carlo engine


#include <ql/exercise.hpp>
#include <ql/handle.hpp>
#include <ql/termstructure.hpp>
#include <ql/voltermstructure.hpp>
#include <ql/MonteCarlo/mctraits.hpp>
#include <ql/PricingEngines/Vanilla/mcvanillaengine.hpp>
Include dependency graph for mcdigitalengine.hpp:

ql/exercise.hpp

ql/handle.hpp

ql/termstructure.hpp
mcdigitalengine.hpp
ql/voltermstructure.hpp

ql/MonteCarlo/mctraits.hpp

ql/PricingEngines/Vanilla/mcvanillaengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.247 ql/PricingEngines/Vanilla/mceuropeanengine.hpp File Reference 889

10.247 ql/PricingEngines/Vanilla/mceuropeanengine.hpp File


Reference

10.247.1 Detailed Description

Monte Carlo European option engine.


#include <ql/PricingEngines/Vanilla/mcvanillaengine.hpp>
#include <ql/Volatilities/blackconstantvol.hpp>
#include <ql/Volatilities/blackvariancecurve.hpp>
Include dependency graph for mceuropeanengine.hpp:

ql/PricingEngines/Vanilla/mcvanillaengine.hpp

ql/Volatilities/blackconstantvol.hpp mceuropeanengine.hpp

ql/Volatilities/blackvariancecurve.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


890 QuantLib File Documentation

10.248 ql/PricingEngines/Vanilla/mcvanillaengine.hpp File Ref-


erence

10.248.1 Detailed Description

Monte Carlo vanilla option engine.


#include <ql/PricingEngines/mcsimulation.hpp>
#include <ql/Instruments/vanillaoption.hpp>
Include dependency graph for mcvanillaengine.hpp:

ql/grid.hpp ql/MonteCarlo/montecarlomodel.hpp ql/Instruments/oneassetstrikedoption.hpp

ql/PricingEngines/mcsimulation.hpp ql/Instruments/vanillaoption.hpp

mcvanillaengine.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.249 ql/qldefines.hpp File Reference 891

10.249 ql/qldefines.hpp File Reference

10.249.1 Detailed Description

Global definitions and compiler switches.


#include <ql/config.bcc.hpp>
#include <cmath>
#include <limits>
#include <ctime>
#include <cctype>
#include <algorithm>
#include <iterator>
Include dependency graph for qldefines.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

qldefines.hpp

Namespaces
• namespace QuantLib

Defines
• #define QL_HEX_VERSION 0x000306f0
version hexadecimal number

• #define QL_VERSION "0.3.6"


version string

• #define QL_DUMMY_RETURN(x)
specific per-compiler definitions Is a dummy return statement required?

• #define QL_IO_INIT
I/O initialization.

• #define QL_MIN_INT ((std::numeric_limits<int>::min)())


• #define QL_MAX_INT ((std::numeric_limits<int>::max)())
• #define QL_MIN_DOUBLE -((std::numeric_limits<double>::max)())
• #define QL_MAX_DOUBLE ((std::numeric_limits<double>::max)())
• #define QL_EPSILON ((std::numeric_limits<double>::epsilon)())
• #define QL_MIN_POSITIVE_DOUBLE ((std::numeric_limits<double>::min)())
• #define QL_DECLARE_TEMPLATE_SPECIALIZATIONS
Blame Microsoft for this one...

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


892 QuantLib File Documentation

• #define QL_ALLOW_TEMPLATE_METHOD_CALLS 1
Blame Microsoft for this one...

• #define QL_TYPENAME typename


Blame Microsoft for this one...

• #define QL_TEMPLATE_METAPROGRAMMING_WORKS 1
• #define QL_SPECIALIZE_ITERATOR_TRAITS(T)
• #define QL_REVERSE_ITERATOR(iterator, type) std::reverse_iterator< iterator >
Blame Microsoft for this one...

• #define QL_FULL_ITERATOR_SUPPORT

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.250 ql/RandomNumbers/boxmullergaussianrng.hpp File Reference 893

10.250 ql/RandomNumbers/boxmullergaussianrng.hpp File


Reference

10.250.1 Detailed Description

Box-Muller Gaussian random-number generator.


#include <ql/MonteCarlo/sample.hpp>
Include dependency graph for boxmullergaussianrng.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

ql/MonteCarlo/sample.hpp

boxmullergaussianrng.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


894 QuantLib File Documentation

10.251 ql/RandomNumbers/centrallimitgaussianrng.hpp File


Reference

10.251.1 Detailed Description

Central limit Gaussian random-number generator.


#include <ql/MonteCarlo/sample.hpp>
Include dependency graph for centrallimitgaussianrng.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

ql/MonteCarlo/sample.hpp

centrallimitgaussianrng.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.252 ql/RandomNumbers/haltonrsg.hpp File Reference 895

10.252 ql/RandomNumbers/haltonrsg.hpp File Reference

10.252.1 Detailed Description

Halton low-discrepancy sequence generator.


#include <ql/Math/array.hpp>
#include <ql/MonteCarlo/sample.hpp>
#include <vector>
Include dependency graph for haltonrsg.hpp:

ql/Math/array.hpp ql/MonteCarlo/sample.hpp vector

haltonrsg.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


896 QuantLib File Documentation

10.253 ql/RandomNumbers/inversecumgaussianrng.hpp File


Reference

10.253.1 Detailed Description

Inverse cumulative Gaussian random-number generator.


#include <ql/MonteCarlo/sample.hpp>
Include dependency graph for inversecumgaussianrng.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

ql/MonteCarlo/sample.hpp

inversecumgaussianrng.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.254 ql/RandomNumbers/inversecumgaussianrsg.hpp File Reference 897

10.254 ql/RandomNumbers/inversecumgaussianrsg.hpp File


Reference

10.254.1 Detailed Description

Inverse cumulative Gaussian random sequence generator.


#include <ql/Math/array.hpp>
#include <ql/MonteCarlo/sample.hpp>
Include dependency graph for inversecumgaussianrsg.hpp:

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/Math/array.hpp ql/MonteCarlo/sample.hpp

inversecumgaussianrsg.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


898 QuantLib File Documentation

10.255 ql/RandomNumbers/knuthuniformrng.hpp File Refer-


ence

10.255.1 Detailed Description

Knuth uniform random number generator.


#include <ql/MonteCarlo/sample.hpp>
#include <vector>
Include dependency graph for knuthuniformrng.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

ql/MonteCarlo/sample.hpp vector

knuthuniformrng.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.256 ql/RandomNumbers/lecuyeruniformrng.hpp File Reference 899

10.256 ql/RandomNumbers/lecuyeruniformrng.hpp File Refer-


ence

10.256.1 Detailed Description

L’Ecuyer uniform random number generator.


#include <ql/MonteCarlo/sample.hpp>
#include <iostream>
#include <string>
#include <vector>
Include dependency graph for lecuyeruniformrng.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

ql/MonteCarlo/sample.hpp iostream string vector

lecuyeruniformrng.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


900 QuantLib File Documentation

10.257 ql/RandomNumbers/mt19937uniformrng.hpp File Refer-


ence

10.257.1 Detailed Description

Mersenne Twister uniform random number generator.


#include <ql/MonteCarlo/sample.hpp>
#include <ql/types.hpp>
#include <vector>
Include dependency graph for mt19937uniformrng.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

ql/MonteCarlo/sample.hpp ql/types.hpp vector

mt19937uniformrng.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.258 ql/RandomNumbers/randomarraygenerator.hpp File Reference 901

10.258 ql/RandomNumbers/randomarraygenerator.hpp File


Reference

10.258.1 Detailed Description

Generates random arrays from a random number generator.


#include <ql/MonteCarlo/sample.hpp>
#include <ql/Math/pseudosqrt.hpp>
#include <ql/dataformatters.hpp>
Include dependency graph for randomarraygenerator.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/MonteCarlo/sample.hpp ql/dataformatters.hpp ql/Math/pseudosqrt.hpp

randomarraygenerator.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


902 QuantLib File Documentation

10.259 ql/RandomNumbers/randomsequencegenerator.hpp File


Reference

10.259.1 Detailed Description

Random sequence generator based on a pseudo-random number generator.


#include <ql/Math/array.hpp>
#include <ql/MonteCarlo/sample.hpp>
Include dependency graph for randomsequencegenerator.hpp:

exception string ql/qldefines.hpp

ql/errors.hpp ql/types.hpp ql/disposable.hpp functional numeric iostream

ql/Math/array.hpp ql/MonteCarlo/sample.hpp

randomsequencegenerator.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.260 ql/RandomNumbers/rngtraits.hpp File Reference 903

10.260 ql/RandomNumbers/rngtraits.hpp File Reference

10.260.1 Detailed Description

random-number generation policies


#include <ql/MonteCarlo/pathgenerator.hpp>
#include <ql/RandomNumbers/mt19937uniformrng.hpp>
#include <ql/RandomNumbers/inversecumgaussianrng.hpp>
#include <ql/RandomNumbers/randomsequencegenerator.hpp>
#include <ql/RandomNumbers/sobolrsg.hpp>
#include <ql/RandomNumbers/inversecumgaussianrsg.hpp>
#include <ql/Math/normaldistribution.hpp>
Include dependency graph for rngtraits.hpp:

ql/MonteCarlo/pathgenerator.hpp

ql/RandomNumbers/mt19937uniformrng.hpp

ql/RandomNumbers/inversecumgaussianrng.hpp

ql/RandomNumbers/randomsequencegenerator.hpp rngtraits.hpp

ql/RandomNumbers/sobolrsg.hpp

ql/RandomNumbers/inversecumgaussianrsg.hpp

ql/Math/normaldistribution.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


904 QuantLib File Documentation

10.261 ql/RandomNumbers/rngtypedefs.hpp File Reference

10.261.1 Detailed Description

Default choices for template instantiations.


#include <ql/RandomNumbers/rngtraits.hpp>
Include dependency graph for rngtypedefs.hpp:

ql/RandomNumbers/rngtraits.hpp

rngtypedefs.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.262 ql/RandomNumbers/sobolrsg.hpp File Reference 905

10.262 ql/RandomNumbers/sobolrsg.hpp File Reference

10.262.1 Detailed Description

Sobol low-discrepancy sequence generator.


#include <ql/Math/array.hpp>
#include <ql/MonteCarlo/sample.hpp>
#include <vector>
Include dependency graph for sobolrsg.hpp:

ql/Math/array.hpp ql/MonteCarlo/sample.hpp vector

sobolrsg.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


906 QuantLib File Documentation

10.263 ql/relinkablehandle.hpp File Reference

10.263.1 Detailed Description

Globally accessible relinkable pointer.


#include <ql/Patterns/observable.hpp>
Include dependency graph for relinkablehandle.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp exception string

ql/errors.hpp typeinfo

ql/handle.hpp list

ql/Patterns/observable.hpp

relinkablehandle.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.264 ql/scheduler.hpp File Reference 907

10.264 ql/scheduler.hpp File Reference

10.264.1 Detailed Description

date scheduler
#include <ql/calendar.hpp>
#include <ql/null.hpp>
#include <vector>
Include dependency graph for scheduler.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

ql/handle.hpp ql/date.hpp

ql/Patterns/bridge.hpp ql/null.hpp

ql/calendar.hpp vector

scheduler.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


908 QuantLib File Documentation

10.265 ql/ShortRateModels/calibrationhelper.hpp File Refer-


ence

10.265.1 Detailed Description

Calibration helper class.


#include <ql/grid.hpp>
#include <ql/pricingengine.hpp>
#include <ql/PricingEngines/blackmodel.hpp>
Include dependency graph for calibrationhelper.hpp:

list vector ql/dataformatters.hpp

ql/grid.hpp ql/termstructure.hpp ql/Math/normaldistribution.hpp

ql/pricingengine.hpp ql/PricingEngines/blackmodel.hpp

calibrationhelper.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.266 ql/ShortRateModels/CalibrationHelpers/caphelper.hpp File Reference 909

10.266 ql/ShortRateModels/CalibrationHelpers/caphelper.hpp
File Reference

10.266.1 Detailed Description

CapHelper calibration helper.


#include <ql/ShortRateModels/calibrationhelper.hpp>
#include <ql/Instruments/capfloor.hpp>
#include <ql/Indexes/xibor.hpp>
Include dependency graph for caphelper.hpp:

ql/ShortRateModels/calibrationhelper.hpp ql/Instruments/capfloor.hpp ql/Indexes/xibor.hpp

caphelper.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


910 QuantLib File Documentation

10.267 ql/ShortRateModels/CalibrationHelpers/swaptionhelper.hpp
File Reference

10.267.1 Detailed Description

Swaption calibration helper.


#include <ql/ShortRateModels/calibrationhelper.hpp>
#include <ql/Instruments/swaption.hpp>
Include dependency graph for swaptionhelper.hpp:

ql/ShortRateModels/calibrationhelper.hpp ql/Instruments/swaption.hpp

swaptionhelper.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.268 ql/ShortRateModels/model.hpp File Reference 911

10.268 ql/ShortRateModels/model.hpp File Reference

10.268.1 Detailed Description

Abstract interest rate model class.


#include <ql/option.hpp>
#include <ql/Lattices/lattice.hpp>
#include <ql/ShortRateModels/parameter.hpp>
#include <ql/ShortRateModels/calibrationhelper.hpp>
#include <ql/Optimization/problem.hpp>
Include dependency graph for model.hpp:

ql/option.hpp

ql/Lattices/lattice.hpp

ql/ShortRateModels/parameter.hpp model.hpp

ql/ShortRateModels/calibrationhelper.hpp

ql/Optimization/problem.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


912 QuantLib File Documentation

10.269 ql/ShortRateModels/onefactormodel.hpp File Reference

10.269.1 Detailed Description

Abstract one-factor interest rate model class.


#include <ql/diffusionprocess.hpp>
#include <ql/ShortRateModels/model.hpp>
#include <ql/Lattices/tree.hpp>
Include dependency graph for onefactormodel.hpp:

ql/diffusionprocess.hpp ql/ShortRateModels/model.hpp ql/Lattices/tree.hpp

onefactormodel.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.270 ql/ShortRateModels/OneFactorModels/blackkarasinski.hpp File Reference 913

10.270 ql/ShortRateModels/OneFactorModels/blackkarasinski.hpp
File Reference

10.270.1 Detailed Description

Black-Karasinski model.
#include <ql/ShortRateModels/onefactormodel.hpp>
Include dependency graph for blackkarasinski.hpp:

ql/diffusionprocess.hpp ql/ShortRateModels/model.hpp ql/Lattices/tree.hpp

ql/ShortRateModels/onefactormodel.hpp

blackkarasinski.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


914 QuantLib File Documentation

10.271 ql/ShortRateModels/OneFactorModels/coxingersollross.hpp
File Reference

10.271.1 Detailed Description

Cox-Ingersoll-Ross model.
#include <ql/ShortRateModels/onefactormodel.hpp>
Include dependency graph for coxingersollross.hpp:

ql/diffusionprocess.hpp ql/ShortRateModels/model.hpp ql/Lattices/tree.hpp

ql/ShortRateModels/onefactormodel.hpp

coxingersollross.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.272 ql/ShortRateModels/OneFactorModels/extendedcoxingersollross.hpp File Reference915

10.272 ql/ShortRateModels/OneFactorModels/extendedcoxingersollross.hpp
File Reference

10.272.1 Detailed Description

Extended Cox-Ingersoll-Ross model.


#include <ql/ShortRateModels/OneFactorModels/coxingersollross.hpp>
Include dependency graph for extendedcoxingersollross.hpp:

ql/diffusionprocess.hpp ql/ShortRateModels/model.hpp ql/Lattices/tree.hpp

ql/ShortRateModels/onefactormodel.hpp

ql/ShortRateModels/OneFactorModels/coxingersollross.hpp

extendedcoxingersollross.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


916 QuantLib File Documentation

10.273 ql/ShortRateModels/OneFactorModels/hullwhite.hpp
File Reference

10.273.1 Detailed Description

Hull & White (HW) model.


#include <ql/ShortRateModels/OneFactorModels/vasicek.hpp>
Include dependency graph for hullwhite.hpp:

ql/diffusionprocess.hpp ql/ShortRateModels/model.hpp ql/Lattices/tree.hpp

ql/ShortRateModels/onefactormodel.hpp

ql/ShortRateModels/OneFactorModels/vasicek.hpp

hullwhite.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.274 ql/ShortRateModels/OneFactorModels/vasicek.hpp File Reference 917

10.274 ql/ShortRateModels/OneFactorModels/vasicek.hpp File


Reference

10.274.1 Detailed Description

Vasicek model class.


#include <ql/ShortRateModels/onefactormodel.hpp>
Include dependency graph for vasicek.hpp:

ql/diffusionprocess.hpp ql/ShortRateModels/model.hpp ql/Lattices/tree.hpp

ql/ShortRateModels/onefactormodel.hpp

vasicek.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


918 QuantLib File Documentation

10.275 ql/ShortRateModels/parameter.hpp File Reference

10.275.1 Detailed Description

Model parameter classes.


#include <ql/qldefines.hpp>
#include <ql/termstructure.hpp>
#include <ql/Optimization/constraint.hpp>
Include dependency graph for parameter.hpp:

ql/qldefines.hpp ql/termstructure.hpp ql/Optimization/constraint.hpp

parameter.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.276 ql/ShortRateModels/twofactormodel.hpp File Reference 919

10.276 ql/ShortRateModels/twofactormodel.hpp File Reference

10.276.1 Detailed Description

Abstract two-factor interest rate model class.


#include <ql/diffusionprocess.hpp>
#include <ql/ShortRateModels/model.hpp>
#include <ql/Lattices/lattice2d.hpp>
Include dependency graph for twofactormodel.hpp:

ql/diffusionprocess.hpp ql/ShortRateModels/model.hpp ql/Lattices/lattice2d.hpp

twofactormodel.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


920 QuantLib File Documentation

10.277 ql/ShortRateModels/TwoFactorModels/g2.hpp File Ref-


erence

10.277.1 Detailed Description

Two-factor additive Gaussian Model G2++.


#include <ql/ShortRateModels/twofactormodel.hpp>
#include <ql/Instruments/swaption.hpp>
Include dependency graph for g2.hpp:

ql/ShortRateModels/twofactormodel.hpp ql/Instruments/swaption.hpp

g2.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.278 ql/solver1d.hpp File Reference 921

10.278 ql/solver1d.hpp File Reference

10.278.1 Detailed Description

Abstract 1-D solver class.


#include <ql/null.hpp>
#include <ql/dataformatters.hpp>
#include <ql/Patterns/curiouslyrecurring.hpp>
Include dependency graph for solver1d.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/null.hpp ql/dataformatters.hpp ql/Patterns/curiouslyrecurring.hpp

solver1d.hpp

Namespaces
• namespace QuantLib

Defines
• #define MAX_FUNCTION_EVALUATIONS 100

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


922 QuantLib File Documentation

10.279 ql/Solvers1D/bisection.hpp File Reference

10.279.1 Detailed Description

bisection 1-D solver


#include <ql/solver1d.hpp>
Include dependency graph for bisection.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/null.hpp ql/dataformatters.hpp ql/Patterns/curiouslyrecurring.hpp

ql/solver1d.hpp

bisection.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.280 ql/Solvers1D/brent.hpp File Reference 923

10.280 ql/Solvers1D/brent.hpp File Reference

10.280.1 Detailed Description

Brent 1-D solver.


#include <ql/solver1d.hpp>
Include dependency graph for brent.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/null.hpp ql/dataformatters.hpp ql/Patterns/curiouslyrecurring.hpp

ql/solver1d.hpp

brent.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


924 QuantLib File Documentation

10.281 ql/Solvers1D/falseposition.hpp File Reference

10.281.1 Detailed Description

false-position 1-D solver


#include <ql/solver1d.hpp>
Include dependency graph for falseposition.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/null.hpp ql/dataformatters.hpp ql/Patterns/curiouslyrecurring.hpp

ql/solver1d.hpp

falseposition.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.282 ql/Solvers1D/newton.hpp File Reference 925

10.282 ql/Solvers1D/newton.hpp File Reference

10.282.1 Detailed Description

Newton 1-D solver.


#include <ql/Solvers1D/newtonsafe.hpp>
Include dependency graph for newton.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/null.hpp ql/dataformatters.hpp ql/Patterns/curiouslyrecurring.hpp

ql/solver1d.hpp

ql/Solvers1D/newtonsafe.hpp

newton.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


926 QuantLib File Documentation

10.283 ql/Solvers1D/newtonsafe.hpp File Reference

10.283.1 Detailed Description

Safe (bracketed) Newton 1-D solver.


#include <ql/solver1d.hpp>
Include dependency graph for newtonsafe.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/null.hpp ql/dataformatters.hpp ql/Patterns/curiouslyrecurring.hpp

ql/solver1d.hpp

newtonsafe.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.284 ql/Solvers1D/ridder.hpp File Reference 927

10.284 ql/Solvers1D/ridder.hpp File Reference

10.284.1 Detailed Description

Ridder 1-D solver.


#include <ql/solver1d.hpp>
Include dependency graph for ridder.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/null.hpp ql/dataformatters.hpp ql/Patterns/curiouslyrecurring.hpp

ql/solver1d.hpp

ridder.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


928 QuantLib File Documentation

10.285 ql/Solvers1D/secant.hpp File Reference

10.285.1 Detailed Description

secant 1-D solver


#include <ql/solver1d.hpp>
Include dependency graph for secant.hpp:

ql/qldefines.hpp

ql/currency.hpp ql/option.hpp ql/Math/matrix.hpp

ql/null.hpp ql/dataformatters.hpp ql/Patterns/curiouslyrecurring.hpp

ql/solver1d.hpp

secant.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.286 ql/stochasticprocess.hpp File Reference 929

10.286 ql/stochasticprocess.hpp File Reference

10.286.1 Detailed Description

Base stochastic process class.


#include <ql/termstructure.hpp>
#include <ql/voltermstructure.hpp>
Include dependency graph for stochasticprocess.hpp:

ql/termstructure.hpp ql/voltermstructure.hpp

stochasticprocess.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


930 QuantLib File Documentation

10.287 ql/swaptionvolstructure.hpp File Reference

10.287.1 Detailed Description

Swaption volatility structure.


#include <ql/daycounter.hpp>
#include <ql/Patterns/observable.hpp>
Include dependency graph for swaptionvolstructure.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

exception string ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

list ql/handle.hpp ql/date.hpp

ql/Patterns/observable.hpp ql/Patterns/bridge.hpp

ql/daycounter.hpp

swaptionvolstructure.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.288 ql/termstructure.hpp File Reference 931

10.288 ql/termstructure.hpp File Reference

10.288.1 Detailed Description

Term structure.
#include <ql/calendar.hpp>
#include <ql/daycounter.hpp>
#include <ql/dataformatters.hpp>
#include <ql/marketelement.hpp>
#include <vector>
Include dependency graph for termstructure.hpp:

ql/calendar.hpp ql/daycounter.hpp ql/dataformatters.hpp ql/marketelement.hpp vector

termstructure.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


932 QuantLib File Documentation

10.289 ql/TermStructures/affinetermstructure.hpp File Refer-


ence

10.289.1 Detailed Description

Affine term structure.


#include <ql/dataformatters.hpp>
#include <ql/ShortRateModels/model.hpp>
#include <ql/Optimization/method.hpp>
#include <ql/TermStructures/ratehelpers.hpp>
Include dependency graph for affinetermstructure.hpp:

ql/dataformatters.hpp

ql/ShortRateModels/model.hpp
affinetermstructure.hpp
ql/Optimization/method.hpp

ql/TermStructures/ratehelpers.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.290 ql/TermStructures/compoundforward.hpp File Reference 933

10.290 ql/TermStructures/compoundforward.hpp File Refer-


ence

10.290.1 Detailed Description

compounded forward term structure


#include <ql/termstructure.hpp>
#include <ql/Math/loglinearinterpolation.hpp>
Include dependency graph for compoundforward.hpp:

ql/termstructure.hpp ql/Math/loglinearinterpolation.hpp

compoundforward.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


934 QuantLib File Documentation

10.291 ql/TermStructures/discountcurve.hpp File Reference

10.291.1 Detailed Description

pre-bootstrapped discount factor structure


#include <ql/termstructure.hpp>
#include <ql/DayCounters/actual365.hpp>
#include <ql/Math/loglinearinterpolation.hpp>
Include dependency graph for discountcurve.hpp:

ql/termstructure.hpp ql/DayCounters/actual365.hpp ql/Math/loglinearinterpolation.hpp

discountcurve.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.292 ql/TermStructures/drifttermstructure.hpp File Reference 935

10.292 ql/TermStructures/drifttermstructure.hpp File Reference

10.292.1 Detailed Description

Drift term structure.


#include <ql/termstructure.hpp>
#include <ql/voltermstructure.hpp>
Include dependency graph for drifttermstructure.hpp:

ql/termstructure.hpp ql/voltermstructure.hpp

drifttermstructure.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


936 QuantLib File Documentation

10.293 ql/TermStructures/extendeddiscountcurve.hpp File Ref-


erence

10.293.1 Detailed Description

discount factor structure with detailed compound-forward calculation


#include <ql/TermStructures/discountcurve.hpp>
#include <map>
Include dependency graph for extendeddiscountcurve.hpp:

ql/termstructure.hpp ql/DayCounters/actual365.hpp ql/Math/loglinearinterpolation.hpp

ql/TermStructures/discountcurve.hpp map

extendeddiscountcurve.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.294 ql/TermStructures/flatforward.hpp File Reference 937

10.294 ql/TermStructures/flatforward.hpp File Reference

10.294.1 Detailed Description

flat forward rate term structure


#include <ql/termstructure.hpp>
#include <ql/DayCounters/actual365.hpp>
Include dependency graph for flatforward.hpp:

ql/calendar.hpp ql/dataformatters.hpp ql/marketelement.hpp vector ql/daycounter.hpp

ql/termstructure.hpp ql/DayCounters/actual365.hpp

flatforward.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


938 QuantLib File Documentation

10.295 ql/TermStructures/forwardspreadedtermstructure.hpp
File Reference

10.295.1 Detailed Description

Forward spreaded term structure.


#include <ql/termstructure.hpp>
Include dependency graph for forwardspreadedtermstructure.hpp:

ql/calendar.hpp ql/daycounter.hpp ql/dataformatters.hpp ql/marketelement.hpp vector

ql/termstructure.hpp

forwardspreadedtermstructure.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.296 ql/TermStructures/impliedtermstructure.hpp File Reference 939

10.296 ql/TermStructures/impliedtermstructure.hpp File Refer-


ence

10.296.1 Detailed Description

Implied term structure.


#include <ql/termstructure.hpp>
Include dependency graph for impliedtermstructure.hpp:

ql/calendar.hpp ql/daycounter.hpp ql/dataformatters.hpp ql/marketelement.hpp vector

ql/termstructure.hpp

impliedtermstructure.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


940 QuantLib File Documentation

10.297 ql/TermStructures/piecewiseflatforward.hpp File Refer-


ence

10.297.1 Detailed Description

piecewise flat forward term structure


#include <ql/TermStructures/ratehelpers.hpp>
#include <ql/solver1d.hpp>
Include dependency graph for piecewiseflatforward.hpp:

ql/Instruments/simpleswap.hpp ql/null.hpp ql/dataformatters.hpp ql/Patterns/curiouslyrecurring.hpp

ql/TermStructures/ratehelpers.hpp ql/solver1d.hpp

piecewiseflatforward.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.298 ql/TermStructures/quantotermstructure.hpp File Reference 941

10.298 ql/TermStructures/quantotermstructure.hpp File Refer-


ence

10.298.1 Detailed Description

Quanto term structure.


#include <ql/termstructure.hpp>
#include <ql/voltermstructure.hpp>
Include dependency graph for quantotermstructure.hpp:

ql/termstructure.hpp ql/voltermstructure.hpp

quantotermstructure.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


942 QuantLib File Documentation

10.299 ql/TermStructures/ratehelpers.hpp File Reference

10.299.1 Detailed Description

rate helpers base class


#include <ql/Instruments/simpleswap.hpp>
Include dependency graph for ratehelpers.hpp:

ql/Instruments/swap.hpp ql/Indexes/xibor.hpp ql/scheduler.hpp

ql/Instruments/simpleswap.hpp

ratehelpers.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.300 ql/TermStructures/zerocurve.hpp File Reference 943

10.300 ql/TermStructures/zerocurve.hpp File Reference

10.300.1 Detailed Description

pre-bootstrapped zero curve structure


#include <ql/termstructure.hpp>
#include <ql/DayCounters/actual365.hpp>
#include <ql/Math/linearinterpolation.hpp>
Include dependency graph for zerocurve.hpp:

ql/termstructure.hpp ql/DayCounters/actual365.hpp ql/Math/linearinterpolation.hpp

zerocurve.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


944 QuantLib File Documentation

10.301 ql/TermStructures/zerospreadedtermstructure.hpp File


Reference

10.301.1 Detailed Description

Zero spreaded term structure.


#include <ql/termstructure.hpp>
Include dependency graph for zerospreadedtermstructure.hpp:

ql/calendar.hpp ql/daycounter.hpp ql/dataformatters.hpp ql/marketelement.hpp vector

ql/termstructure.hpp

zerospreadedtermstructure.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.302 ql/types.hpp File Reference 945

10.302 ql/types.hpp File Reference

10.302.1 Detailed Description

Custom types.
#include <ql/qldefines.hpp>
Include dependency graph for types.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

types.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


946 QuantLib File Documentation

10.303 ql/Utilities/combiningiterator.hpp File Reference

10.303.1 Detailed Description

Iterator mapping a function to a set of underlying sequences.


#include <ql/qldefines.hpp>
Include dependency graph for combiningiterator.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

combiningiterator.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.304 ql/Utilities/couplingiterator.hpp File Reference 947

10.304 ql/Utilities/couplingiterator.hpp File Reference

10.304.1 Detailed Description

Iterator mapping a function to a pair of underlying sequences.


#include <ql/Utilities/iteratorcategories.hpp>
Include dependency graph for couplingiterator.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

ql/Utilities/iteratorcategories.hpp

couplingiterator.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


948 QuantLib File Documentation

10.305 ql/Utilities/filteringiterator.hpp File Reference

10.305.1 Detailed Description

Iterator filtering undesired data.


#include <ql/qldefines.hpp>
Include dependency graph for filteringiterator.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

filteringiterator.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.306 ql/Utilities/iteratorcategories.hpp File Reference 949

10.306 ql/Utilities/iteratorcategories.hpp File Reference

10.306.1 Detailed Description

Lowest common denominator between two iterator categories.


#include <ql/qldefines.hpp>
Include dependency graph for iteratorcategories.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

iteratorcategories.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


950 QuantLib File Documentation

10.307 ql/Utilities/processingiterator.hpp File Reference

10.307.1 Detailed Description

Iterator mapping a unary function to an underlying sequence.


#include <ql/qldefines.hpp>
Include dependency graph for processingiterator.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

processingiterator.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.308 ql/Utilities/steppingiterator.hpp File Reference 951

10.308 ql/Utilities/steppingiterator.hpp File Reference

10.308.1 Detailed Description

Iterator advancing in constant steps.


#include <ql/qldefines.hpp>
Include dependency graph for steppingiterator.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

ql/qldefines.hpp

steppingiterator.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


952 QuantLib File Documentation

10.309 ql/Volatilities/blackconstantvol.hpp File Reference

10.309.1 Detailed Description

Black constant volatility, no time dependence, no strike dependence.


#include <ql/voltermstructure.hpp>
#include <ql/DayCounters/actual365.hpp>
#include <ql/dataformatters.hpp>
Include dependency graph for blackconstantvol.hpp:

ql/voltermstructure.hpp ql/DayCounters/actual365.hpp ql/dataformatters.hpp

blackconstantvol.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.310 ql/Volatilities/blackvariancecurve.hpp File Reference 953

10.310 ql/Volatilities/blackvariancecurve.hpp File Reference

10.310.1 Detailed Description

Black volatility curve modelled as variance curve.


#include <ql/voltermstructure.hpp>
#include <ql/Math/interpolation.hpp>
#include <ql/DayCounters/actual365.hpp>
Include dependency graph for blackvariancecurve.hpp:

ql/voltermstructure.hpp ql/Math/interpolation.hpp ql/DayCounters/actual365.hpp

blackvariancecurve.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


954 QuantLib File Documentation

10.311 ql/Volatilities/blackvariancesurface.hpp File Reference

10.311.1 Detailed Description

Black volatility surface modelled as variance surface.


#include <ql/voltermstructure.hpp>
#include <ql/Math/matrix.hpp>
#include <ql/Math/interpolation2D.hpp>
#include <ql/DayCounters/actual365.hpp>
Include dependency graph for blackvariancesurface.hpp:

ql/voltermstructure.hpp ql/Math/matrix.hpp ql/Math/interpolation2D.hpp ql/DayCounters/actual365.hpp

blackvariancesurface.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.312 ql/Volatilities/capflatvolvector.hpp File Reference 955

10.312 ql/Volatilities/capflatvolvector.hpp File Reference

10.312.1 Detailed Description

Cap/floor at-the-money flat volatility vector.


#include <ql/capvolstructures.hpp>
#include <ql/Math/interpolationtraits.hpp>
#include <ql/DayCounters/thirty360.hpp>
#include <vector>
Include dependency graph for capflatvolvector.hpp:

ql/capvolstructures.hpp ql/Math/interpolationtraits.hpp ql/DayCounters/thirty360.hpp vector

capflatvolvector.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


956 QuantLib File Documentation

10.313 ql/Volatilities/impliedvoltermstructure.hpp File Refer-


ence

10.313.1 Detailed Description

Implied Black Vol Term Structure.


#include <ql/voltermstructure.hpp>
Include dependency graph for impliedvoltermstructure.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

string exception ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

list ql/handle.hpp ql/date.hpp

ql/Patterns/observable.hpp ql/Patterns/bridge.hpp ql/Patterns/visitor.hpp

ql/relinkablehandle.hpp ql/daycounter.hpp ql/calendar.hpp

ql/marketelement.hpp vector

ql/voltermstructure.hpp

impliedvoltermstructure.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.314 ql/Volatilities/localconstantvol.hpp File Reference 957

10.314 ql/Volatilities/localconstantvol.hpp File Reference

10.314.1 Detailed Description

Local constant volatility, no time dependence, no asset dependence.


#include <ql/Volatilities/blackconstantvol.hpp>
Include dependency graph for localconstantvol.hpp:

ql/voltermstructure.hpp ql/DayCounters/actual365.hpp ql/dataformatters.hpp

ql/Volatilities/blackconstantvol.hpp

localconstantvol.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


958 QuantLib File Documentation

10.315 ql/Volatilities/localvolcurve.hpp File Reference

10.315.1 Detailed Description

Local volatility curve derived from a Black curve.


#include <ql/Volatilities/blackvariancecurve.hpp>
Include dependency graph for localvolcurve.hpp:

ql/voltermstructure.hpp ql/Math/interpolation.hpp ql/DayCounters/actual365.hpp

ql/Volatilities/blackvariancecurve.hpp

localvolcurve.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.316 ql/Volatilities/localvolsurface.hpp File Reference 959

10.316 ql/Volatilities/localvolsurface.hpp File Reference

10.316.1 Detailed Description

Local volatility surface derived from a Black vol surface.


#include <ql/voltermstructure.hpp>
#include <ql/termstructure.hpp>
Include dependency graph for localvolsurface.hpp:

ql/voltermstructure.hpp ql/termstructure.hpp

localvolsurface.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


960 QuantLib File Documentation

10.317 ql/Volatilities/swaptionvolmatrix.hpp File Reference

10.317.1 Detailed Description

Swaption at-the-money volatility matrix.


#include <ql/swaptionvolstructure.hpp>
#include <ql/Math/matrix.hpp>
#include <ql/Math/interpolationtraits.hpp>
#include <vector>
Include dependency graph for swaptionvolmatrix.hpp:

ql/swaptionvolstructure.hpp ql/Math/matrix.hpp ql/Math/interpolationtraits.hpp vector

swaptionvolmatrix.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


10.318 ql/voltermstructure.hpp File Reference 961

10.318 ql/voltermstructure.hpp File Reference

10.318.1 Detailed Description

Volatility term structures.


#include <ql/calendar.hpp>
#include <ql/daycounter.hpp>
#include <ql/marketelement.hpp>
#include <ql/Patterns/visitor.hpp>
#include <vector>
Include dependency graph for voltermstructure.hpp:

ql/config.bcc.hpp cmath limits ctime cctype algorithm iterator

string exception ql/qldefines.hpp

typeinfo ql/errors.hpp ql/types.hpp utility functional

list ql/handle.hpp ql/date.hpp

ql/Patterns/observable.hpp ql/Patterns/bridge.hpp ql/Patterns/visitor.hpp

ql/relinkablehandle.hpp ql/daycounter.hpp ql/calendar.hpp

ql/marketelement.hpp vector

voltermstructure.hpp

Namespaces
• namespace QuantLib

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


962 QuantLib File Documentation

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


Chapter 11

QuantLib Example Documentation

11.1 AmericanOption.cpp

This example calculates American options using different methods

#include <ql/quantlib.hpp>

using namespace QuantLib;

int main(int argc, char* argv[])


{
try {
QL_IO_INIT

std::cout << "Using " << QL_VERSION << std::endl << std::endl;

// our option
Option::Type type(Option::Put);
double underlying = 36;
double strike = 40;
Spread dividendYield = 0.00;
Rate riskFreeRate = 0.06;
double volatility = 0.20;

Date todaysDate(15, May, 1998);


Date settlementDate(17, May, 1998);
Date exerciseDate(17, May, 1999);
DayCounter rateDayCounter = Actual365();
Time maturity = rateDayCounter.yearFraction(settlementDate,
exerciseDate);

std::cout << "option type = " << OptionTypeFormatter::toString(type)


<< std::endl;
std::cout << "Time to maturity = " << maturity
<< std::endl;
std::cout << "Underlying price = " << underlying
<< std::endl;
std::cout << "Strike = " << strike
<< std::endl;
std::cout << "Risk-free interest rate = " << riskFreeRate
<< std::endl;
std::cout << "dividend yield = " << dividendYield
<< std::endl;
std::cout << "Volatility = " << volatility
<< std::endl;
964 QuantLib Example Documentation

std::cout << std::endl;

std::string method;

double value, discrepancy, rightValue, relativeDiscrepancy;


rightValue = (type == Option::Put ? 4.48667344 : 2.17372645);

std::cout << std::endl ;

// write column headings


std::cout << "Method\t\t\t\t Value\t\tDiscrepancy"
"\tRel. Discr." << std::endl;

Date midlifeDate(19, November, 1998);


std::vector<Date> exDates(2);
exDates[0]=midlifeDate;
exDates[1]=exerciseDate;

Handle<Exercise> exercise(new EuropeanExercise(exerciseDate));


Handle<Exercise> amExercise(new AmericanExercise(settlementDate,
exerciseDate));
Handle<Exercise> berExercise(new BermudanExercise(exDates));

RelinkableHandle<Quote> underlyingH(
Handle<Quote>(new SimpleQuote(underlying)));

// bootstrap the yield/dividend/vol curves


RelinkableHandle<TermStructure> flatTermStructure(
Handle<TermStructure>(
new FlatForward(todaysDate, settlementDate,
riskFreeRate, rateDayCounter)));
RelinkableHandle<TermStructure> flatDividendTS(
Handle<TermStructure>(
new FlatForward(todaysDate, settlementDate,
dividendYield, rateDayCounter)));
RelinkableHandle<BlackVolTermStructure> flatVolTS(
Handle<BlackVolTermStructure>(
new BlackConstantVol(settlementDate, volatility)));

std::vector<Date> dates(4);
dates[0] = settlementDate.plusMonths(1);
dates[1] = exerciseDate;
dates[2] = exerciseDate.plusMonths(6);
dates[3] = exerciseDate.plusMonths(12);
std::vector<double> strikes(4);
strikes[0] = underlying*0.9;
strikes[1] = underlying;
strikes[2] = underlying*1.1;
strikes[3] = underlying*1.2;

Matrix vols(4,4);
vols[0][0] = volatility*1.1; vols[0][1] = volatility;
vols[0][2] = volatility*0.9; vols[0][3] = volatility*0.8;
vols[1][0] = volatility*1.1; vols[1][1] = volatility;
vols[1][2] = volatility*0.9; vols[1][3] = volatility*0.8;
vols[2][0] = volatility*1.1; vols[2][1] = volatility;
vols[2][2] = volatility*0.9; vols[2][3] = volatility*0.8;
vols[3][0] = volatility*1.1; vols[3][1] = volatility;
vols[3][2] = volatility*0.9; vols[3][3] = volatility*0.8;
RelinkableHandle<BlackVolTermStructure> blackSurface(
Handle<BlackVolTermStructure>(
new BlackVarianceSurface(settlementDate, dates, strikes, vols)));

Handle<StrikedTypePayoff> payoff(new
PlainVanillaPayoff(type, strike));

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.1 AmericanOption.cpp 965

Handle<BlackScholesStochasticProcess> stochasticProcess(new
BlackScholesStochasticProcess(
underlyingH,
flatDividendTS,
flatTermStructure,
flatVolTS));

// European option
VanillaOption euroOption(stochasticProcess, payoff, exercise,
Handle<PricingEngine>(new AnalyticEuropeanEngine()));

// method: Black Scholes Engine


method = "equivalent european option ";
value = euroOption.NPV();
std::cout << method << " "
<< DoubleFormatter::toString(value, 6) << "\t"
<< "N/A\t\t"
<< "N/A\t\t"
<< std::endl;

// American option
VanillaOption option(stochasticProcess, payoff, amExercise);

Size timeSteps = 801;

// Binomial Method (JR)


method = "Binomial Jarrow-Rudd ";
option.setPricingEngine(Handle<PricingEngine>(
new BinomialVanillaEngine<JarrowRudd>(timeSteps)));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << " "
<< DoubleFormatter::toString(value, 6) << "\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// Binomial Method (CRR)


method = "Binomial Cox-Ross-Rubinstein ";
option.setPricingEngine(Handle<PricingEngine>(
new BinomialVanillaEngine<CoxRossRubinstein>(timeSteps)));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << " "
<< DoubleFormatter::toString(value, 6) << "\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// Equal Probability Additive Binomial Tree (EQP)


method = "Additive Equiprobabilities ";
option.setPricingEngine(Handle<PricingEngine>(
new BinomialVanillaEngine<AdditiveEQPBinomialTree>(timeSteps)));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << " "
<< DoubleFormatter::toString(value, 6) << "\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// Equal Jumps Additive Binomial Tree (Trigeorgis)


method = "Binomial Trigeorgis ";
option.setPricingEngine(Handle<PricingEngine>(

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


966 QuantLib Example Documentation

new BinomialVanillaEngine<Trigeorgis>(timeSteps)));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << " "
<< DoubleFormatter::toString(value, 6) << "\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// Tian Binomial Tree (third moment matching)


method = "Binomial Tian ";
option.setPricingEngine(Handle<PricingEngine>(
new BinomialVanillaEngine<Tian>(timeSteps)));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << " "
<< DoubleFormatter::toString(value, 6) << "\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// Leisen-Reimer Binomial Tree


method = "Binomial Leisen-Reimer ";
option.setPricingEngine(Handle<PricingEngine>(
new BinomialVanillaEngine<LeisenReimer>(timeSteps)));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << " "
<< DoubleFormatter::toString(value, 6) << "\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// Barone-Adesi and Whaley approximation


method = "Barone-Adesi and Whaley approx. ";
option.setPricingEngine(Handle<PricingEngine>(
new BaroneAdesiWhaleyApproximationEngine));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << " "
<< DoubleFormatter::toString(value, 6) << "\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// Bjerksund and Stensland approximation


method = "Bjerksund and Stensland approx. ";
option.setPricingEngine(Handle<PricingEngine>(
new BjerksundStenslandApproximationEngine));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << " "
<< DoubleFormatter::toString(value, 6) << "\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

return 0;
} catch (std::exception& e) {
std::cout << e.what() << std::endl;
return 1;
} catch (...) {

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.1 AmericanOption.cpp 967

std::cout << "unknown error" << std::endl;


return 1;
}
}

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


968 QuantLib Example Documentation

11.2 BermudanSwaption.cpp

This is an example of using the QuantLib short rate models.

#include <ql/quantlib.hpp>

using namespace QuantLib;

//Number of swaptions to be calibrated to...

Size numRows = 5;
Size numCols = 10;

unsigned int swaptionLengths[] = {1,2,3,4,5,7,10,15,20,25,30};


double swaptionVols[] = {
23.92, 22.80, 19.8, 18.1, 16.0, 14.26, 13.56, 12.79, 12.3, 11.09,
21.85, 21.50, 19.5, 17.2, 14.7, 13.23, 12.59, 12.29, 11.1, 10.30,
19.46, 19.40, 17.9, 15.9, 13.9, 12.69, 12.15, 11.83, 10.8, 10.00,
17.97, 17.80, 16.7, 14.9, 13.4, 12.28, 11.89, 11.48, 10.5, 9.80,
16.29, 16.40, 15.1, 14.0, 12.9, 12.01, 11.46, 11.08, 10.4, 9.77,
14.71, 14.90, 14.3, 13.2, 12.3, 11.49, 11.12, 10.70, 10.1, 9.57,
12.93, 13.30, 12.8, 12.2, 11.6, 10.82, 10.47, 10.21, 9.8, 9.51,
12.70, 12.10, 11.9, 11.2, 10.8, 10.40, 10.20, 10.00, 9.5, 9.00,
12.30, 11.60, 11.6, 10.9, 10.5, 10.30, 10.00, 9.80, 9.3, 8.80,
12.00, 11.40, 11.5, 10.8, 10.3, 10.00, 9.80, 9.60, 9.5, 9.10,
11.50, 11.20, 11.3, 10.6, 10.2, 10.10, 9.70, 9.50, 9.4, 8.60};

void calibrateModel(const Handle<ShortRateModel>& model,


CalibrationSet& calibs,
double lambda) {

Simplex om(lambda, 1e-9);


om.setEndCriteria(EndCriteria(10000, 1e-7));
model->calibrate(calibs, om);

#if defined(QL_PATCH_DARWIN)
// to be investigated
return;
#endif

//Output the implied Black volatilities


Size i;
for (i=0; i<numRows; i++) {
std::cout << IntegerFormatter::toString(swaptionLengths[i],2) << "y|";
for (Size j=0; j<numCols; j++) {
Size k = i*numCols + j;
double npv = calibs[k]->modelValue();
double implied = calibs[k]->impliedVolatility(npv, 1e-4,
1000, 0.05, 0.50)*100.0;
std::cout << DoubleFormatter::toString(implied,1,4) << " (";
k = i*10 + j;
double diff = implied - swaptionVols[k];
std::cout << DoubleFormatter::toString(diff,1,4)
<< ")|";
}
std::cout << std::endl;
}
}

int main(int argc, char* argv[])


{
try {
QL_IO_INIT

Date todaysDate(15, February, 2002);


Calendar calendar = TARGET();

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.2 BermudanSwaption.cpp 969

// Date settlementDate = calendar.advance(todaysDate,


// settlementDays, Days);
Date settlementDate(19, February, 2002);

//Instruments used to bootstrap the yield curve:


std::vector<Handle<RateHelper> > instruments;

//Deposit rates
DayCounter depositDayCounter = Thirty360();
int settlementDays = 2;

Rate weekRates[3] = {3.295, 3.3, 3.3};


Size i;
for (i=0; i<3; i++) {
RelinkableHandle<Quote> depositRate(
Handle<Quote>(new SimpleQuote(weekRates[i]*0.01)));
Handle<RateHelper> depositHelper(new DepositRateHelper(
depositRate, i+1, Weeks, settlementDays, calendar,
ModifiedFollowing, depositDayCounter));
instruments.push_back(depositHelper);
}

Rate depositRates[12] = {
3.31, 3.32, 3.29, 3.35, 3.315, 3.33,
3.395, 3.41, 3.41, 3.49, 3.54, 3.53};

for (i=0; i<11; i++) {


RelinkableHandle<Quote> depositRate(
Handle<Quote>(new SimpleQuote(depositRates[i]*0.01)));
Handle<RateHelper> depositHelper(new DepositRateHelper(
depositRate, i+1, Months, settlementDays, calendar,
ModifiedFollowing, depositDayCounter));
instruments.push_back(depositHelper);
}

//Swap rates
Rate swapRates[13] = {
3.6425, 4.0875, 4.38, 4.5815, 4.74325, 4.87375,
4.9775, 5.07, 5.13, 5.1825, 5.36, 5.45125, 5.43875};
int swapYears[13] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30};

int swFixedLegFrequency = 1;
bool swFixedLegIsAdjusted = false;
DayCounter swFixedLegDayCounter = Thirty360(Thirty360::European);
int swFloatingLegFrequency = 2;

for (i=0; i<13; i++) {


Handle<Quote> swapRate(new SimpleQuote(swapRates[i]*0.01));
Handle<RateHelper> swapHelper(new SwapRateHelper(
RelinkableHandle<Quote>(swapRate),
swapYears[i], Years, settlementDays,
calendar, ModifiedFollowing,
swFixedLegFrequency,
swFixedLegIsAdjusted, swFixedLegDayCounter,
swFloatingLegFrequency));
instruments.push_back(swapHelper);
}

// bootstrapping the yield curve


Handle<PiecewiseFlatForward> myTermStructure(new
PiecewiseFlatForward(todaysDate, settlementDate, instruments,
depositDayCounter));

RelinkableHandle<TermStructure> rhTermStructure;
rhTermStructure.linkTo(myTermStructure);

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


970 QuantLib Example Documentation

//Define the ATM/OTM/ITM swaps


int fixedLegFrequency = 1;
bool fixedLegIsAdjusted = false;
RollingConvention roll = ModifiedFollowing;
DayCounter fixedLegDayCounter = Thirty360(Thirty360::European);
int floatingLegFrequency = 2;
bool payFixedRate = true;
int fixingDays = 2;
Rate dummyFixedRate = 0.03;
Handle<Xibor> indexSixMonths(new Euribor(6, Months, rhTermStructure));

Handle<SimpleSwap> swap(new SimpleSwap(


payFixedRate, settlementDate.plusYears(1), 5, Years,
calendar, roll, 1000.0, fixedLegFrequency, dummyFixedRate,
fixedLegIsAdjusted, fixedLegDayCounter, floatingLegFrequency,
indexSixMonths, fixingDays, 0.0, rhTermStructure));
Rate fixedATMRate = swap->fairRate();

Handle<SimpleSwap> atmSwap(new SimpleSwap(


payFixedRate, settlementDate.plusYears(1), 5, Years,
calendar, roll, 1000.0, fixedLegFrequency, fixedATMRate,
fixedLegIsAdjusted, fixedLegDayCounter, floatingLegFrequency,
indexSixMonths, fixingDays, 0.0, rhTermStructure));
Handle<SimpleSwap> otmSwap(new SimpleSwap(
payFixedRate, settlementDate.plusYears(1), 5, Years,
calendar, roll, 1000.0, fixedLegFrequency, fixedATMRate * 1.2,
fixedLegIsAdjusted, fixedLegDayCounter, floatingLegFrequency,
indexSixMonths, fixingDays, 0.0, rhTermStructure));
Handle<SimpleSwap> itmSwap(new SimpleSwap(
payFixedRate, settlementDate.plusYears(1), 5, Years,
calendar, roll, 1000.0, fixedLegFrequency, fixedATMRate * 0.8,
fixedLegIsAdjusted, fixedLegDayCounter, floatingLegFrequency,
indexSixMonths, fixingDays, 0.0, rhTermStructure));

std::vector<Period> swaptionMaturities;
swaptionMaturities.push_back(Period(1, Months));
swaptionMaturities.push_back(Period(3, Months));
swaptionMaturities.push_back(Period(6, Months));
swaptionMaturities.push_back(Period(1, Years));
swaptionMaturities.push_back(Period(2, Years));
swaptionMaturities.push_back(Period(3, Years));
swaptionMaturities.push_back(Period(4, Years));
swaptionMaturities.push_back(Period(5, Years));
swaptionMaturities.push_back(Period(7, Years));
swaptionMaturities.push_back(Period(10, Years));

CalibrationSet swaptions;

//List of times that have to be included in the timegrid


std::list<Time> times;

for (i=0; i<numRows; i++) {


for (unsigned int j=0; j<numCols; j++) {
unsigned int k = i*10 + j;
Handle<Quote> vol(new SimpleQuote(swaptionVols[k]*0.01));
swaptions.push_back(Handle<CalibrationHelper>(
new SwaptionHelper(swaptionMaturities[j],
Period(swaptionLengths[i], Years),
RelinkableHandle<Quote>(vol),
indexSixMonths,
rhTermStructure)));
swaptions.back()->addTimesTo(times);
}
}
const std::vector<Time> termTimes = myTermStructure->times();
for (i=0; i<termTimes.size(); i++)

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.2 BermudanSwaption.cpp 971

times.push_back(termTimes[i]);
// Building time-grid
TimeGrid grid(times.begin(), times.end(), 30);

Handle<HullWhite> modelHW(new HullWhite(rhTermStructure));


Handle<HullWhite> modelHW2(new HullWhite(rhTermStructure));
Handle<BlackKarasinski> modelBK(new BlackKarasinski(rhTermStructure));

std::cout << "Calibrating to swaptions" << std::endl;

std::cout << "Hull-White (analytic formulae):" << std::endl;


swaptions.setPricingEngine(
Handle<PricingEngine>(new JamshidianSwaption(modelHW)));

calibrateModel(modelHW, swaptions, 0.05);


std::cout << "calibrated to "
<< modelHW->params()
<< std::endl
<< std::endl;

std::cout << "Hull-White (numerical calibration):" << std::endl;


swaptions.setPricingEngine(
Handle<PricingEngine>(new TreeSwaption(modelHW2, grid)));

calibrateModel(modelHW2, swaptions, 0.05);


std::cout << "calibrated to "
<< modelHW2->params()
<< std::endl
<< std::endl;

std::cout << "Black-Karasinski: " << std::endl;


swaptions.setPricingEngine(
Handle<PricingEngine>(new TreeSwaption(modelBK, grid)));
calibrateModel(modelBK, swaptions, 0.05);
std::cout << "calibrated to "
<< modelBK->params()
<< std::endl
<< std::endl;

std::cout << "Pricing an ATM bermudan swaption" << std::endl;

//Define the bermudan swaption


std::vector<Date> bermudanDates;
const std::vector<Handle<CashFlow> >& leg = swap->floatingLeg();
for (i=0; i<leg.size(); i++) {
#if defined(HAVE_BOOST)
Handle<Coupon> coupon =
boost::dynamic_pointer_cast<Coupon>(leg[i]);
#else
Handle<Coupon> coupon = leg[i];
#endif
bermudanDates.push_back(coupon->accrualStartDate());
}

Handle<Exercise> bermudaExercise(new BermudanExercise(


bermudanDates));

Swaption bermudanSwaption(atmSwap,
bermudaExercise,
rhTermStructure,
Handle<PricingEngine>(new TreeSwaption(modelHW, 100)));

//Do the pricing for each model


bermudanSwaption.setPricingEngine(
Handle<PricingEngine>(new TreeSwaption(modelHW, 100)));

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


972 QuantLib Example Documentation

std::cout << "HW: " << bermudanSwaption.NPV() << std::endl;

bermudanSwaption.setPricingEngine(
Handle<PricingEngine>(new TreeSwaption(modelHW2, 100)));
std::cout << "HW (num): " << bermudanSwaption.NPV() << std::endl;

bermudanSwaption.setPricingEngine(
Handle<PricingEngine>(new TreeSwaption(modelBK, 100)));
std::cout << "BK: " << bermudanSwaption.NPV() << std::endl;

std::cout << "Pricing an OTM bermudan swaption" << std::endl;

Swaption otmBermudanSwaption(otmSwap,
bermudaExercise,
rhTermStructure,
Handle<PricingEngine>(new TreeSwaption(modelHW, 100)));

//Do the pricing for each model


otmBermudanSwaption.setPricingEngine(
Handle<PricingEngine>(new TreeSwaption(modelHW, 100)));
std::cout << "HW: " << otmBermudanSwaption.NPV() << std::endl;

otmBermudanSwaption.setPricingEngine(
Handle<PricingEngine>(new TreeSwaption(modelHW2, 100)));
std::cout << "HW (num): " << otmBermudanSwaption.NPV() << std::endl;

otmBermudanSwaption.setPricingEngine(
Handle<PricingEngine>(new TreeSwaption(modelBK, 100)));
std::cout << "BK: " << otmBermudanSwaption.NPV() << std::endl;

std::cout << "Pricing an ITM bermudan swaption" << std::endl;

Swaption itmBermudanSwaption(itmSwap,
bermudaExercise,
rhTermStructure,
Handle<PricingEngine>(new TreeSwaption(modelHW, 100)));

//Do the pricing for each model


itmBermudanSwaption.setPricingEngine(
Handle<PricingEngine>(new TreeSwaption(modelHW, 100)));
std::cout << "HW: " << itmBermudanSwaption.NPV() << std::endl;
itmBermudanSwaption.setPricingEngine(
Handle<PricingEngine>(new TreeSwaption(modelHW2, 100)));
std::cout << "HW (num): " << itmBermudanSwaption.NPV() << std::endl;
itmBermudanSwaption.setPricingEngine(
Handle<PricingEngine>(new TreeSwaption(modelBK, 100)));
std::cout << "BK: " << itmBermudanSwaption.NPV() << std::endl;

return 0;
} catch (std::exception& e) {
std::cout << e.what() << std::endl;
return 1;
} catch (...) {
std::cout << "unknown error" << std::endl;
return 1;
}
}

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.3 DiscreteHedging.cpp 973

11.3 DiscreteHedging.cpp

This is an example of using the QuantLib Monte Carlo framework.

/* This example computes profit and loss of a discrete interval hedging


strategy and compares with the results of Derman & Kamal’s (Goldman Sachs
Equity Derivatives Research) Research Note: "When You Cannot Hedge
Continuously: The Corrections to Black-Scholes"
(http://www.gs.com/qs/doc/when_you_cannot_hedge.pdf)

Suppose an option hedger sells an European option and receives the


Black-Scholes value as the options premium.
Then he follows a Black-Scholes hedging strategy, rehedging at discrete,
evenly spaced time intervals as the underlying stock changes. At
expiration, the hedger delivers the option payoff to the option holder,
and unwinds the hedge. We are interested in understanding the final
profit or loss of this strategy.

If the hedger had followed the exact Black-Scholes replication strategy,


re-hedging continuously as the underlying stock evolved towards its final
value at expiration, then, no matter what path the stock took, the final
P&L would be exactly zero. When the replication strategy deviates from
the exact Black-Scholes method, the final P&L may deviate from zero. This
deviation is called the replication error. When the hedger rebalances at
discrete rather than continuous intervals, the hedge is imperfect and the
replication is inexact. The more often hedging occurs, the smaller the
replication error.

We examine the range of possibilities, computing the replication error.


*/

// the only header you need to use QuantLib


#include <ql/quantlib.hpp>

using namespace QuantLib;

/* The ReplicationError class carries out Monte Carlo simulations to evaluate


the outcome (the replication error) of the discrete hedging strategy over
different, randomly generated scenarios of future stock price evolution.
*/
class ReplicationError
{
public:
ReplicationError(Option::Type type,
Time maturity,
double strike,
double s0,
double sigma,
Rate r)
: maturity_(maturity), payoff_(type, strike), s0_(s0),
sigma_(sigma), r_(r) {

// value of the option


EuropeanOption option = EuropeanOption(type, s0_, strike, 0.0, r_,
maturity_, sigma_);
std::cout << "Option value: " << option.value() << std::endl;

// store option’s vega, since Derman and Kamal’s formula needs it


vega_ = option.vega();

std::cout << std::endl;


std::cout <<
" | | P&L \t| P&L | Derman&Kamal | P&L"
" \t| P&L" << std::endl;

std::cout <<

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


974 QuantLib Example Documentation

"samples | trades | Mean \t| Std Dev | Formula |"


" skewness \t| kurt." << std::endl;

std::cout << "---------------------------------"


"----------------------------------------------" << std::endl;
}

// the actual replication error computation


void compute(int nTimeSteps, int nSamples);
private:
Time maturity_;
PlainVanillaPayoff payoff_;
double s0_;
double sigma_;
Rate r_;
double vega_;
};

// The key for the MonteCarlo simulation is to have a PathPricer_old that


// implements a value(const Path& path) method.
// This method prices the portfolio for each Path of the random variable
class ReplicationPathPricer : public PathPricer_old<Path>
{
public:
// real constructor
ReplicationPathPricer(Option::Type type,
double underlying,
double strike,
Rate r,
Time maturity,
double sigma)
: PathPricer_old<Path>(1.0, false), type_(type), underlying_(underlying),
strike_(strike), r_(r), maturity_(maturity), sigma_(sigma) {
QL_REQUIRE(strike_ > 0.0,
"ReplicationPathPricer: strike must be positive");
QL_REQUIRE(underlying_ > 0.0,
"ReplicationPathPricer: underlying must be positive");
QL_REQUIRE(r_ >= 0.0,
"ReplicationPathPricer: risk free rate (r) must"
" be positive or zero");
QL_REQUIRE(maturity_ > 0.0,
"ReplicationPathPricer: maturity must be positive");
QL_REQUIRE(sigma_ >= 0.0,
"ReplicationPathPricer: volatility (sigma)"
" must be positive or zero");

}
// The value() method encapsulates the pricing code
double operator()(const Path& path) const;

private:
Option::Type type_;
double underlying_, strike_;
Rate r_;
Time maturity_;
double sigma_;
};

// Compute Replication Error as in the Derman and Kamal’s research note


int main(int argc, char* argv[])
{
try {
QL_IO_INIT

Time maturity = 1./12.; // 1 month


double strike = 100;

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.3 DiscreteHedging.cpp 975

double underlying = 100;


double volatility = 0.20; // 20%
Rate riskFreeRate = 0.05; // 5%
ReplicationError rp(Option::Call, maturity, strike, underlying,
volatility, riskFreeRate);

int scenarios = 50000;


int hedgesNum;

hedgesNum = 21;
rp.compute(hedgesNum, scenarios);

hedgesNum = 84;
rp.compute(hedgesNum, scenarios);

return 0;
} catch (std::exception& e) {
std::cout << e.what() << std::endl;
return 1;
} catch (...) {
std::cout << "unknown error" << std::endl;
return 1;
}
}

/* The actual computation of the Profit&Loss for each single path.

In each scenario N rehedging trades spaced evenly in time over


the life of the option are carried out, using the Black-Scholes
hedge ratio.
*/
double ReplicationPathPricer::operator()(const Path& path) const
{

// path is an instance of QuantLib::Path


// It contains the list of variations.
// It can be used as an array: it has a size() method
int n = path.size();
QL_REQUIRE(n>0,
"ReplicationPathPricer: the path cannot be empty");

// discrete hedging interval


Time dt = maturity_/n;

// For simplicity, we assume the stock pays no dividends.


double stockDividendYield = 0.0;

// let’s start
Time t = 0;

// stock value at t=0


double stock = underlying_;
double stockLogGrowth = 0.0;

// money account at t=0


double money_account = 0.0;

/************************/
/*** the initial deal ***/
/************************/
// option fair price (Black-Scholes) at t=0
EuropeanOption option = EuropeanOption(type_, stock, strike_,
stockDividendYield, r_, maturity_, sigma_);
// sell the option, cash in its premium
money_account += option.value();
// compute delta

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


976 QuantLib Example Documentation

double delta = option.delta();


// delta-hedge the option buying stock
double stockAmount = delta;
money_account -= stockAmount*stock;

/**********************************/
/*** hedging during option life ***/
/**********************************/
for(int step = 0; step < n-1; step++){

// time flows
t += dt;

// accruing on the money account


money_account *= QL_EXP( r_*dt );

// stock growth:
// path contains the list of Gaussian variations
// and path[n] is the n-th variation
stockLogGrowth += path[step];
stock = underlying_*QL_EXP(stockLogGrowth);

// recalculate option value at the current stock value,


// and the current time to maturity
EuropeanOption option = EuropeanOption(type_, stock, strike_,
stockDividendYield, r_, maturity_-t, sigma_);

// recalculate delta
delta = option.delta();

// re-hedging
money_account -= (delta - stockAmount)*stock;
stockAmount = delta;
}

/*************************/
/*** option expiration ***/
/*************************/
// last accrual on my money account
money_account *= QL_EXP( r_*dt );
// last stock growth
stockLogGrowth += path[n-1];
stock = underlying_*QL_EXP(stockLogGrowth);

// the hedger delivers the option payoff to the option holder


double optionPayoff = PlainVanillaPayoff(type_, strike_)(stock);
money_account -= optionPayoff;

// and unwinds the hedge selling his stock position


money_account += stockAmount*stock;

// final Profit&Loss
return money_account;
}

// The computation over nSamples paths of the P&L distribution


void ReplicationError::compute(int nTimeSteps, int nSamples)
{
QL_REQUIRE(nTimeSteps>0,
"ReplicationError::compute : the number of steps must be > 0");

// hedging interval
// double tau = maturity_ / nTimeSteps;

/* Black-Scholes framework: the underlying stock price evolves


lognormally with a fixed known volatility that stays constant

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.3 DiscreteHedging.cpp 977

throughout time.
*/
double drift = r_ - 0.5*sigma_*sigma_;

// Black Scholes equation rules the path generator:


// at each step the log of the stock
// will have drift and sigma^2 variance
Handle<GaussianPathGenerator_old> myPathGenerator(
new GaussianPathGenerator_old(drift, sigma_*sigma_,
maturity_, nTimeSteps));

// The replication strategy’s Profit&Loss is computed for each path


// of the stock. The path pricer knows how to price a path using its
// value() method
Handle<PathPricer_old<Path> > myPathPricer =
Handle<PathPricer_old<Path> >(new
ReplicationPathPricer(payoff_.optionType(), s0_,
payoff_.strike(), r_, maturity_, sigma_));

// a statistics accumulator for the path-dependant Profit&Loss values


Statistics statisticsAccumulator;

// The OneFactorMontecarloModel generates paths using myPathGenerator


// each path is priced using myPathPricer
// prices will be accumulated into statisticsAccumulator
OneFactorMonteCarloOption_old MCSimulation(myPathGenerator,
myPathPricer, statisticsAccumulator, false);

// the model simulates nSamples paths


MCSimulation.addSamples(nSamples);

// the sampleAccumulator method of OneFactorMonteCarloOption_old


// gives access to all the methods of statisticsAccumulator
double PLMean = MCSimulation.sampleAccumulator().mean();
double PLStDev = MCSimulation.sampleAccumulator().standardDeviation();
double PLSkew = MCSimulation.sampleAccumulator().skewness();
double PLKurt = MCSimulation.sampleAccumulator().kurtosis();

// Derman and Kamal’s formula


double theorStD = QL_SQRT(M_PI/4/nTimeSteps)*vega_*sigma_;

std::cout << nSamples << "\t| "


<< nTimeSteps << "\t | "
<< DoubleFormatter::toString(PLMean, 3) << " \t| "
<< DoubleFormatter::toString(PLStDev, 2) << " \t | "
<< DoubleFormatter::toString(theorStD, 2) << " \t | "
<< DoubleFormatter::toString(PLSkew, 2) << " \t| "
<< DoubleFormatter::toString(PLKurt, 2) << std::endl;
}

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


978 QuantLib Example Documentation

11.4 EuropeanOption.cpp

This example calculates European options using different methods while testing call-put parity.

#include <ql/quantlib.hpp>

using namespace QuantLib;

// This will be included in the library after a bit of redesign


class WeightedPayoff {
public:
WeightedPayoff(Option::Type type,
Time maturity,
double strike,
double s0,
double sigma,
Rate r,
Rate q)
: type_(type), maturity_(maturity),
strike_(strike),
s0_(s0),
sigma_(sigma),r_(r), q_(q){}

double operator()(double x) const {


double nuT = (r_-q_-0.5*sigma_*sigma_)*maturity_;
return QL_EXP(-r_*maturity_)
*PlainVanillaPayoff(type_, strike_)(s0_*QL_EXP(x))
*QL_EXP(-(x - nuT)*(x -nuT)/(2*sigma_*sigma_*maturity_))
/QL_SQRT(2.0*M_PI*sigma_*sigma_*maturity_);
}
private:
Option::Type type_;
Time maturity_;
double strike_;
double s0_;
double sigma_;
Rate r_,q_;
};

int main(int argc, char* argv[])


{
try {
QL_IO_INIT

std::cout << "Using " << QL_VERSION << std::endl << std::endl;

// our option
Option::Type type(Option::Call);
double underlying = 7;
double strike = 8;
Spread dividendYield = 0.05;
Rate riskFreeRate = 0.05;

Date todaysDate(15, May, 1998);


Date settlementDate(17, May, 1998);
Date exerciseDate(17, May, 1999);
DayCounter rateDayCounter = Actual365();
Time maturity = rateDayCounter.yearFraction(settlementDate,
exerciseDate);

double volatility = 0.10;


std::cout << "option type = " << OptionTypeFormatter::toString(type)
<< std::endl;
std::cout << "Time to maturity = " << maturity
<< std::endl;

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.4 EuropeanOption.cpp 979

std::cout << "Underlying price = " << underlying


<< std::endl;
std::cout << "Strike = " << strike
<< std::endl;
std::cout << "Risk-free interest rate = " << riskFreeRate
<< std::endl;
std::cout << "dividend yield = " << dividendYield
<< std::endl;
std::cout << "Volatility = " << volatility
<< std::endl;
std::cout << std::endl;

std::string method;
double value, discrepancy, rightValue, relativeDiscrepancy;

std::cout << std::endl << std::endl ;

// write column headings


std::cout << "Method\t\tValue\tEstimatedError\tDiscrepancy"
"\tRel. Discr." << std::endl;

// first method: Black Scholes analytic solution


method ="Black Scholes";
value = EuropeanOption(type, underlying, strike,
dividendYield, riskFreeRate, maturity, volatility).value();
double estimatedError = 0.0;
discrepancy = 0.0;
relativeDiscrepancy = 0.0;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< DoubleFormatter::toString(estimatedError, 4) << "\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// store the Black Scholes value as the correct one


rightValue = value;

// second method: Call-Put parity


method ="Call-Put parity";
Option::Type reverseType =
(type==Option::Call ? Option::Put : Option::Call);
double coefficient =
(type==Option::Call ? 1.0 : -1.0);
value = EuropeanOption(reverseType, underlying, strike,
dividendYield, riskFreeRate, maturity, volatility).value()
+ coefficient * (underlying*QL_EXP(-dividendYield*maturity)
- strike*QL_EXP(- riskFreeRate*maturity));
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< "N/A\t\t"
<< discrepancy << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// third method: Integral

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


980 QuantLib Example Documentation

method ="Integral";
WeightedPayoff po(type, maturity, strike, underlying,
volatility, riskFreeRate, dividendYield);
SegmentIntegral integrator(5000);

double nuT = (riskFreeRate - dividendYield


+ 0.5*volatility*volatility)*maturity;
double infinity = 10.0*volatility*QL_SQRT(maturity);

value = integrator(po, nuT-infinity, nuT+infinity);


discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< "N/A\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// fourth method: Finite Differences


method ="Finite Diff.";
Size grid = 100;
value = FdEuropean(type, underlying, strike,
dividendYield, riskFreeRate, maturity, volatility, grid).value();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< "N/A\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

/************************************/

// New option pricing framework


std::cout << "\nNew Pricing engine framework" << std::endl;

Date midlifeDate(19, November, 1998);


std::vector<Date> exDates(2);
exDates[0]=midlifeDate;
exDates[1]=exerciseDate;

Handle<Exercise> exercise(new EuropeanExercise(exerciseDate));


Handle<Exercise> amExercise(new AmericanExercise(settlementDate,
exerciseDate));
Handle<Exercise> berExercise(new BermudanExercise(exDates));

RelinkableHandle<Quote> underlyingH(
Handle<Quote>(new SimpleQuote(underlying)));

// bootstrap the yield/dividend/vol curves


RelinkableHandle<TermStructure> flatTermStructure(
Handle<TermStructure>(
new FlatForward(todaysDate, settlementDate,
riskFreeRate, rateDayCounter)));
RelinkableHandle<TermStructure> flatDividendTS(
Handle<TermStructure>(
new FlatForward(todaysDate, settlementDate,
dividendYield, rateDayCounter)));
RelinkableHandle<BlackVolTermStructure> flatVolTS(
Handle<BlackVolTermStructure>(

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.4 EuropeanOption.cpp 981

new BlackConstantVol(settlementDate, volatility)));

std::vector<Date> dates(4);
dates[0] = settlementDate.plusMonths(1);
dates[1] = exerciseDate;
dates[2] = exerciseDate.plusMonths(6);
dates[3] = exerciseDate.plusMonths(12);
std::vector<double> strikes(4);
strikes[0] = underlying*0.9;
strikes[1] = underlying;
strikes[2] = underlying*1.1;
strikes[3] = underlying*1.2;

Matrix vols(4,4);
vols[0][0] = volatility*1.1;
vols[0][1] = volatility;
vols[0][2] = volatility*0.9;
vols[0][3] = volatility*0.8;
vols[1][0] = volatility*1.1;
vols[1][1] = volatility;
vols[1][2] = volatility*0.9;
vols[1][3] = volatility*0.8;
vols[2][0] = volatility*1.1;
vols[2][1] = volatility;
vols[2][2] = volatility*0.9;
vols[2][3] = volatility*0.8;
vols[3][0] = volatility*1.1;
vols[3][1] = volatility;
vols[3][2] = volatility*0.9;
vols[3][3] = volatility*0.8;

RelinkableHandle<BlackVolTermStructure> blackSurface(
Handle<BlackVolTermStructure>(
new BlackVarianceSurface(settlementDate, dates,
strikes, vols)));

Handle<StrikedTypePayoff> payoff(new
PlainVanillaPayoff(type, strike));

Handle<BlackScholesStochasticProcess> stochasticProcess(new
BlackScholesStochasticProcess(underlyingH, flatDividendTS,
flatTermStructure,
// blackSurface
flatVolTS));

VanillaOption option(stochasticProcess, payoff, exercise,


Handle<PricingEngine>(new AnalyticEuropeanEngine()));

// method: Black Scholes Engine


method = "Black Scholes";
option.setPricingEngine(Handle<PricingEngine>(
new AnalyticEuropeanEngine()));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< "N/A\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// method: Integral
method = "Integral";

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


982 QuantLib Example Documentation

option.setPricingEngine(Handle<PricingEngine>(
new IntegralEngine()));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< "N/A\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

/*
// method: Integral
method = "Binary Cash";
option.setPricingEngine(Handle<PricingEngine>(
new IntegralCashOrNothingEngine(1.0)));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< "N/A\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// method: Integral
method = "Binary Asset";
option.setPricingEngine(Handle<PricingEngine>(
new IntegralAssetOrNothingEngine()));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< "N/A\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

*/
Size timeSteps = 801;

// Binomial Method (JR)


method = "Binomial (JR)";
option.setPricingEngine(Handle<PricingEngine>(
new BinomialVanillaEngine<JarrowRudd>(timeSteps)));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< "N/A\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// Binomial Method (CRR)


method = "Binomial (CRR)";
option.setPricingEngine(Handle<PricingEngine>(
new BinomialVanillaEngine<CoxRossRubinstein>(timeSteps)));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.4 EuropeanOption.cpp 983

<< DoubleFormatter::toString(value, 4) << "\t"


<< "N/A\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// Equal Probability Additive Binomial Tree (EQP)


method = "Additive (EQP)";
option.setPricingEngine(Handle<PricingEngine>(
new BinomialVanillaEngine<AdditiveEQPBinomialTree>(timeSteps)));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< "N/A\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// Equal Jumps Additive Binomial Tree (Trigeorgis)


method = "Bin. Trigeorgis";
option.setPricingEngine(Handle<PricingEngine>(
new BinomialVanillaEngine<Trigeorgis>(timeSteps)));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< "N/A\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// Tian Binomial Tree (third moment matching)


method = "Binomial Tian";
option.setPricingEngine(Handle<PricingEngine>(
new BinomialVanillaEngine<Tian>(timeSteps)));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< "N/A\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// Leisen-Reimer Binomial Tree


method = "Binomial LR";
option.setPricingEngine(Handle<PricingEngine>(
new BinomialVanillaEngine<LeisenReimer>(timeSteps)));
value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< "N/A\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

// Finite Differences Method: not implemented

/*method = "Finite Diff.";


option.setPricingEngine(Handle<PricingEngine>(
new FDVanillaEngine()));

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


984 QuantLib Example Documentation

value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< "N/A\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;*/

// Monte Carlo Method


timeSteps = 1;

method = "MC (crude)";


Size mcSeed = 42;

#if defined(QL_PATCH_MICROSOFT)
Handle<PricingEngine> mcengine1(
new MCEuropeanEngine<PseudoRandom>(timeSteps, false, false,
Null<int>(), 0.02,
Null<int>(), mcSeed));
#else
Handle<PricingEngine> mcengine1 =
MakeMCEuropeanEngine<PseudoRandom>().withStepsPerYear(timeSteps)
.withTolerance(0.02)
.withSeed(mcSeed);
#endif
option.setPricingEngine(mcengine1);

value = option.NPV();
double errorEstimate = option.errorEstimate();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< DoubleFormatter::toString(errorEstimate, 4) << "\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

method = "MC (Sobol)";


timeSteps = 1;
Size nSamples = 32768; // 2^15

#if defined(QL_PATCH_MICROSOFT)
Handle<PricingEngine> mcengine2(
new MCEuropeanEngine<LowDiscrepancy>(timeSteps, false, false,
nSamples, Null<double>(),
Null<int>()));
#else
Handle<PricingEngine> mcengine2 =
MakeMCEuropeanEngine<LowDiscrepancy>().withStepsPerYear(timeSteps)
.withSamples(nSamples);
#endif
option.setPricingEngine(mcengine2);

value = option.NPV();
discrepancy = QL_FABS(value-rightValue);
relativeDiscrepancy = discrepancy/rightValue;
std::cout << method << "\t"
<< DoubleFormatter::toString(value, 4) << "\t"
<< "N/A\t\t"
<< DoubleFormatter::toString(discrepancy, 6) << "\t"
<< DoubleFormatter::toString(relativeDiscrepancy, 6)
<< std::endl;

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.4 EuropeanOption.cpp 985

return 0;
} catch (std::exception& e) {
std::cout << e.what() << std::endl;
return 1;
} catch (...) {
std::cout << "unknown error" << std::endl;
return 1;
}
}

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


986 QuantLib Example Documentation

11.5 history_iterators.cpp
This code exemplifies how to use History iterators to perform gaussianstatistics analyses on
historical data.

// initialize a History
History h(...);

// print out the mean value and its standard deviation.

GaussianStatistics s;
s.addSequence(h.vdbegin(),h.vdend());
cout << "Historical mean: " << s.mean() << endl;
cout << "Std. deviation: " << s.standardDeviation() << endl;

// Another possibility: print out the maximum value.

History::const_valid_iterator max = h.vbegin(), i=max, end = h.vend();


for (i++; i!=end; i++)
if (i->value() > max->value())
max = i;
cout << "Maximum value: " << max->value()
<< " assumed " << DateFormatter::toString(max->date()) << endl;

// or the minimum, this time the STL way:

bool lessthan(const History::Entry& i, const History::Entry& j) {


return i.value() < j.value();
}

History::const_valid_iterator min =
std::min_element(h.vbegin(),h.vend(),lessthan);
cout << "Minimum value: " << min->value()
<< " assumed " << DateFormatter::toString(min->date()) << endl;

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.6 swapvaluation.cpp 987

11.6 swapvaluation.cpp

This is an example of using the QuantLib Term Structure for pricing a simple swap.

/* This example shows how to set up a Term Structure and then price a simple
swap.
*/

// the only header you need to use QuantLib


#include <ql/quantlib.hpp>
#include <iomanip>

using namespace QuantLib;

int main(int argc, char* argv[])


{
try {
QL_IO_INIT

/*********************
*** MARKET DATA ***
*********************/

Calendar calendar = TARGET();


Date todaysDate(6, November, 2001);
Date settlementDate(8, November, 2001);

// deposits
double d1wQuote=0.0382;
double d1mQuote=0.0372;
double d3mQuote=0.0363;
double d6mQuote=0.0353;
double d9mQuote=0.0348;
double d1yQuote=0.0345;
// FRAs
double fra3x6Quote=0.037125;
double fra6x9Quote=0.037125;
double fra6x12Quote=0.037125;
// futures
double fut1Quote=96.2875;
double fut2Quote=96.7875;
double fut3Quote=96.9875;
double fut4Quote=96.6875;
double fut5Quote=96.4875;
double fut6Quote=96.3875;
double fut7Quote=96.2875;
double fut8Quote=96.0875;
// swaps
double s2yQuote=0.037125;
double s3yQuote=0.0398;
double s5yQuote=0.0443;
double s10yQuote=0.05165;
double s15yQuote=0.055175;

/********************
*** QUOTES ***
********************/

// SimpleQuote stores a value which can be manually changed;


// other Quote subclasses could read the value from a database
// or some kind of data feed.

// deposits
Handle<Quote> d1wRate(new SimpleQuote(d1wQuote));
Handle<Quote> d1mRate(new SimpleQuote(d1mQuote));

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


988 QuantLib Example Documentation

Handle<Quote> d3mRate(new SimpleQuote(d3mQuote));


Handle<Quote> d6mRate(new SimpleQuote(d6mQuote));
Handle<Quote> d9mRate(new SimpleQuote(d9mQuote));
Handle<Quote> d1yRate(new SimpleQuote(d1yQuote));
// FRAs
Handle<Quote> fra3x6Rate(new SimpleQuote(fra3x6Quote));
Handle<Quote> fra6x9Rate(new SimpleQuote(fra6x9Quote));
Handle<Quote> fra6x12Rate(new SimpleQuote(fra6x12Quote));
// futures
Handle<Quote> fut1Price(new SimpleQuote(fut1Quote));
Handle<Quote> fut2Price(new SimpleQuote(fut2Quote));
Handle<Quote> fut3Price(new SimpleQuote(fut3Quote));
Handle<Quote> fut4Price(new SimpleQuote(fut4Quote));
Handle<Quote> fut5Price(new SimpleQuote(fut5Quote));
Handle<Quote> fut6Price(new SimpleQuote(fut6Quote));
Handle<Quote> fut7Price(new SimpleQuote(fut7Quote));
Handle<Quote> fut8Price(new SimpleQuote(fut8Quote));
// swaps
Handle<Quote> s2yRate(new SimpleQuote(s2yQuote));
Handle<Quote> s3yRate(new SimpleQuote(s3yQuote));
Handle<Quote> s5yRate(new SimpleQuote(s5yQuote));
Handle<Quote> s10yRate(new SimpleQuote(s10yQuote));
Handle<Quote> s15yRate(new SimpleQuote(s15yQuote));

/*********************
*** RATE HELPERS ***
*********************/

// RateHelpers are built from the above quotes together with


// other instrument dependant infos. Quotes are passed in
// relinkable handles which could be relinked to some other
// data source later.

// deposits
DayCounter depositDayCounter = Actual360();
int settlementDays = 2;

Handle<RateHelper> d1w(new DepositRateHelper(


RelinkableHandle<Quote>(d1wRate),
1, Weeks, settlementDays,
calendar, ModifiedFollowing, depositDayCounter));
Handle<RateHelper> d1m(new DepositRateHelper(
RelinkableHandle<Quote>(d1mRate),
1, Months, settlementDays,
calendar, ModifiedFollowing, depositDayCounter));
Handle<RateHelper> d3m(new DepositRateHelper(
RelinkableHandle<Quote>(d3mRate),
3, Months, settlementDays,
calendar, ModifiedFollowing, depositDayCounter));
Handle<RateHelper> d6m(new DepositRateHelper(
RelinkableHandle<Quote>(d6mRate),
6, Months, settlementDays,
calendar, ModifiedFollowing, depositDayCounter));
Handle<RateHelper> d9m(new DepositRateHelper(
RelinkableHandle<Quote>(d9mRate),
9, Months, settlementDays,
calendar, ModifiedFollowing, depositDayCounter));
Handle<RateHelper> d1y(new DepositRateHelper(
RelinkableHandle<Quote>(d1yRate),
1, Years, settlementDays,
calendar, ModifiedFollowing, depositDayCounter));

// setup FRAs
Handle<RateHelper> fra3x6(new FraRateHelper(
RelinkableHandle<Quote>(fra3x6Rate),

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.6 swapvaluation.cpp 989

3, 6, settlementDays, calendar, ModifiedFollowing,


depositDayCounter));
Handle<RateHelper> fra6x9(new FraRateHelper(
RelinkableHandle<Quote>(fra6x9Rate),
6, 9, settlementDays, calendar, ModifiedFollowing,
depositDayCounter));
Handle<RateHelper> fra6x12(new FraRateHelper(
RelinkableHandle<Quote>(fra6x12Rate),
6, 12, settlementDays, calendar, ModifiedFollowing,
depositDayCounter));

// setup futures
int futMonths = 3;
Handle<RateHelper> fut1(new FuturesRateHelper(
RelinkableHandle<Quote>(fut1Price),
Date(19, December, 2001),
futMonths, calendar, ModifiedFollowing,
depositDayCounter));
Handle<RateHelper> fut2(new FuturesRateHelper(
RelinkableHandle<Quote>(fut1Price),
Date(20, March, 2002),
futMonths, calendar, ModifiedFollowing,
depositDayCounter));
Handle<RateHelper> fut3(new FuturesRateHelper(
RelinkableHandle<Quote>(fut1Price),
Date(19, June, 2002),
futMonths, calendar, ModifiedFollowing,
depositDayCounter));
Handle<RateHelper> fut4(new FuturesRateHelper(
RelinkableHandle<Quote>(fut1Price),
Date(18, September, 2002),
futMonths, calendar, ModifiedFollowing,
depositDayCounter));
Handle<RateHelper> fut5(new FuturesRateHelper(
RelinkableHandle<Quote>(fut1Price),
Date(18, December, 2002),
futMonths, calendar, ModifiedFollowing,
depositDayCounter));
Handle<RateHelper> fut6(new FuturesRateHelper(
RelinkableHandle<Quote>(fut1Price),
Date(19, March, 2003),
futMonths, calendar, ModifiedFollowing,
depositDayCounter));
Handle<RateHelper> fut7(new FuturesRateHelper(
RelinkableHandle<Quote>(fut1Price),
Date(18, June, 2003),
futMonths, calendar, ModifiedFollowing,
depositDayCounter));
Handle<RateHelper> fut8(new FuturesRateHelper(
RelinkableHandle<Quote>(fut1Price),
Date(17, September, 2003),
futMonths, calendar, ModifiedFollowing,
depositDayCounter));

// setup swaps
int swFixedLegFrequency = 1;
bool swFixedLegIsAdjusted = false;
DayCounter swFixedLegDayCounter = Thirty360(Thirty360::European);
int swFloatingLegFrequency = 2;

Handle<RateHelper> s2y(new SwapRateHelper(


RelinkableHandle<Quote>(s2yRate),
2, Years, settlementDays,
calendar, ModifiedFollowing, swFixedLegFrequency,
swFixedLegIsAdjusted, swFixedLegDayCounter,

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


990 QuantLib Example Documentation

swFloatingLegFrequency));
Handle<RateHelper> s3y(new SwapRateHelper(
RelinkableHandle<Quote>(s3yRate),
3, Years, settlementDays,
calendar, ModifiedFollowing, swFixedLegFrequency,
swFixedLegIsAdjusted, swFixedLegDayCounter,
swFloatingLegFrequency));
Handle<RateHelper> s5y(new SwapRateHelper(
RelinkableHandle<Quote>(s5yRate),
5, Years, settlementDays,
calendar, ModifiedFollowing, swFixedLegFrequency,
swFixedLegIsAdjusted, swFixedLegDayCounter,
swFloatingLegFrequency));
Handle<RateHelper> s10y(new SwapRateHelper(
RelinkableHandle<Quote>(s10yRate),
10, Years, settlementDays,
calendar, ModifiedFollowing, swFixedLegFrequency,
swFixedLegIsAdjusted, swFixedLegDayCounter,
swFloatingLegFrequency));
Handle<RateHelper> s15y(new SwapRateHelper(
RelinkableHandle<Quote>(s15yRate),
15, Years, settlementDays,
calendar, ModifiedFollowing, swFixedLegFrequency,
swFixedLegIsAdjusted, swFixedLegDayCounter,
swFloatingLegFrequency));

/*********************
** CURVE BUILDING **
*********************/

// Any DayCounter would be fine.


// ActualActual::ISDA ensures that 30 years is 30.0
DayCounter termStructureDayCounter =
ActualActual(ActualActual::ISDA);

// A depo-swap curve
std::vector<Handle<RateHelper> > depoSwapInstruments;
depoSwapInstruments.push_back(d1w);
depoSwapInstruments.push_back(d1m);
depoSwapInstruments.push_back(d3m);
depoSwapInstruments.push_back(d6m);
depoSwapInstruments.push_back(d9m);
depoSwapInstruments.push_back(d1y);
depoSwapInstruments.push_back(s2y);
depoSwapInstruments.push_back(s3y);
depoSwapInstruments.push_back(s5y);
depoSwapInstruments.push_back(s10y);
depoSwapInstruments.push_back(s15y);
Handle<TermStructure> depoSwapTermStructure(new
PiecewiseFlatForward(todaysDate, settlementDate,
depoSwapInstruments, termStructureDayCounter));

// A depo-futures-swap curve
std::vector<Handle<RateHelper> > depoFutSwapInstruments;
depoFutSwapInstruments.push_back(d1w);
depoFutSwapInstruments.push_back(d1m);
depoFutSwapInstruments.push_back(fut1);
depoFutSwapInstruments.push_back(fut2);
depoFutSwapInstruments.push_back(fut3);
depoFutSwapInstruments.push_back(fut4);
depoFutSwapInstruments.push_back(fut5);
depoFutSwapInstruments.push_back(fut6);
depoFutSwapInstruments.push_back(fut7);
depoFutSwapInstruments.push_back(fut8);

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.6 swapvaluation.cpp 991

depoFutSwapInstruments.push_back(s3y);
depoFutSwapInstruments.push_back(s5y);
depoFutSwapInstruments.push_back(s10y);
depoFutSwapInstruments.push_back(s15y);
Handle<TermStructure> depoFutSwapTermStructure(new
PiecewiseFlatForward(todaysDate, settlementDate,
depoFutSwapInstruments, termStructureDayCounter));

// A depo-FRA-swap curve
std::vector<Handle<RateHelper> > depoFRASwapInstruments;
depoFRASwapInstruments.push_back(d1w);
depoFRASwapInstruments.push_back(d1m);
depoFRASwapInstruments.push_back(d3m);
depoFRASwapInstruments.push_back(fra3x6);
depoFRASwapInstruments.push_back(fra6x9);
depoFRASwapInstruments.push_back(fra6x12);
depoFRASwapInstruments.push_back(s2y);
depoFRASwapInstruments.push_back(s3y);
depoFRASwapInstruments.push_back(s5y);
depoFRASwapInstruments.push_back(s10y);
depoFRASwapInstruments.push_back(s15y);
Handle<TermStructure> depoFRASwapTermStructure(new
PiecewiseFlatForward(todaysDate, settlementDate,
depoFRASwapInstruments, termStructureDayCounter));

// Term structures that will be used for pricing:


// the one used for discounting cash flows
RelinkableHandle<TermStructure> discountingTermStructure;
// the one used for forward rate forecasting
RelinkableHandle<TermStructure> forecastingTermStructure;

/*********************
* SWAPS TO BE PRICED *
**********************/

// constant nominal 1,000,000 Euro


double nominal = 1000000.0;
// fixed leg
int fixedLegFrequency = 1; // annual
bool fixedLegIsAdjusted = false;
RollingConvention roll = ModifiedFollowing;
DayCounter fixedLegDayCounter = Thirty360(Thirty360::European);
int fixingDays = 2;
Rate fixedRate = 0.04;

// floating leg
int floatingLegFrequency = 2;
Handle<Xibor> euriborIndex(new Euribor(6, Months,
forecastingTermStructure)); // using the forecasting curve
Spread spread = 0.0;

int lenghtInYears = 5;
bool payFixedRate = true;
SimpleSwap spot5YearSwap(payFixedRate, settlementDate, lenghtInYears,
Years, calendar, roll, nominal, fixedLegFrequency, fixedRate,
fixedLegIsAdjusted, fixedLegDayCounter, floatingLegFrequency,
euriborIndex, fixingDays, spread,
discountingTermStructure); // using the discounting curve
SimpleSwap oneYearForward5YearSwap(payFixedRate,
calendar.advance(settlementDate, 1, Years, ModifiedFollowing),
lenghtInYears, Years,
calendar, roll, nominal, fixedLegFrequency, fixedRate,
fixedLegIsAdjusted, fixedLegDayCounter, floatingLegFrequency,
euriborIndex, fixingDays, spread,

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


992 QuantLib Example Documentation

discountingTermStructure); // using the discounting curve

/***************
* SWAP PRICING *
****************/

// utilities for reporting


std::vector<std::string> headers(4);
headers[0] = "term structure";
headers[1] = "net present value";
headers[2] = "fair spread";
headers[3] = "fair fixed rate";
std::string separator = " | ";
Size width = headers[0].size() + separator.size()
+ headers[1].size() + separator.size()
+ headers[2].size() + separator.size()
+ headers[3].size() + separator.size() - 1;
std::string rule(width, ’-’), dblrule(width, ’=’);
std::string tab(8, ’ ’);

// calculations

std::cout << dblrule << std::endl;


std::cout << "5-year market swap-rate = "
<< RateFormatter::toString(s5yRate->value(),2) << std::endl;
std::cout << dblrule << std::endl;

std::cout << tab << "5-years swap paying "


<< RateFormatter::toString(fixedRate,2) << std::endl;
std::cout << headers[0] << separator
<< headers[1] << separator
<< headers[2] << separator
<< headers[3] << separator << std::endl;
std::cout << rule << std::endl;

double NPV;
Rate fairRate;
Spread fairSpread;

// Of course, you’re not forced to really use different curves


forecastingTermStructure.linkTo(depoSwapTermStructure);
discountingTermStructure.linkTo(depoSwapTermStructure);

NPV = spot5YearSwap.NPV();
fairSpread = spot5YearSwap.fairSpread();
fairRate = spot5YearSwap.fairRate();

std::cout << std::setw(headers[0].size())


<< "depo-swap" << separator;
std::cout << std::setw(headers[1].size())
<< DoubleFormatter::toString(NPV,2) << separator;
std::cout << std::setw(headers[2].size())
<< RateFormatter::toString(fairSpread,4) << separator;
std::cout << std::setw(headers[3].size())
<< RateFormatter::toString(fairRate,4) << separator;
std::cout << std::endl;

// let’s check that the 5 years swap has been correctly re-priced
QL_REQUIRE(QL_FABS(fairRate-s5yQuote)<1e-8,
"5-years swap mispriced!");

forecastingTermStructure.linkTo(depoFutSwapTermStructure);
discountingTermStructure.linkTo(depoFutSwapTermStructure);

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.6 swapvaluation.cpp 993

NPV = spot5YearSwap.NPV();
fairSpread = spot5YearSwap.fairSpread();
fairRate = spot5YearSwap.fairRate();

std::cout << std::setw(headers[0].size())


<< "depo-fut-swap" << separator;
std::cout << std::setw(headers[1].size())
<< DoubleFormatter::toString(NPV,2) << separator;
std::cout << std::setw(headers[2].size())
<< RateFormatter::toString(fairSpread,4) << separator;
std::cout << std::setw(headers[3].size())
<< RateFormatter::toString(fairRate,4) << separator;
std::cout << std::endl;

QL_REQUIRE(QL_FABS(fairRate-s5yQuote)<1e-8,
"5-years swap mispriced!");

forecastingTermStructure.linkTo(depoFRASwapTermStructure);
discountingTermStructure.linkTo(depoFRASwapTermStructure);

NPV = spot5YearSwap.NPV();
fairSpread = spot5YearSwap.fairSpread();
fairRate = spot5YearSwap.fairRate();

std::cout << std::setw(headers[0].size())


<< "depo-FRA-swap" << separator;
std::cout << std::setw(headers[1].size())
<< DoubleFormatter::toString(NPV,2) << separator;
std::cout << std::setw(headers[2].size())
<< RateFormatter::toString(fairSpread,4) << separator;
std::cout << std::setw(headers[3].size())
<< RateFormatter::toString(fairRate,4) << separator;
std::cout << std::endl;

QL_REQUIRE(QL_FABS(fairRate-s5yQuote)<1e-8,
"5-years swap mispriced!");

std::cout << rule << std::endl;

// now let’s price the 1Y forward 5Y swap

std::cout << tab << "5-years, 1-year forward swap paying "
<< RateFormatter::toString(fixedRate,2) << std::endl;
std::cout << headers[0] << separator
<< headers[1] << separator
<< headers[2] << separator
<< headers[3] << separator << std::endl;
std::cout << rule << std::endl;

forecastingTermStructure.linkTo(depoSwapTermStructure);
discountingTermStructure.linkTo(depoSwapTermStructure);

NPV = oneYearForward5YearSwap.NPV();
fairSpread = oneYearForward5YearSwap.fairSpread();
fairRate = oneYearForward5YearSwap.fairRate();

std::cout << std::setw(headers[0].size())


<< "depo-swap" << separator;
std::cout << std::setw(headers[1].size())
<< DoubleFormatter::toString(NPV,2) << separator;
std::cout << std::setw(headers[2].size())
<< RateFormatter::toString(fairSpread,4) << separator;
std::cout << std::setw(headers[3].size())
<< RateFormatter::toString(fairRate,4) << separator;

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


994 QuantLib Example Documentation

std::cout << std::endl;

forecastingTermStructure.linkTo(depoFutSwapTermStructure);
discountingTermStructure.linkTo(depoFutSwapTermStructure);

NPV = oneYearForward5YearSwap.NPV();
fairSpread = oneYearForward5YearSwap.fairSpread();
fairRate = oneYearForward5YearSwap.fairRate();

std::cout << std::setw(headers[0].size())


<< "depo-fut-swap" << separator;
std::cout << std::setw(headers[1].size())
<< DoubleFormatter::toString(NPV,2) << separator;
std::cout << std::setw(headers[2].size())
<< RateFormatter::toString(fairSpread,4) << separator;
std::cout << std::setw(headers[3].size())
<< RateFormatter::toString(fairRate,4) << separator;
std::cout << std::endl;

forecastingTermStructure.linkTo(depoFRASwapTermStructure);
discountingTermStructure.linkTo(depoFRASwapTermStructure);

NPV = oneYearForward5YearSwap.NPV();
fairSpread = oneYearForward5YearSwap.fairSpread();
fairRate = oneYearForward5YearSwap.fairRate();

std::cout << std::setw(headers[0].size())


<< "depo-FRA-swap" << separator;
std::cout << std::setw(headers[1].size())
<< DoubleFormatter::toString(NPV,2) << separator;
std::cout << std::setw(headers[2].size())
<< RateFormatter::toString(fairSpread,4) << separator;
std::cout << std::setw(headers[3].size())
<< RateFormatter::toString(fairRate,4) << separator;
std::cout << std::endl;

// now let’s say that the 5-years swap rate goes up to 4.60%.
// A smarter market element--say, connected to a data source-- would
// notice the change itself. Since we’re using SimpleQuotes,
// we’ll have to change the value manually--which forces us to
// downcast the handle and use the SimpleQuote
// interface. In any case, the point here is that a change in the
// value contained in the Quote triggers a new bootstrapping
// of the curve and a repricing of the swap.

#if defined(HAVE_BOOST)
Handle<SimpleQuote> fiveYearsRate =
boost::dynamic_pointer_cast<SimpleQuote>(s5yRate);
#else
Handle<SimpleQuote> fiveYearsRate = s5yRate;
#endif
fiveYearsRate->setValue(0.0460);

std::cout << dblrule << std::endl;


std::cout << "5-year market swap-rate = "
<< RateFormatter::toString(s5yRate->value(),2) << std::endl;
std::cout << dblrule << std::endl;

std::cout << tab << "5-years swap paying "


<< RateFormatter::toString(fixedRate,2) << std::endl;
std::cout << headers[0] << separator
<< headers[1] << separator
<< headers[2] << separator
<< headers[3] << separator << std::endl;

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.6 swapvaluation.cpp 995

std::cout << rule << std::endl;

// now get the updated results


forecastingTermStructure.linkTo(depoSwapTermStructure);
discountingTermStructure.linkTo(depoSwapTermStructure);

NPV = spot5YearSwap.NPV();
fairSpread = spot5YearSwap.fairSpread();
fairRate = spot5YearSwap.fairRate();

std::cout << std::setw(headers[0].size())


<< "depo-swap" << separator;
std::cout << std::setw(headers[1].size())
<< DoubleFormatter::toString(NPV,2) << separator;
std::cout << std::setw(headers[2].size())
<< RateFormatter::toString(fairSpread,4) << separator;
std::cout << std::setw(headers[3].size())
<< RateFormatter::toString(fairRate,4) << separator;
std::cout << std::endl;

QL_REQUIRE(QL_FABS(fairRate-s5yRate->value())<1e-8,
"5-years swap mispriced!");

forecastingTermStructure.linkTo(depoFutSwapTermStructure);
discountingTermStructure.linkTo(depoFutSwapTermStructure);

NPV = spot5YearSwap.NPV();
fairSpread = spot5YearSwap.fairSpread();
fairRate = spot5YearSwap.fairRate();

std::cout << std::setw(headers[0].size())


<< "depo-fut-swap" << separator;
std::cout << std::setw(headers[1].size())
<< DoubleFormatter::toString(NPV,2) << separator;
std::cout << std::setw(headers[2].size())
<< RateFormatter::toString(fairSpread,4) << separator;
std::cout << std::setw(headers[3].size())
<< RateFormatter::toString(fairRate,4) << separator;
std::cout << std::endl;

QL_REQUIRE(QL_FABS(fairRate-s5yRate->value())<1e-8,
"5-years swap mispriced!");

forecastingTermStructure.linkTo(depoFRASwapTermStructure);
discountingTermStructure.linkTo(depoFRASwapTermStructure);

NPV = spot5YearSwap.NPV();
fairSpread = spot5YearSwap.fairSpread();
fairRate = spot5YearSwap.fairRate();

std::cout << std::setw(headers[0].size())


<< "depo-FRA-swap" << separator;
std::cout << std::setw(headers[1].size())
<< DoubleFormatter::toString(NPV,2) << separator;
std::cout << std::setw(headers[2].size())
<< RateFormatter::toString(fairSpread,4) << separator;
std::cout << std::setw(headers[3].size())
<< RateFormatter::toString(fairRate,4) << separator;
std::cout << std::endl;

QL_REQUIRE(QL_FABS(fairRate-s5yRate->value())<1e-8,
"5-years swap mispriced!");

std::cout << rule << std::endl;

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


996 QuantLib Example Documentation

// the 1Y forward 5Y swap changes as well

std::cout << tab << "5-years, 1-year forward swap paying "
<< RateFormatter::toString(fixedRate,2) << std::endl;
std::cout << headers[0] << separator
<< headers[1] << separator
<< headers[2] << separator
<< headers[3] << separator << std::endl;
std::cout << rule << std::endl;

forecastingTermStructure.linkTo(depoSwapTermStructure);
discountingTermStructure.linkTo(depoSwapTermStructure);

NPV = oneYearForward5YearSwap.NPV();
fairSpread = oneYearForward5YearSwap.fairSpread();
fairRate = oneYearForward5YearSwap.fairRate();

std::cout << std::setw(headers[0].size())


<< "depo-swap" << separator;
std::cout << std::setw(headers[1].size())
<< DoubleFormatter::toString(NPV,2) << separator;
std::cout << std::setw(headers[2].size())
<< RateFormatter::toString(fairSpread,4) << separator;
std::cout << std::setw(headers[3].size())
<< RateFormatter::toString(fairRate,4) << separator;
std::cout << std::endl;

forecastingTermStructure.linkTo(depoFutSwapTermStructure);
discountingTermStructure.linkTo(depoFutSwapTermStructure);

NPV = oneYearForward5YearSwap.NPV();
fairSpread = oneYearForward5YearSwap.fairSpread();
fairRate = oneYearForward5YearSwap.fairRate();

std::cout << std::setw(headers[0].size())


<< "depo-fut-swap" << separator;
std::cout << std::setw(headers[1].size())
<< DoubleFormatter::toString(NPV,2) << separator;
std::cout << std::setw(headers[2].size())
<< RateFormatter::toString(fairSpread,4) << separator;
std::cout << std::setw(headers[3].size())
<< RateFormatter::toString(fairRate,4) << separator;
std::cout << std::endl;

forecastingTermStructure.linkTo(depoFRASwapTermStructure);
discountingTermStructure.linkTo(depoFRASwapTermStructure);

NPV = oneYearForward5YearSwap.NPV();
fairSpread = oneYearForward5YearSwap.fairSpread();
fairRate = oneYearForward5YearSwap.fairRate();

std::cout << std::setw(headers[0].size())


<< "depo-FRA-swap" << separator;
std::cout << std::setw(headers[1].size())
<< DoubleFormatter::toString(NPV,2) << separator;
std::cout << std::setw(headers[2].size())
<< RateFormatter::toString(fairSpread,4) << separator;
std::cout << std::setw(headers[3].size())
<< RateFormatter::toString(fairRate,4) << separator;
std::cout << std::endl;

return 0;

} catch (std::exception& e) {

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


11.6 swapvaluation.cpp 997

std::cout << e.what() << std::endl;


return 1;
} catch (...) {
std::cout << "unknown error" << std::endl;
return 1;
}
}

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


998 QuantLib Example Documentation

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


Chapter 12

Todo List

Class AmericanCondition(p. 115) Unify the intrinsicValues/Payoff thing

Class AmericanExercise(p. 116) check that everywhere the American condition is applied from
the earliestDate and not earlier

Class AmericanPayoffAtExpiry(p. 117) calculate greeks

Class AmericanPayoffAtHit(p. 118) calculate greeks

Class AnalyticDigitalAmericanEngine(p. 121) add more greeks (as of now only delta and rho
available)

Class AUDLibor(p. 131) check settlement days

Class BermudanExercise(p. 143) it would be nice to have a way for making a Bermudan with
one exercise date equivalent to an European

Class BicubicSpline(p. 144) revise end conditions

Class BivariateCumulativeNormalDistribution(p. 152) check accuracy of this algorithm and


compare with: 1) Drezner, Z, (1978), Computation of the bivariate normal integral, Math-
ematics of Computation 32, pp. 277-279. 2) Drezner, Z. and Wesolowsky, G. O. (1990) ‘On
the Computation of the Bivariate Normal Integral’, Journal of Statistical Computation and
Simulation 35, pp. 101-107. 3) Drezner, Z (1992) Computation of the Multivariate Normal
Integral, ACM Transactions on Mathematics Software 18, pp. 450-460. 4) Drezner, Z (1994)
Computation of the Trivariate Normal Integral, Mathematics of Computation 62, pp. 289-
294. 5) Genz, A. (1992) ‘Numerical Computation of the Multivariate Normal Probabilities’,
J. Comput. Graph. Stat. 1, pp. 141-150.
1000 Todo List

Class BlackScholesProcess(p. 162) revise extrapolation

Class BlackVarianceCurve(p. 164) check time extrapolation

Class BlackVarianceSurface(p. 166) check time extrapolation

Member Side(p. 172) Generalize for n-dimensional conditions

Class CADLibor(p. 183) check settlement days

Class CapFlatVolatilityVector(p. 194) Either add correct copy behavior or inhibit copy. Right
now, a copied instance would end up with its own copy of the length vector but an interpo-
lation pointing to the original ones.

Class CHFLibor(p. 202) check settlement days and day-count

Class ContinuousGeometricAPO(p. 217) add Average Strike version and make it backward
starting

Class DirichletBC(p. 248) generalize to time-dependent conditions.

Class DiscreteGeometricAPO(p. 258) add analytical greeks

Class DiscreteGeometricASO(p. 259) add analytical greeks

Class EarlyExercise(p. 272) derive a plain American Exercise class (no earliestDate, no payoff-
AtExpiry)

Class ExplicitEuler(p. 284) add Richardson extrapolation

Class FraRateHelper(p. 318) convexity adjustment should be implemented.

Class GenericRiskStatistics(p. 334) add historical annualized volatility

Class IntegralEngine(p. 371) define tolerance for calculate()

Class JPYLibor(p. 383) check settlement days

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1001

Class LogLinearInterpolation(p. 414) Implement primitive, derivative, and secondDerivative


functions.

Member pseudoSqrt(p. 420)(const Matrix &, SalvagingAlgorithm::Type) a) implement Hy-


persphere decomposition: 1) Jäckel "Monte Carlo Methods in Finance", Chapter 6 2) Brigo
"A Note on Correlation and Rank Reduction" 3) Rapisarda, Brigo, Mercurio "Parameter-
izing correlations: a geometric interpretation" b) implement Higham algorithm: Higham
"Computing the nearest correlation matrix"

Class McDiscreteArithmeticAPO(p. 430) Continous-averaging version

Class McDiscreteArithmeticASO(p. 431) Continous Averaging version

Class MixedScheme(p. 445) a) derive variable theta schemes b) introduce multi time-level
schemes.

Class MultiPath(p. 455) a) make it time-aware b) rename it as MultiAssetPath

Class MultiPathGenerator(p. 456) why store correlation Matrix rather than covariance?

Class NeumannBC(p. 460) generalize to time-dependent conditions.

Class Option::arguments(p. 491) a) remove std::vector<Time> stoppingTimes b) how to handle


strike-less option (asian average strike, forward, etc.)?

Class Path(p. 501) should Path include the t=0.0 point? Alternatively all path pricers must be
revisited.

Class ShoutCondition(p. 552) Unify the intrinsicValues/Payoff thing

Class Solver1D(p. 565) a) Clean up the interface so that it is clear whether the accuracy is speci-
fied for x or f(x). b) Add target value (now the target value is 0.0)

Class SwaptionVolatilityMatrix(p. 589) Either add correct copy behavior or inhibit copy. Right
now, a copied instance would end up with its own copy of the exercise date and length
vector but an interpolation pointing to the original ones.

Class TermStructure(p. 594) add derived class ParSwapTermStructure similar to ZeroYield-


TermStructure, DiscountStructure, ForwardRateStructure
allow for different compounding rules and compounding frequencies

Class TimeGrid(p. 601) What was the rationale for limiting the grid to positive times? Investi-
gate and see whether we can use it for negative ones as well.

Class ZARLibor(p. 634) check settlement days

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1002 Todo List

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


Chapter 13

Deprecated List

Member BoxMullerGaussianRng(p. 175)(long seed=0) initialize with a random number gen-


erator instead.

Member CLGaussianRng(p. 203)(long seed=0) initialize with a random number generator in-
stead.

Class EuropeanOption(p. 282) use VanillaOption with EuropeanAnalyticEngine

Member ICGaussianRng(p. 350)(long seed=0) initialize with a random number generator in-
stead.

Member matrixSqrt(p. 421)(const Matrix &) use CholeskyDecomposition or pseudoSqrt in-


stead

Class PathGenerator_old(p. 503) use PathGenerator instead

Class PathPricer_old(p. 505) use PathPricer instead

Class RandomArrayGenerator(p. 533) use RandomSequenceGenerator instead.


1004 Deprecated List

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


Chapter 14

Bug List

Class BPSBasketCalculator(p. 176) This class must still be checked. It is not guaranteed to yield
the right results.

Class CoxIngersollRoss(p. 224) This class was not tested enough to guarantee its functionality.

Class ExtendedCoxIngersollRoss(p. 285) This class was not tested enough to guarantee its func-
tionality.

Class FdDividendAmericanOption(p. 296) sometimes yields negative vega when deeply in-
the-money
method impliedVolatility() utterly fails

Class G2(p. 321) This class was not tested enough to guarantee its functionality.

Class LocalVolSurface(p. 410) This class is untested, probably unreliable.

Class MCAmericanBasketEngine(p. 422) This engine does not yet work for put options. More
problems might surface.

Member impliedVolatility(p. 477)(double price, double accuracy=1.0e-4, Size maxEvaluations=100, double minV
run-time crashes are possible with the Borland compiler

Member sensitivity(p. 582)(int basis=2) const This method must still be checked. It is not guar-
anteed to yield the right results.
Index

add calibrate
QuantLib::GeneralStatistics, 331 QuantLib::ShortRateModel, 551
QuantLib::IncrementalStatistics, 362 Character functions, 101
addSequence CLGaussianRng
QuantLib::IncrementalStatistics, 362 QuantLib::CLGaussianRng, 203
advance compoundForwardImpl
QuantLib::Calendar, 186 QuantLib::DiscountStructure, 251
amount QuantLib::ExtendedDiscountCurve,
QuantLib::CashFlow, 200 289
QuantLib::FixedRateCoupon, 304 QuantLib::ForwardRateStructure, 311
QuantLib::IndexedCoupon, 365 QuantLib::ZeroYieldStructure, 638
QuantLib::ParCoupon, 500 Coupon
QuantLib::Short, 548 QuantLib::Coupon, 223
QuantLib::SimpleCashFlow, 553 CubicSpline
applyAfterApplying QuantLib::CubicSpline, 231
QuantLib::BoundaryCondition, 172
applyAfterSolving DayCounter
QuantLib::BoundaryCondition, 172 QuantLib::DayCounter, 241
applyBeforeApplying DEFINE_SEQUENCE_STAT_CONST_-
QuantLib::BoundaryCondition, 172 METHOD_DOUBLE
applyBeforeSolving sequencestatistics.hpp, 788
QuantLib::BoundaryCondition, 172 DEFINE_SEQUENCE_STAT_CONST_-
averageShortfall METHOD_VOID
QuantLib::GenericRiskStatistics, 336 sequencestatistics.hpp, 788
diffusion
BicubicSpline QuantLib::BlackScholesProcess, 162
QuantLib::BicubicSpline, 144 QuantLib::DiffusionProcess, 246
BilinearInterpolation QuantLib::OrnsteinUhlenbeckProcess,
QuantLib::BilinearInterpolation, 146 493
blackVarianceImpl QuantLib::SquareRootProcess, 567
QuantLib::BlackVolatilityTerm- discountImpl
Structure, 169 QuantLib::ForwardRateStructure, 311
blackVolImpl QuantLib::ZeroYieldStructure, 638
QuantLib::BlackVarianceTerm- downsideDeviation
Structure, 168 QuantLib::GenericRiskStatistics, 335
BoundaryCondition QuantLib::IncrementalStatistics, 361
QuantLib::CubicSpline, 231 downsideVariance
BoxMullerGaussianRng QuantLib::GenericRiskStatistics, 334
QuantLib::BoxMullerGaussianRng, 175 QuantLib::IncrementalStatistics, 361

calculate Error
QuantLib::Instrument, 368 QuantLib::Error, 277
QuantLib::LazyObject, 392 errorEstimate
Calendar QuantLib::GeneralStatistics, 330
QuantLib::Calendar, 185 QuantLib::IncrementalStatistics, 361
INDEX 1007

errors.hpp QuantLib::SingleAssetOption, 563


QL_ASSERT, 691 Input/output functions, 102
QL_ENSURE, 692 isBusinessDay
QL_FAIL, 691 QuantLib::Calendar, 185
QL_REQUIRE, 692 isEndOfMonth
expectation QuantLib::Calendar, 185
QuantLib::DiffusionProcess, 246 isHoliday
QuantLib::OrnsteinUhlenbeckProcess, QuantLib::Calendar, 186
493 Iterator support, 106
expectationValue iteratorMacros
QuantLib::GeneralStatistics, 331 QL_FULL_ITERATOR_SUPPORT, 106
expectedShortfall QL_ITERATOR, 106
QuantLib::GenericRiskStatistics, 335 QL_ITERATOR_TRAITS, 106
QL_REVERSE_ITERATOR, 106
FirstDerivative QL_SPECIALIZE_ITERATOR_TRAITS,
QuantLib::CubicSpline, 231 106
fixing itmProbability
QuantLib::Index, 363 QuantLib::BlackModel, 160
QuantLib::Xibor, 632
formula KnuthUniformRng
QuantLib::BlackModel, 159 QuantLib::KnuthUniformRng, 384
forwardImpl kurtosis
QuantLib::DiscountStructure, 251 QuantLib::GeneralStatistics, 330
QuantLib::ZeroSpreadedTerm- QuantLib::IncrementalStatistics, 362
Structure, 637
QuantLib::ZeroYieldStructure, 638 Lagrange
freeze QuantLib::CubicSpline, 231
QuantLib::LazyObject, 392 LecuyerUniformRng
QuantLib::LecuyerUniformRng, 396
gaussianDownsideDeviation limitMacros
QuantLib::GaussianStatistics, 326 QL_EPSILON, 98
gaussianDownsideVariance QL_MAX_DOUBLE, 98
QuantLib::GaussianStatistics, 326 QL_MAX_INT, 98
gaussianExpectedShortfall QL_MIN_DOUBLE, 98
QuantLib::GaussianStatistics, 327 QL_MIN_INT, 98
gaussianPercentile QL_MIN_POSITIVE_DOUBLE, 98
QuantLib::GaussianStatistics, 327 LinearInterpolation
gaussianPotentialUpside QuantLib::LinearInterpolation, 401
QuantLib::GaussianStatistics, 327 Link
gaussianRegret QuantLib::Link, 404
QuantLib::GaussianStatistics, 327 linkTo
gaussianValueAtRisk QuantLib::Link, 404
QuantLib::GaussianStatistics, 327 QuantLib::RelinkableHandle, 538
Global QuantLib macros, 95 localVolImpl
QuantLib::LocalVolCurve, 409
Handle LogLinearInterpolation
QuantLib::Handle, 340 QuantLib::LogLinearInterpolation, 414
History
QuantLib::History, 343 macros
QL_DUMMY_RETURN, 95
ICGaussianRng QL_IO_INIT, 96
QuantLib::ICGaussianRng, 350 Math functions, 97
impliedVolatility matrixSqrt
QuantLib::OneAssetOption, 477 QuantLib::Matrix, 421

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1008 INDEX

max QuantLib::LazyObject, 392


QuantLib::GeneralStatistics, 331 QuantLib::MultiAssetOption, 452
QuantLib::IncrementalStatistics, 362 QuantLib::OneAssetOption, 478
mean QuantLib::OneAssetStrikedOption, 482
QuantLib::GeneralStatistics, 330 QuantLib::QuantoVanillaOption, 531
QuantLib::IncrementalStatistics, 361 QuantLib::Stock, 574
MersenneTwisterUniformRng QuantLib::Swap, 582
QuantLib::MersenneTwisterUniform- QuantLib::Swaption, 585
Rng, 443 QuantLib::VanillaOption, 624
min Periodic
QuantLib::GeneralStatistics, 330 QuantLib::CubicSpline, 231
QuantLib::IncrementalStatistics, 362 PiecewiseFlatForward
Min and max functions, 103 QuantLib::PiecewiseFlatForward, 512
MonotonicCubicSpline postAdjustValues
QuantLib::MonotonicCubicSpline, 447 QuantLib::DiscretizedAsset, 260
QuantLib::DiscretizedOption, 263
name potentialUpside
QuantLib::Calendar, 185 QuantLib::GenericRiskStatistics, 335
QuantLib::DayCounter, 241 preAdjustValues
QuantLib::Index, 363 QuantLib::DiscretizedAsset, 260
QuantLib::Xibor, 632 pseudoSqrt
NaturalCubicSpline QuantLib::Matrix, 420
QuantLib::NaturalCubicSpline, 458
NaturalMonotonicCubicSpline
ql/argsandresults.hpp, 641
QuantLib::NaturalMonotonicCubic-
ql/calendar.hpp, 642
Spline, 459
ql/Calendars/budapest.hpp, 643
next
ql/Calendars/copenhagen.hpp, 644
QuantLib::KnuthUniformRng, 384
ql/Calendars/frankfurt.hpp, 645
QuantLib::LecuyerUniformRng, 396
ql/Calendars/helsinki.hpp, 646
QuantLib::MersenneTwisterUniform-
ql/Calendars/johannesburg.hpp, 647
Rng, 443
ql/Calendars/jointcalendar.hpp, 648
NotAKnot
QuantLib::CubicSpline, 231 ql/Calendars/london.hpp, 649
notifyObservers ql/Calendars/milan.hpp, 650
QuantLib::Observable, 472 ql/Calendars/newyork.hpp, 651
Numeric limits, 98 ql/Calendars/nullcalendar.hpp, 652
ql/Calendars/oslo.hpp, 653
operator+= ql/Calendars/stockholm.hpp, 654
QuantLib::Matrix, 420 ql/Calendars/sydney.hpp, 655
operator== ql/Calendars/target.hpp, 656
QuantLib::Calendar, 186 ql/Calendars/tokyo.hpp, 657
QuantLib::DayCounter, 241 ql/Calendars/toronto.hpp, 658
ql/Calendars/warsaw.hpp, 659
PathGenerator_old ql/Calendars/wellington.hpp, 660
QuantLib::PathGenerator_old, 503 ql/Calendars/zurich.hpp, 661
percentile ql/capvolstructures.hpp, 662
QuantLib::GeneralStatistics, 331 ql/cashflow.hpp, 663
performCalculations ql/CashFlows/basispointsensitivity.hpp, 664
QuantLib::BarrierOption, 137 ql/CashFlows/cashflowvectors.hpp, 665
QuantLib::BasketOption, 141 ql/CashFlows/coupon.hpp, 666
QuantLib::DiscreteAveragingAsian- ql/CashFlows/fixedratecoupon.hpp, 667
Option, 256 ql/CashFlows/floatingratecoupon.hpp, 668
QuantLib::ForwardVanillaOption, 316 ql/CashFlows/inarrearindexedcoupon.hpp,
QuantLib::Instrument, 369 669

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


INDEX 1009

ql/CashFlows/indexcashflowvectors.hpp, ql/history.hpp, 717


670 ql/index.hpp, 718
ql/CashFlows/indexedcoupon.hpp, 671 ql/Indexes/audlibor.hpp, 719
ql/CashFlows/parcoupon.hpp, 672 ql/Indexes/cadlibor.hpp, 720
ql/CashFlows/shortfloatingcoupon.hpp, 673 ql/Indexes/chflibor.hpp, 721
ql/CashFlows/shortindexedcoupon.hpp, 674 ql/Indexes/euribor.hpp, 722
ql/CashFlows/simplecashflow.hpp, 675 ql/Indexes/gbplibor.hpp, 723
ql/CashFlows/timebasket.hpp, 676 ql/Indexes/jpylibor.hpp, 724
ql/CashFlows/upfrontindexedcoupon.hpp, ql/Indexes/usdlibor.hpp, 725
677 ql/Indexes/xibor.hpp, 726
ql/currency.hpp, 678 ql/Indexes/xibormanager.hpp, 727
ql/dataformatters.hpp, 679 ql/Indexes/zarlibor.hpp, 728
ql/dataparsers.hpp, 680 ql/instrument.hpp, 729
ql/date.hpp, 681 ql/Instruments/asianoption.hpp, 730
ql/daycounter.hpp, 682 ql/Instruments/barrieroption.hpp, 731
ql/DayCounters/actual360.hpp, 683 ql/Instruments/basketoption.hpp, 732
ql/DayCounters/actual365.hpp, 684 ql/Instruments/capfloor.hpp, 733
ql/DayCounters/actualactual.hpp, 685 ql/Instruments/cliquetoption.hpp, 734
ql/DayCounters/simpledaycounter.hpp, 686 ql/Instruments/forwardvanillaoption.hpp,
ql/DayCounters/thirty360.hpp, 687 736
ql/diffusionprocess.hpp, 688 ql/Instruments/multiassetoption.hpp, 737
ql/discretizedasset.hpp, 689 ql/Instruments/oneassetoption.hpp, 738
ql/disposable.hpp, 690 ql/Instruments/oneassetstrikedoption.hpp,
ql/errors.hpp, 691 739
ql/exercise.hpp, 693 ql/Instruments/payoffs.hpp, 740
ql/FiniteDifferences/americancondition.hpp, ql/Instruments/quantoforwardvanillaoption.hpp,
694 741
ql/FiniteDifferences/boundarycondition.hpp, ql/Instruments/quantovanillaoption.hpp,
695 742
ql/FiniteDifferences/bsmoperator.hpp, 696 ql/Instruments/simpleswap.hpp, 743
ql/FiniteDifferences/cranknicolson.hpp, 697 ql/Instruments/stock.hpp, 744
ql/FiniteDifferences/dminus.hpp, 698 ql/Instruments/swap.hpp, 745
ql/FiniteDifferences/dplus.hpp, 699 ql/Instruments/swaption.hpp, 746
ql/FiniteDifferences/dplusdminus.hpp, 700 ql/Instruments/vanillaoption.hpp, 747
ql/FiniteDifferences/dzero.hpp, 701 ql/Lattices/binomialtree.hpp, 748
ql/FiniteDifferences/expliciteuler.hpp, 702 ql/Lattices/bsmlattice.hpp, 749
ql/FiniteDifferences/fdtypedefs.hpp, 703 ql/Lattices/lattice.hpp, 750
ql/FiniteDifferences/finitedifferencemodel.hpp, ql/Lattices/lattice2d.hpp, 751
704 ql/Lattices/tree.hpp, 752
ql/FiniteDifferences/impliciteuler.hpp, 705 ql/Lattices/trinomialtree.hpp, 753
ql/FiniteDifferences/mixedscheme.hpp, 706 ql/marketelement.hpp, 754
ql/FiniteDifferences/onefactoroperator.hpp, ql/Math/array.hpp, 755
707 ql/Math/beta.hpp, 756
ql/FiniteDifferences/shoutcondition.hpp, ql/Math/bicubicsplineinterpolation.hpp, 757
708 ql/Math/bilinearinterpolation.hpp, 758
ql/FiniteDifferences/stepcondition.hpp, 709 ql/Math/binomialdistribution.hpp, 759
ql/FiniteDifferences/tridiagonaloperator.hpp, ql/Math/bivariatenormaldistribution.hpp,
710 760
ql/FiniteDifferences/valueatcenter.hpp, 711 ql/Math/chisquaredistribution.hpp, 761
ql/functions/daycounters.hpp, 712 ql/Math/choleskydecomposition.hpp, 762
ql/functions/mathf.hpp, 713 ql/Math/comparison.hpp, 763
ql/functions/vols.hpp, 714 ql/Math/cubicspline.hpp, 764
ql/grid.hpp, 715 ql/Math/discrepancystatistics.hpp, 765
ql/handle.hpp, 716 ql/Math/errorfunction.hpp, 766

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1010 INDEX

ql/Math/factorial.hpp, 767 ql/Patterns/bridge.hpp, 821


ql/Math/functional.hpp, 768 ql/Patterns/composite.hpp, 822
ql/Math/gammadistribution.hpp, 769 ql/Patterns/curiouslyrecurring.hpp, 823
ql/Math/gaussianstatistics.hpp, 770 ql/Patterns/lazyobject.hpp, 824
ql/Math/generalstatistics.hpp, 771 ql/Patterns/observable.hpp, 825
ql/Math/incompletegamma.hpp, 772 ql/Patterns/visitor.hpp, 826
ql/Math/incrementalstatistics.hpp, 773 ql/payoff.hpp, 827
ql/Math/interpolation.hpp, 774 ql/Pricers/cliquetoption.hpp, 735
ql/Math/interpolation2D.hpp, 775 ql/Pricers/continuousgeometricapo.hpp, 828
ql/Math/interpolationtraits.hpp, 776 ql/Pricers/discretegeometricapo.hpp, 829
ql/Math/kronrodintegral.hpp, 777 ql/Pricers/discretegeometricaso.hpp, 830
ql/Math/lexicographicalview.hpp, 778 ql/Pricers/europeanoption.hpp, 831
ql/Math/linearinterpolation.hpp, 779 ql/Pricers/fdamericanoption.hpp, 832
ql/Math/loglinearinterpolation.hpp, 780 ql/Pricers/fdbermudanoption.hpp, 833
ql/Math/matrix.hpp, 781 ql/Pricers/fdbsmoption.hpp, 834
ql/Math/normaldistribution.hpp, 782 ql/Pricers/fddividendamericanoption.hpp,
ql/Math/poissondistribution.hpp, 783 835
ql/Math/primenumbers.hpp, 784 ql/Pricers/fddividendeuropeanoption.hpp,
ql/Math/pseudosqrt.hpp, 785 836
ql/Math/riskstatistics.hpp, 786 ql/Pricers/fddividendoption.hpp, 837
ql/Math/segmentintegral.hpp, 787 ql/Pricers/fddividendshoutoption.hpp, 838
ql/Math/sequencestatistics.hpp, 788 ql/Pricers/fdeuropean.hpp, 839
ql/Math/simpsonintegral.hpp, 790 ql/Pricers/fdmultiperiodoption.hpp, 840
ql/Math/statistics.hpp, 791 ql/Pricers/fdshoutoption.hpp, 841
ql/Math/svd.hpp, 792 ql/Pricers/fdstepconditionoption.hpp, 842
ql/Math/symmetriceigenvalues.hpp, 793 ql/Pricers/mcbasket.hpp, 843
ql/Math/symmetricschurdecomposition.hpp, ql/Pricers/mccliquetoption.hpp, 844
794 ql/Pricers/mcdiscretearithmeticapo.hpp, 845
ql/Math/trapezoidintegral.hpp, 795 ql/Pricers/mcdiscretearithmeticaso.hpp, 846
ql/MonteCarlo/brownianbridge.hpp, 796 ql/Pricers/mceverest.hpp, 847
ql/MonteCarlo/getcovariance.hpp, 797 ql/Pricers/mchimalaya.hpp, 848
ql/MonteCarlo/mctraits.hpp, 798 ql/Pricers/mcmaxbasket.hpp, 849
ql/MonteCarlo/mctypedefs.hpp, 799 ql/Pricers/mcpagoda.hpp, 850
ql/MonteCarlo/montecarlomodel.hpp, 800 ql/Pricers/mcperformanceoption.hpp, 851
ql/MonteCarlo/multipath.hpp, 801 ql/Pricers/mcpricer.hpp, 852
ql/MonteCarlo/multipathgenerator.hpp, 802 ql/Pricers/performanceoption.hpp, 853
ql/MonteCarlo/path.hpp, 803 ql/Pricers/singleassetoption.hpp, 854
ql/MonteCarlo/pathgenerator.hpp, 804 ql/pricingengine.hpp, 855
ql/MonteCarlo/pathpricer.hpp, 805 ql/PricingEngines/americanpayoffatexpiry.hpp,
ql/MonteCarlo/sample.hpp, 806 856
ql/null.hpp, 807 ql/PricingEngines/americanpayoffathit.hpp,
ql/numericalmethod.hpp, 808 857
ql/Optimization/armijo.hpp, 809 ql/PricingEngines/Asian/analyticasianengine.hpp,
ql/Optimization/conjugategradient.hpp, 810 858
ql/Optimization/constraint.hpp, 811 ql/PricingEngines/Barrier/analyticbarrierengine.hpp,
ql/Optimization/costfunction.hpp, 812 859
ql/Optimization/criteria.hpp, 813 ql/PricingEngines/Barrier/mcbarrierengine.hpp,
ql/Optimization/leastsquare.hpp, 814 860
ql/Optimization/linesearch.hpp, 815 ql/PricingEngines/Basket/mcamericanbasketengine.hpp,
ql/Optimization/method.hpp, 816 861
ql/Optimization/problem.hpp, 817 ql/PricingEngines/Basket/mcbasketengine.hpp,
ql/Optimization/simplex.hpp, 818 862
ql/Optimization/steepestdescent.hpp, 819 ql/PricingEngines/Basket/stulzengine.hpp,
ql/option.hpp, 820 863

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


INDEX 1011

ql/PricingEngines/blackformula.hpp, 864 ql/RandomNumbers/centrallimitgaussianrng.hpp,


ql/PricingEngines/blackmodel.hpp, 865 894
ql/PricingEngines/CapFloor/analyticalcapfloor.hpp, ql/RandomNumbers/haltonrsg.hpp, 895
866 ql/RandomNumbers/inversecumgaussianrng.hpp,
ql/PricingEngines/CapFloor/blackcapfloor.hpp, 896
867 ql/RandomNumbers/inversecumgaussianrsg.hpp,
ql/PricingEngines/CapFloor/capfloorpricer.hpp, 897
868 ql/RandomNumbers/knuthuniformrng.hpp,
ql/PricingEngines/CapFloor/treecapfloor.hpp, 898
869 ql/RandomNumbers/lecuyeruniformrng.hpp,
ql/PricingEngines/Forward/forwardengine.hpp, 899
870 ql/RandomNumbers/mt19937uniformrng.hpp,
ql/PricingEngines/Forward/forwardperformanceengine.hpp, 900
871 ql/RandomNumbers/randomarraygenerator.hpp,
ql/PricingEngines/genericmodelengine.hpp, 901
872 ql/RandomNumbers/randomsequencegenerator.hpp,
ql/PricingEngines/latticeshortratemodelengine.hpp, 902
873 ql/RandomNumbers/rngtraits.hpp, 903
ql/PricingEngines/mcsimulation.hpp, 874 ql/RandomNumbers/rngtypedefs.hpp, 904
ql/PricingEngines/Quanto/quantoengine.hpp, ql/RandomNumbers/sobolrsg.hpp, 905
875 ql/relinkablehandle.hpp, 906
ql/PricingEngines/Swaption/blackswaption.hpp, ql/scheduler.hpp, 907
876 ql/ShortRateModels/calibrationhelper.hpp,
ql/PricingEngines/Swaption/jamshidianswaption.hpp, 908
877 ql/ShortRateModels/CalibrationHelpers/caphelper.hpp,
ql/PricingEngines/Swaption/swaptionpricer.hpp, 909
878 ql/ShortRateModels/CalibrationHelpers/swaptionhelper.hpp,
ql/PricingEngines/Swaption/treeswaption.hpp, 910
879 ql/ShortRateModels/model.hpp, 911
ql/ShortRateModels/onefactormodel.hpp,
ql/PricingEngines/Vanilla/analyticdigitalamericanengine.hpp,
880 912
ql/ShortRateModels/OneFactorModels/blackkarasinski.hpp,
ql/PricingEngines/Vanilla/analyticeuropeanengine.hpp,
881 913
ql/ShortRateModels/OneFactorModels/coxingersollross.hpp,
ql/PricingEngines/Vanilla/baroneadesiwhaleyengine.hpp,
882 914
ql/PricingEngines/Vanilla/binomialengine.hpp, ql/ShortRateModels/OneFactorModels/extendedcoxingersollros
883 915
ql/PricingEngines/Vanilla/bjerksundstenslandengine.hpp,
ql/ShortRateModels/OneFactorModels/hullwhite.hpp,
884 916
ql/PricingEngines/Vanilla/discretizedvanillaoption.hpp,
ql/ShortRateModels/OneFactorModels/vasicek.hpp,
885 917
ql/PricingEngines/Vanilla/integralengine.hpp, ql/ShortRateModels/parameter.hpp, 918
886 ql/ShortRateModels/twofactormodel.hpp,
ql/PricingEngines/Vanilla/jumpdiffusionengine.hpp, 919
887 ql/ShortRateModels/TwoFactorModels/g2.hpp,
ql/PricingEngines/Vanilla/mcdigitalengine.hpp, 920
888 ql/solver1d.hpp, 921
ql/PricingEngines/Vanilla/mceuropeanengine.hpp, ql/Solvers1D/bisection.hpp, 922
889 ql/Solvers1D/brent.hpp, 923
ql/PricingEngines/Vanilla/mcvanillaengine.hpp, ql/Solvers1D/falseposition.hpp, 924
890 ql/Solvers1D/newton.hpp, 925
ql/qldefines.hpp, 891 ql/Solvers1D/newtonsafe.hpp, 926
ql/RandomNumbers/boxmullergaussianrng.hpp, ql/Solvers1D/ridder.hpp, 927
893 ql/Solvers1D/secant.hpp, 928

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1012 INDEX

ql/stochasticprocess.hpp, 929 errors.hpp, 692


ql/swaptionvolstructure.hpp, 930 QL_EPSILON
ql/termstructure.hpp, 931 limitMacros, 98
ql/TermStructures/affinetermstructure.hpp, QL_FAIL
932 errors.hpp, 691
ql/TermStructures/compoundforward.hpp, QL_FULL_ITERATOR_SUPPORT
933 iteratorMacros, 106
ql/TermStructures/discountcurve.hpp, 934 QL_IO_INIT
ql/TermStructures/drifttermstructure.hpp, macros, 96
935 QL_ITERATOR
ql/TermStructures/extendeddiscountcurve.hpp, iteratorMacros, 106
936 QL_ITERATOR_TRAITS
ql/TermStructures/flatforward.hpp, 937 iteratorMacros, 106
QL_MAX_DOUBLE
ql/TermStructures/forwardspreadedtermstructure.hpp,
938 limitMacros, 98
ql/TermStructures/impliedtermstructure.hpp, QL_MAX_INT
939 limitMacros, 98
ql/TermStructures/piecewiseflatforward.hpp, QL_MIN_DOUBLE
940 limitMacros, 98
ql/TermStructures/quantotermstructure.hpp, QL_MIN_INT
941 limitMacros, 98
ql/TermStructures/ratehelpers.hpp, 942 QL_MIN_POSITIVE_DOUBLE
ql/TermStructures/zerocurve.hpp, 943 limitMacros, 98
ql/TermStructures/zerospreadedtermstructure.hpp, QL_REQUIRE
944 errors.hpp, 692
ql/types.hpp, 945 QL_REVERSE_ITERATOR
ql/Utilities/combiningiterator.hpp, 946 iteratorMacros, 106
ql/Utilities/couplingiterator.hpp, 947 QL_SPECIALIZE_ITERATOR_TRAITS
ql/Utilities/filteringiterator.hpp, 948 iteratorMacros, 106
ql/Utilities/iteratorcategories.hpp, 949 QL_TEMPLATE_-
ql/Utilities/processingiterator.hpp, 950 METAPROGRAMMING_WORKS
ql/Utilities/steppingiterator.hpp, 951 templateMacros, 104
ql/Volatilities/blackconstantvol.hpp, 952 QL_TYPENAME
ql/Volatilities/blackvariancecurve.hpp, 953 templateMacros, 104
ql/Volatilities/blackvariancesurface.hpp, 954 QuantLib::Actual360, 107
ql/Volatilities/capflatvolvector.hpp, 955 QuantLib::Actual365, 108
ql/Volatilities/impliedvoltermstructure.hpp, QuantLib::ActualActual, 109
956 QuantLib::AcyclicVisitor, 110
ql/Volatilities/localconstantvol.hpp, 957 QuantLib::AdditiveEQPBinomialTree, 111
ql/Volatilities/localvolcurve.hpp, 958 QuantLib::AffineModel, 112
ql/Volatilities/localvolsurface.hpp, 959 QuantLib::AffineTermStructure, 113
ql/Volatilities/swaptionvolmatrix.hpp, 960 QuantLib::AffineTermStructure
ql/voltermstructure.hpp, 961 update, 114
QL_ALLOW_TEMPLATE_METHOD_- QuantLib::AmericanCondition, 115
CALLS QuantLib::AmericanExercise, 116
templateMacros, 104 QuantLib::AmericanPayoffAtExpiry, 117
QL_ASSERT QuantLib::AmericanPayoffAtHit, 118
errors.hpp, 691 QuantLib::AnalyticalCapFloor, 119
QL_DECLARE_TEMPLATE_- QuantLib::AnalyticBarrierEngine, 120
SPECIALIZATIONS QuantLib::AnalyticDigitalAmericanEngine,
templateMacros, 104 121
QL_DUMMY_RETURN QuantLib::AnalyticDiscreteAveragingAsianEngine,
macros, 95 122
QL_ENSURE QuantLib::AnalyticEuropeanEngine, 123

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


INDEX 1013

QuantLib::Arguments, 124 diffusion, 162


QuantLib::ArmijoLineSearch, 125 QuantLib::BlackSwaption, 163
QuantLib::Array, 126 QuantLib::BlackVarianceCurve, 164
QuantLib::ArrayFormatter, 128 QuantLib::BlackVarianceCurve
QuantLib::AssertionFailedError, 129 update, 165
QuantLib::AssetOrNothingPayoff, 130 QuantLib::BlackVarianceSurface, 166
QuantLib::AUDLibor, 131 QuantLib::BlackVarianceSurface
QuantLib::Average, 132 update, 167
QuantLib::BaroneAdesiWhaleyApproximationEngine, QuantLib::BlackVarianceTermStructure, 168
133 QuantLib::BlackVarianceTermStructure
QuantLib::Barrier, 134 blackVolImpl, 168
QuantLib::BarrierEngine, 135 QuantLib::BlackVolatilityTermStructure, 169
QuantLib::BarrierOption, 136 QuantLib::BlackVolatilityTermStructure
QuantLib::BarrierOption blackVarianceImpl, 169
performCalculations, 137 QuantLib::BlackVolTermStructure, 170
setupArguments, 137 QuantLib::BoundaryCondition, 172
QuantLib::BarrierOption::arguments, 138 QuantLib::BoundaryCondition
QuantLib::BasketEngine, 139 applyAfterApplying, 172
QuantLib::BasketOption, 140 applyAfterSolving, 172
QuantLib::BasketOption applyBeforeApplying, 172
performCalculations, 141 applyBeforeSolving, 172
setupArguments, 140 setTime, 173
QuantLib::BasketOption::arguments, 142 Side, 172
QuantLib::BermudanExercise, 143 QuantLib::BoundaryConstraint, 174
QuantLib::BicubicSpline, 144 QuantLib::BoxMullerGaussianRng, 175
QuantLib::BicubicSpline QuantLib::BoxMullerGaussianRng
BicubicSpline, 144 BoxMullerGaussianRng, 175
QuantLib::BicubicSpline::Impl, 145 QuantLib::BPSBasketCalculator, 176
QuantLib::BilinearInterpolation, 146 QuantLib::BPSCalculator, 177
QuantLib::BilinearInterpolation QuantLib::Brent, 178
BilinearInterpolation, 146 QuantLib::Bridge, 179
QuantLib::BilinearInterpolation::Impl, 147 QuantLib::BrownianBridge, 180
QuantLib::BinomialDistribution, 148 QuantLib::BSMOperator, 181
QuantLib::BinomialTree, 149 QuantLib::Budapest, 182
QuantLib::BinomialVanillaEngine, 150 QuantLib::CADLibor, 183
QuantLib::Bisection, 151 QuantLib::Calendar, 184
QuantLib::BivariateCumulativeNormalDistribution,QuantLib::Calendar
152 advance, 186
QuantLib::BjerksundStenslandApproximationEngine, Calendar, 185
153 isBusinessDay, 185
QuantLib::BlackCapFloor, 154 isEndOfMonth, 185
QuantLib::BlackConstantVol, 155 isHoliday, 186
QuantLib::BlackConstantVol name, 185
update, 156 operator==, 186
QuantLib::BlackKarasinski, 157 roll, 186
QuantLib::BlackKarasinski::Dynamics, 158 QuantLib::Calendar::WesternImpl, 187
QuantLib::BlackModel, 159 QuantLib::CalendarImpl, 188
QuantLib::BlackModel QuantLib::CalibrationHelper, 189
formula, 159 QuantLib::CalibrationHelper
itmProbability, 160 update, 190
update, 159 QuantLib::CalibrationSet, 191
QuantLib::BlackScholesLattice, 161 QuantLib::Cap, 192
QuantLib::BlackScholesProcess, 162 QuantLib::CapFlatVolatilityStructure, 193
QuantLib::BlackScholesProcess QuantLib::CapFlatVolatilityVector, 194

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1014 INDEX

QuantLib::CapFloor, 195 QuantLib::CumulativePoissonDistribution,


QuantLib::CapFloor 234
setupArguments, 196 QuantLib::CuriouslyRecurringTemplate,
QuantLib::CapFloor::arguments, 197 235
QuantLib::CapFloor::results, 198 QuantLib::CurrencyFormatter, 236
QuantLib::CapletForwardVolatilityStructure, QuantLib::Date, 237
199 QuantLib::DateFormatter, 239
QuantLib::CashFlow, 200 QuantLib::DayCounter, 240
QuantLib::CashFlow QuantLib::DayCounter
amount, 200 DayCounter, 241
QuantLib::CashOrNothingPayoff, 201 name, 241
QuantLib::CHFLibor, 202 operator==, 241
QuantLib::CLGaussianRng, 203 QuantLib::DayCounterImpl, 242
QuantLib::CLGaussianRng QuantLib::DepositRateHelper, 243
CLGaussianRng, 203 QuantLib::DepositRateHelper
QuantLib::CliquetEngine, 204 setTermStructure, 243
QuantLib::CliquetOption::arguments, 205 QuantLib::DerivedQuote, 245
QuantLib::CliquetOptionPricer, 206 QuantLib::DerivedQuote
QuantLib::Collar, 207 update, 245
QuantLib::combining_iterator, 208 QuantLib::DiffusionProcess, 246
QuantLib::Composite, 210 QuantLib::DiffusionProcess
QuantLib::CompositeConstraint, 211 diffusion, 246
QuantLib::CompositeQuote, 212 expectation, 246
QuantLib::CompositeQuote variance, 246
update, 212 QuantLib::DirichletBC, 248
QuantLib::ConjugateGradient, 213 QuantLib::DirichletBC
QuantLib::ConstantParameter, 214 setTime, 248
QuantLib::Constraint, 215 QuantLib::DiscountCurve, 249
QuantLib::ConstraintImpl, 216 QuantLib::DiscountStructure, 251
QuantLib::ContinuousGeometricAPO, 217 QuantLib::DiscountStructure
QuantLib::Copenhagen, 218 compoundForwardImpl, 251
QuantLib::CostFunction, 219 forwardImpl, 251
QuantLib::coupling_iterator, 220 zeroYieldImpl, 251
QuantLib::Coupon, 222 QuantLib::DiscrepancyStatistics, 253
QuantLib::Coupon QuantLib::DiscreteAveragingAsianEngine,
Coupon, 223 254
QuantLib::CoxIngersollRoss, 224 QuantLib::DiscreteAveragingAsianOption,
QuantLib::CoxIngersollRoss::Dynamics, 226 255
QuantLib::CoxRossRubinstein, 227 QuantLib::DiscreteAveragingAsianOption
QuantLib::CrankNicolson, 228 performCalculations, 256
QuantLib::Cubic, 229 setupArguments, 256
QuantLib::CubicSpline, 230 QuantLib::DiscreteAveragingAsianOption::arguments,
FirstDerivative, 231 257
Lagrange, 231 QuantLib::DiscreteGeometricAPO, 258
NotAKnot, 231 QuantLib::DiscreteGeometricASO, 259
Periodic, 231 QuantLib::DiscretizedAsset, 260
SecondDerivative, 231 QuantLib::DiscretizedAsset
QuantLib::CubicSpline postAdjustValues, 260
BoundaryCondition, 231 preAdjustValues, 260
CubicSpline, 231 QuantLib::DiscretizedDiscountBond, 262
QuantLib::CumulativeBinomialDistribution, QuantLib::DiscretizedOption, 263
232 QuantLib::DiscretizedOption
QuantLib::CumulativeNormalDistribution, postAdjustValues, 263
233 QuantLib::Disposable, 264

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


INDEX 1015

QuantLib::DMinus, 265 QuantLib::ForwardPerformanceEngine, 310


QuantLib::DoubleFormatter, 266 QuantLib::ForwardRateStructure, 311
QuantLib::DPlus, 267 QuantLib::ForwardRateStructure
QuantLib::DPlusDMinus, 268 compoundForwardImpl, 311
QuantLib::DriftTermStructure, 269 discountImpl, 311
QuantLib::DriftTermStructure zeroYieldImpl, 311
update, 270 QuantLib::ForwardSpreadedTermStructure,
QuantLib::DZero, 271 313
QuantLib::EarlyExercise, 272 QuantLib::ForwardSpreadedTermStructure
QuantLib::EndCriteria, 273 update, 314
QuantLib::EqualJumpsBinomialTree, 275 zeroYieldImpl, 314
QuantLib::EqualProbabilitiesBinomialTree, QuantLib::ForwardVanillaOption, 315
276 QuantLib::ForwardVanillaOption
QuantLib::Error, 277 performCalculations, 316
QuantLib::Error setupArguments, 316
Error, 277 QuantLib::Frankfurt, 317
QuantLib::ErrorFunction, 278 QuantLib::FraRateHelper, 318
QuantLib::Euribor, 279 QuantLib::FraRateHelper
QuantLib::EuroFormatter, 280 setTermStructure, 318
QuantLib::EuropeanExercise, 281 QuantLib::FuturesRateHelper, 320
QuantLib::EuropeanOption, 282 QuantLib::G2, 321
QuantLib::Exercise, 283 QuantLib::G2::FittingParameter, 323
QuantLib::ExplicitEuler, 284 QuantLib::GammaFunction, 324
QuantLib::ExtendedCoxIngersollRoss, 285 QuantLib::GapPayoff, 325
QuantLib::ExtendedCoxIngersollRoss::Dynamics, QuantLib::GaussianStatistics, 326
286 QuantLib::GaussianStatistics
QuantLib::ExtendedCoxIngersollRoss::FittingParameter, gaussianDownsideDeviation, 326
287 gaussianDownsideVariance, 326
QuantLib::ExtendedDiscountCurve, 288 gaussianExpectedShortfall, 327
QuantLib::ExtendedDiscountCurve gaussianPercentile, 327
compoundForwardImpl, 289 gaussianPotentialUpside, 327
update, 289 gaussianRegret, 327
QuantLib::Factorial, 290 gaussianValueAtRisk, 327
QuantLib::FalsePosition, 291 QuantLib::GBPLibor, 328
QuantLib::FdAmericanOption, 292 QuantLib::GeneralStatistics, 329
QuantLib::FdBermudanOption, 293 QuantLib::GeneralStatistics
QuantLib::FdBsmOption, 294 add, 331
QuantLib::FdDividendAmericanOption, errorEstimate, 330
296 expectationValue, 331
QuantLib::FdDividendEuropeanOption, 297 kurtosis, 330
QuantLib::FdDividendShoutOption, 298 max, 331
QuantLib::FdEuropean, 299 mean, 330
QuantLib::FdStepConditionOption, 300 min, 330
QuantLib::filtering_iterator, 301 percentile, 331
QuantLib::FiniteDifferenceModel, 302 skewness, 330
QuantLib::FiniteDifferenceModel standardDeviation, 330
rollback, 302 topPercentile, 331
QuantLib::FixedRateCoupon, 303 variance, 330
QuantLib::FixedRateCoupon QuantLib::GenericEngine, 332
amount, 304 QuantLib::GenericModelEngine, 333
QuantLib::FloatingRateCoupon, 305 QuantLib::GenericModelEngine
QuantLib::Floor, 307 update, 333
QuantLib::ForwardEngine, 308 QuantLib::GenericRiskStatistics, 334
QuantLib::ForwardOptionArguments, 309 QuantLib::GenericRiskStatistics

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1016 INDEX

averageShortfall, 336 fixing, 363


downsideDeviation, 335 name, 363
downsideVariance, 334 QuantLib::IndexedCoupon, 364
expectedShortfall, 335 QuantLib::IndexedCoupon
potentialUpside, 335 amount, 365
regret, 335 update, 365
semiDeviation, 334 QuantLib::IndexError, 366
semiVariance, 334 QuantLib::Instrument, 367
shortfall, 335 QuantLib::Instrument
valueAtRisk, 335 calculate, 368
QuantLib::Greeks, 337 performCalculations, 369
QuantLib::HaltonRsg, 338 setPricingEngine, 368
QuantLib::Handle, 339 setupArguments, 368
QuantLib::Handle setupExpired, 368
Handle, 340 QuantLib::IntegerFormatter, 370
QuantLib::Helsinki, 341 QuantLib::IntegralEngine, 371
QuantLib::History, 342 QuantLib::Interpolation, 372
QuantLib::History QuantLib::Interpolation2D, 373
History, 343 QuantLib::Interpolation2D::templateImpl,
QuantLib::History::const_iterator, 345 374
QuantLib::History::Entry, 346 QuantLib::Interpolation2DImpl, 375
QuantLib::HullWhite, 347 QuantLib::Interpolation::templateImpl, 376
QuantLib::HullWhite::Dynamics, 348 QuantLib::InterpolationImpl, 377
QuantLib::HullWhite::FittingParameter, 349 QuantLib::InverseCumulativeNormal, 378
QuantLib::ICGaussianRng, 350 QuantLib::JamshidianSwaption, 379
QuantLib::ICGaussianRng QuantLib::JarrowRudd, 380
ICGaussianRng, 350 QuantLib::Johannesburg, 381
QuantLib::ICGaussianRsg, 351 QuantLib::JointCalendar, 382
QuantLib::IllegalArgumentError, 352 QuantLib::JPYLibor, 383
QuantLib::IllegalResultError, 353 QuantLib::KnuthUniformRng, 384
QuantLib::ImplicitEuler, 354 QuantLib::KnuthUniformRng
QuantLib::ImpliedTermStructure, 355 KnuthUniformRng, 384
QuantLib::ImpliedTermStructure next, 384
update, 356 QuantLib::KronrodIntegral, 385
QuantLib::ImpliedVolTermStructure, 357 QuantLib::Lattice, 386
QuantLib::ImpliedVolTermStructure QuantLib::Lattice
update, 358 rollAlmostBack, 387
QuantLib::InArrearIndexedCoupon, 359 rollback, 387
QuantLib::IncrementalStatistics, 360 QuantLib::Lattice2D, 388
QuantLib::IncrementalStatistics QuantLib::LatticeShortRateModelEngine,
add, 362 389
addSequence, 362 QuantLib::LatticeShortRateModelEngine
downsideDeviation, 361 update, 389
downsideVariance, 361 QuantLib::LazyObject, 391
errorEstimate, 361 QuantLib::LazyObject
kurtosis, 362 calculate, 392
max, 362 freeze, 392
mean, 361 performCalculations, 392
min, 362 recalculate, 392
skewness, 362 unfreeze, 392
standardDeviation, 361 update, 392
variance, 361 QuantLib::LeastSquareFunction, 394
QuantLib::Index, 363 QuantLib::LeastSquareProblem, 395
QuantLib::Index QuantLib::LeastSquareProblem

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


INDEX 1017

targetValueAndGradient, 395 QuantLib::McPricer, 438


QuantLib::LecuyerUniformRng, 396 QuantLib::McSimulation, 439
QuantLib::LecuyerUniformRng QuantLib::MCVanillaEngine, 441
LecuyerUniformRng, 396 QuantLib::MersenneTwisterUniformRng,
next, 396 443
QuantLib::LeisenReimer, 397 QuantLib::MersenneTwisterUniformRng
QuantLib::LexicographicalView, 398 MersenneTwisterUniformRng, 443
QuantLib::Linear, 400 next, 443
QuantLib::LinearInterpolation, 401 QuantLib::Milan, 444
QuantLib::LinearInterpolation QuantLib::MixedScheme, 445
LinearInterpolation, 401 QuantLib::MonotonicCubicSpline, 447
QuantLib::LineSearch, 402 QuantLib::MonotonicCubicSpline
QuantLib::Link, 404 MonotonicCubicSpline, 447
QuantLib::Link QuantLib::MonteCarloModel, 448
Link, 404 QuantLib::MoreGreeks, 449
linkTo, 404 QuantLib::MoroInverseCumulativeNormal,
QuantLib::LocalConstantVol, 406 450
QuantLib::LocalConstantVol QuantLib::MultiAssetOption, 451
update, 407 QuantLib::MultiAssetOption
QuantLib::LocalVolCurve, 408 performCalculations, 452
QuantLib::LocalVolCurve setupArguments, 452
localVolImpl, 409 setupExpired, 452
update, 409 QuantLib::MultiAssetOption::arguments,
QuantLib::LocalVolSurface, 410 453
QuantLib::LocalVolSurface QuantLib::MultiAssetOption::results, 454
update, 411 QuantLib::MultiPath, 455
QuantLib::LocalVolTermStructure, 412 QuantLib::MultiPathGenerator, 456
QuantLib::LogLinear, 413 QuantLib::MultiPathGenerator_old, 457
QuantLib::LogLinearInterpolation, 414 QuantLib::NaturalCubicSpline, 458
QuantLib::LogLinearInterpolation QuantLib::NaturalCubicSpline
LogLinearInterpolation, 414 NaturalCubicSpline, 458
QuantLib::London, 415 QuantLib::NaturalMonotonicCubicSpline,
QuantLib::lowest_category_iterator, 416 459
QuantLib::MakeSchedule, 417 QuantLib::NaturalMonotonicCubicSpline
QuantLib::Matrix, 418 NaturalMonotonicCubicSpline, 459
QuantLib::Matrix QuantLib::NeumannBC, 460
matrixSqrt, 421 QuantLib::NeumannBC
operator+=, 420 setTime, 460
pseudoSqrt, 420 QuantLib::Newton, 461
rankReducedSqrt, 420 QuantLib::NewtonSafe, 462
QuantLib::MCAmericanBasketEngine, 422 QuantLib::NewYork, 463
QuantLib::MCBarrierEngine, 423 QuantLib::NoConstraint, 464
QuantLib::McBasket, 425 QuantLib::NonLinearLeastSquare, 465
QuantLib::MCBasketEngine, 426 QuantLib::NormalDistribution, 466
QuantLib::McCliquetOption, 428 QuantLib::Null, 467
QuantLib::MCDigitalEngine, 429 QuantLib::NullCalendar, 468
QuantLib::McDiscreteArithmeticAPO, 430 QuantLib::NullParameter, 469
QuantLib::McDiscreteArithmeticASO, 431 QuantLib::NumericalMethod, 470
QuantLib::MCEuropeanEngine, 432 QuantLib::Observable, 471
QuantLib::McEverest, 433 QuantLib::Observable
QuantLib::McHimalaya, 434 notifyObservers, 472
QuantLib::McMaxBasket, 435 QuantLib::Observer, 473
QuantLib::McPagoda, 436 QuantLib::Observer
QuantLib::McPerformanceOption, 437 update, 475

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1018 INDEX

QuantLib::OneAssetOption, 476 QuantLib::PositiveConstraint, 515


QuantLib::OneAssetOption QuantLib::PostconditionNotSatisfiedError,
impliedVolatility, 477 516
performCalculations, 478 QuantLib::PreconditionNotSatisfiedError,
setupArguments, 477 517
setupExpired, 478 QuantLib::PricingEngine, 518
QuantLib::OneAssetOption::arguments, 479 QuantLib::PrimeNumbers, 519
QuantLib::OneAssetOption::results, 480 QuantLib::Problem, 520
QuantLib::OneAssetStrikedOption, 481 QuantLib::processing_iterator, 521
QuantLib::OneAssetStrikedOption QuantLib::QuantoEngine, 523
performCalculations, 482 QuantLib::QuantoForwardVanillaOption,
setupArguments, 482 524
QuantLib::OneFactorAffineModel, 483 QuantLib::QuantoForwardVanillaOption
QuantLib::OneFactorModel, 484 setupArguments, 525
QuantLib::OneFactorModel::ShortRateDynamics, QuantLib::QuantoOptionArguments, 526
485 QuantLib::QuantoOptionResults, 527
QuantLib::OneFactorModel::ShortRateTree, QuantLib::QuantoTermStructure, 528
486 QuantLib::QuantoTermStructure
QuantLib::OneFactorOperator, 487 update, 529
QuantLib::OptimizationMethod, 488 QuantLib::QuantoVanillaOption, 530
QuantLib::Option, 490 QuantLib::QuantoVanillaOption
QuantLib::Option::arguments, 491 performCalculations, 531
QuantLib::OptionTypeFormatter, 492 setupArguments, 531
QuantLib::OrnsteinUhlenbeckProcess, 493 setupExpired, 531
QuantLib::OrnsteinUhlenbeckProcess QuantLib::Quote, 532
diffusion, 493 QuantLib::RandomArrayGenerator, 533
expectation, 493 QuantLib::RandomSequenceGenerator, 534
variance, 493 QuantLib::RateFormatter, 535
QuantLib::Oslo, 495 QuantLib::RateHelper, 536
QuantLib::OutOfMemoryError, 496 QuantLib::RateHelper
QuantLib::Parameter, 497 setTermStructure, 537
QuantLib::ParameterImpl, 498 update, 537
QuantLib::ParCoupon, 499 QuantLib::RelinkableHandle, 538
QuantLib::ParCoupon QuantLib::RelinkableHandle
amount, 500 linkTo, 538
update, 500 RelinkableHandle, 538
QuantLib::Path, 501 QuantLib::Results, 539
QuantLib::PathGenerator, 502 QuantLib::Ridder, 540
QuantLib::PathGenerator_old, 503 QuantLib::SalvagingAlgorithm, 541
QuantLib::PathGenerator_old QuantLib::Sample, 542
PathGenerator_old, 503 QuantLib::Schedule, 543
QuantLib::PathPricer, 504 QuantLib::Secant, 544
QuantLib::PathPricer_old, 505 QuantLib::SegmentIntegral, 545
QuantLib::Payoff, 506 QuantLib::SequenceStatistics, 546
QuantLib::PercentageStrikePayoff, 507 QuantLib::Short, 548
QuantLib::PerformanceOption, 508 QuantLib::Short
QuantLib::Period, 509 amount, 548
QuantLib::PiecewiseConstantParameter, QuantLib::ShortFloatingRateCoupon, 549
510 QuantLib::ShortRateModel, 550
QuantLib::PiecewiseFlatForward, 511 QuantLib::ShortRateModel
QuantLib::PiecewiseFlatForward calibrate, 551
PiecewiseFlatForward, 512 update, 551
QuantLib::PlainVanillaPayoff, 513 QuantLib::ShoutCondition, 552
QuantLib::PoissonDistribution, 514 QuantLib::SimpleCashFlow, 553

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


INDEX 1019

QuantLib::SimpleCashFlow QuantLib::SwaptionVolatilityMatrix, 589


amount, 553 QuantLib::SwaptionVolatilityStructure, 590
QuantLib::SimpleDayCounter, 554 QuantLib::Sydney, 591
QuantLib::SimpleQuote, 555 QuantLib::SymmetricSchurDecomposition,
QuantLib::SimpleSwap, 556 592
QuantLib::SimpleSwap QuantLib::TARGET, 593
setupArguments, 557 QuantLib::TermStructure, 594
QuantLib::SimpleSwap::arguments, 558 QuantLib::TermStructureConsistentModel,
QuantLib::SimpleSwap::results, 559 596
QuantLib::Simplex, 560 QuantLib::TermStructureFittingParameter,
QuantLib::Simplex 597
Simplex, 560 QuantLib::Thirty360, 598
QuantLib::SimpsonIntegral, 561 QuantLib::Tian, 599
QuantLib::SingleAssetOption, 562 QuantLib::TimeBasket, 600
QuantLib::SingleAssetOption QuantLib::TimeGrid, 601
impliedVolatility, 563 QuantLib::TimeGrid
QuantLib::SobolRsg, 564 TimeGrid, 601
QuantLib::Solver1D, 565 QuantLib::Tokyo, 602
QuantLib::Solver1D QuantLib::Toronto, 604
setMaxEvaluations, 566 QuantLib::TrapezoidIntegral, 605
solve, 566 QuantLib::Tree, 607
QuantLib::SquareRootProcess, 567 QuantLib::TreeCapFloor, 608
QuantLib::SquareRootProcess QuantLib::TreeSwaption, 609
diffusion, 567 QuantLib::TridiagonalOperator, 610
QuantLib::StatsHolder, 568 QuantLib::TridiagonalOperator::TimeSetter,
QuantLib::SteepestDescent, 569 612
QuantLib::StepCondition, 570 QuantLib::Trigeorgis, 613
QuantLib::stepping_iterator, 571 QuantLib::TrinomialBranching, 614
QuantLib::StochasticProcess, 573 QuantLib::TrinomialTree, 615
QuantLib::StochasticProcess QuantLib::TwoFactorModel, 616
update, 573 QuantLib::TwoFactorModel::ShortRateDynamics,
QuantLib::Stock, 574 617
QuantLib::Stock QuantLib::TwoFactorModel::ShortRateTree,
performCalculations, 574 618
QuantLib::Stockholm, 575 QuantLib::TypePayoff, 619
QuantLib::StrikedTypePayoff, 576 QuantLib::UpFrontIndexedCoupon, 620
QuantLib::StringFormatter, 577 QuantLib::USDLibor, 621
QuantLib::StulzEngine, 578 QuantLib::Value, 622
QuantLib::SuperSharePayoff, 579 QuantLib::VanillaEngine, 623
QuantLib::SVD, 580 QuantLib::VanillaOption, 624
QuantLib::Swap, 581 QuantLib::VanillaOption
QuantLib::Swap performCalculations, 624
performCalculations, 582 QuantLib::Vasicek, 626
sensitivity, 582 QuantLib::Vasicek::Dynamics, 627
setupExpired, 582 QuantLib::Visitor, 628
QuantLib::SwapRateHelper, 583 QuantLib::Warsaw, 629
QuantLib::SwapRateHelper QuantLib::Wellington, 630
setTermStructure, 584 QuantLib::Xibor, 631
QuantLib::Swaption, 585 QuantLib::Xibor
QuantLib::Swaption fixing, 632
performCalculations, 585 name, 632
setupArguments, 585 update, 632
QuantLib::Swaption::arguments, 587 QuantLib::XiborManager, 633
QuantLib::Swaption::results, 588 QuantLib::ZARLibor, 634

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


1020 INDEX

QuantLib::ZeroCurve, 635 setupArguments


QuantLib::ZeroSpreadedTermStructure, 636 QuantLib::BarrierOption, 137
QuantLib::ZeroSpreadedTermStructure QuantLib::BasketOption, 140
forwardImpl, 637 QuantLib::CapFloor, 196
update, 637 QuantLib::DiscreteAveragingAsian-
QuantLib::ZeroYieldStructure, 638 Option, 256
QuantLib::ZeroYieldStructure QuantLib::ForwardVanillaOption, 316
compoundForwardImpl, 638 QuantLib::Instrument, 368
discountImpl, 638 QuantLib::MultiAssetOption, 452
forwardImpl, 638 QuantLib::OneAssetOption, 477
QuantLib::Zurich, 640 QuantLib::OneAssetStrikedOption, 482
QuantLib::QuantoForwardVanilla-
rankReducedSqrt Option, 525
QuantLib::Matrix, 420 QuantLib::QuantoVanillaOption, 531
recalculate QuantLib::SimpleSwap, 557
QuantLib::LazyObject, 392 QuantLib::Swaption, 585
regret setupExpired
QuantLib::GenericRiskStatistics, 335 QuantLib::Instrument, 368
RelinkableHandle QuantLib::MultiAssetOption, 452
QuantLib::RelinkableHandle, 538 QuantLib::OneAssetOption, 478
roll QuantLib::QuantoVanillaOption, 531
QuantLib::Calendar, 186 QuantLib::Swap, 582
rollAlmostBack shortfall
QuantLib::Lattice, 387 QuantLib::GenericRiskStatistics, 335
rollback Side
QuantLib::FiniteDifferenceModel, 302 QuantLib::BoundaryCondition, 172
QuantLib::Lattice, 387 Simplex
QuantLib::Simplex, 560
SecondDerivative skewness
QuantLib::CubicSpline, 231 QuantLib::GeneralStatistics, 330
semiDeviation QuantLib::IncrementalStatistics, 362
QuantLib::GenericRiskStatistics, 334 solve
semiVariance QuantLib::Solver1D, 566
QuantLib::GenericRiskStatistics, 334 standardDeviation
sensitivity QuantLib::GeneralStatistics, 330
QuantLib::Swap, 582 QuantLib::IncrementalStatistics, 361
sequencestatistics.hpp String functions, 100
DEFINE_SEQUENCE_STAT_CONST_-
METHOD_DOUBLE, 788 targetValueAndGradient
DEFINE_SEQUENCE_STAT_CONST_- QuantLib::LeastSquareProblem, 395
METHOD_VOID, 788 Template capabilities, 104
setMaxEvaluations templateMacros
QuantLib::Solver1D, 566 QL_ALLOW_TEMPLATE_METHOD_-
setPricingEngine CALLS, 104
QuantLib::Instrument, 368 QL_DECLARE_TEMPLATE_-
setTermStructure SPECIALIZATIONS, 104
QuantLib::DepositRateHelper, 243 QL_TEMPLATE_-
QuantLib::FraRateHelper, 318 METAPROGRAMMING_WORKS,
QuantLib::RateHelper, 537 104
QuantLib::SwapRateHelper, 584 QL_TYPENAME, 104
setTime Time functions, 99
QuantLib::BoundaryCondition, 173 TimeGrid
QuantLib::DirichletBC, 248 QuantLib::TimeGrid, 601
QuantLib::NeumannBC, 460 topPercentile

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen


INDEX 1021

QuantLib::GeneralStatistics, 331

unfreeze
QuantLib::LazyObject, 392
update
QuantLib::AffineTermStructure, 114
QuantLib::BlackConstantVol, 156
QuantLib::BlackModel, 159
QuantLib::BlackVarianceCurve, 165
QuantLib::BlackVarianceSurface, 167
QuantLib::CalibrationHelper, 190
QuantLib::CompositeQuote, 212
QuantLib::DerivedQuote, 245
QuantLib::DriftTermStructure, 270
QuantLib::ExtendedDiscountCurve,
289
QuantLib::ForwardSpreadedTerm-
Structure, 314
QuantLib::GenericModelEngine, 333
QuantLib::ImpliedTermStructure, 356
QuantLib::ImpliedVolTermStructure,
358
QuantLib::IndexedCoupon, 365
QuantLib::LatticeShortRateModel-
Engine, 389
QuantLib::LazyObject, 392
QuantLib::LocalConstantVol, 407
QuantLib::LocalVolCurve, 409
QuantLib::LocalVolSurface, 411
QuantLib::Observer, 475
QuantLib::ParCoupon, 500
QuantLib::QuantoTermStructure, 529
QuantLib::RateHelper, 537
QuantLib::ShortRateModel, 551
QuantLib::StochasticProcess, 573
QuantLib::Xibor, 632
QuantLib::ZeroSpreadedTerm-
Structure, 637

valueAtRisk
QuantLib::GenericRiskStatistics, 335
variance
QuantLib::DiffusionProcess, 246
QuantLib::GeneralStatistics, 330
QuantLib::IncrementalStatistics, 361
QuantLib::OrnsteinUhlenbeckProcess,
493

zeroYieldImpl
QuantLib::DiscountStructure, 251
QuantLib::ForwardRateStructure, 311
QuantLib::ForwardSpreadedTerm-
Structure, 314

Generated on Thu Apr 15 13:15:50 2004 for QuantLib by Doxygen

You might also like