LINK DOWNLOAD MIỄN PHÍ TÀI LIỆU "Tài liệu Implementing Models in Quantitative Finance: Methods and Cases docx": http://123doc.vn/document/1054532-tai-lieu-implementing-models-in-quantitative-finance-methods-and-cases-docx.htm
To Nicola
Contents
Introduction xv
Part I Methods
1 Static Monte Carlo 3
1.1 MotivationandIssues 3
1.1.1 Issue1:MonteCarloEstimation 5
1.1.2 Issue2:EfficiencyandSampleSize 7
1.1.3 Issue3:HowtoSimulateSamples 8
1.1.4 Issue 4: H ow to Evaluate Financial Derivatives . . . . . . . . . . . 9
1.1.5 The Monte Carlo Simulation Algorithm . . . . . . . . . . . . . . . . . 11
1.2 Simulation of Random Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.2.1 Uniform Numbers Generation . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.2.2 Transformation Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.2.3 Acceptance–Rejection Methods . . . . . . . . . . . . . . . . . . . . . . . . 20
1.2.4 Hazard Rate Function Method . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.2.5 Special Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.3 Variance Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.3.1 AntitheticVariables 31
1.3.2 ControlVariables 33
1.3.3 Importance Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
1.4 Comments 39
2 Dynamic Monte Carlo 41
2.1 MainIssues 41
2.2 Continuous Diffusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2.2.1 Method I: Exact Transition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2.2.2 Method II: Exact Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.2.3 Method III: Approximate Dynamics . . . . . . . . . . . . . . . . . . . . 46
viii
2.2.4 Example: Option Valuation under Alternative Simulation
Schemes 48
2.3 JumpProcesses 49
2.3.1 Compound Jump Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.3.2 Modelling via Jump Intensity . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.3.3 SimulationwithConstantIntensity 53
2.3.4 Simulation with Deterministic Intensity . . . . . . . . . . . . . . . . . 54
2.4 Mixed-JumpDiffusions 56
2.4.1 StatementoftheProblem 56
2.4.2 Method I: Transition Probability. . . . . . . . . . . . . . . . . . . . . . . . 58
2.4.3 Method II: Exact Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
2.4.4 Method III.A: Approximate Dynamics with Deterministic
Intensity 59
2.4.5 Method III.B: Approximate Dynamics with Random Intensity 60
2.5 GaussianProcesses 62
2.6 Comments 66
3 Dynamic Programming for Stochastic Optimization 69
3.1 Controlled Dynamical Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.2 TheOptimalControlProblem 71
3.3 The Bellman Principle of Optimality . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.4 Dynamic Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.5 Stochastic Dynamic Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.6 Applications 77
3.6.1 AmericanOptionPricing 77
3.6.2 OptimalInvestmentProblem 79
3.7 Comments 81
4 Finite Difference Methods 83
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
4.1.1 Security Pricing and Partial Differential Equations . . . . . . . . 83
4.1.2 ClassificationofPDEs 84
4.2 From Black–Scholes to the Heat Equation 87
4.2.1 Changing the Time Origin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
4.2.2 Undiscounted Prices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
4.2.3 FromPricestoReturns 89
4.2.4 HeatEquation 89
4.2.5 Extending Transformations to Other Processes. . . . . . . . . . . . 90
4.3 Discretization Setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
4.3.1 Finite-Difference Approximations . . . . . . . . . . . . . . . . . . . . . . 91
4.3.2 Grid 93
4.3.3 Explicit Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
4.3.4 Implicit Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
4.3.5 Crank–Nicolson Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
4.3.6 Computing the Greeks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
ix
4.4 Consistency, Convergence and Stability . . . . . . . . . . . . . . . . . . . . . . . . 110
4.5 General Linear Parabolic PDEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
4.5.1 Explicit Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
4.5.2 Implicit Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
4.5.3 Crank–Nicolson Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
4.6 A VBA Code for Solving General Linear Parabolic PDEs . . . . . . . . . 119
4.7 Comments 119
5 Numerical Solution of Linear Systems 121
5.1 Direct Methods: The LU Decomposition . . . . . . . . . . . . . . . . . . . . . . . 122
5.2 Iterative Methods 127
5.2.1 Jacobi Iteration: Simultaneous Displacements . . . . . . . . . . . . 128
5.2.2 Gauss–Seidel Iteration (Successive Displacements) . . . . . . . . 130
5.2.3 SOR (Successive Over-Relaxation Method) . . . . . . . . . . . . . . 131
5.2.4 Conjugate Gradient Method (CGM) . . . . . . . . . . . . . . . . . . . . . 133
5.2.5 Convergence of Iterative Methods . . . . . . . . . . . . . . . . . . . . . . 135
5.3 Code for the Solution of Linear Systems . . . . . . . . . . . . . . . . . . . . . . . 140
5.3.1 VBACode 140
5.3.2 MATLABCode 141
5.4 IllustrativeExamples 143
5.4.1 Pricing a Plain Vanilla Call in the Black–Scholes Model
(VBA) 144
5.4.2 Pricing a Plain Vanilla Call in the Square-Root Model (VBA) 145
5.4.3 Pricing American Options with the CN Scheme (VBA) . . . . 147
5.4.4 Pricing a Double Barrier Call in the BS Model (MATLAB
andVBA) 149
5.4.5 Pricing an Option on a Coupon Bond in the Cox–Ingersoll–
Ross Model (MATLAB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
5.5 Comments 155
6 Quadrature Methods 157
6.1 Quadrature Rules 158
6.2 Newton–Cotes Formulae . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
6.2.1 Composite Newton–Cotes Formula . . . . . . . . . . . . . . . . . . . . . 162
6.3 Gaussian Quadrature Formulae . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
6.4 MatlabCode 180
6.4.1 Trapezoidal Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
6.4.2 SimpsonRule 180
6.4.3 Romberg Extrapolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
6.5 VBACode 181
6.6 Adaptive Quadrature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
6.7 Examples 185
6.7.1 Vanilla Options in the Black–Scholes Model . . . . . . . . . . . . . 186
6.7.2 Vanilla Options in the Square-Root Model . . . . . . . . . . . . . . . 188
6.7.3 Bond Options in the Cox–Ingersoll–Ross Model . . . . . . . . . . 190
x
6.7.4 Discretely Monitored Barrier Options . . . . . . . . . . . . . . . . . . . 193
6.8 Pricing Using Characteristic Functions. . . . . . . . . . . . . . . . . . . . . . . . . 197
6.8.1 MATLABandVBAAlgorithms 202
6.8.2 Options Pricing with Lévy Processes . . . . . . . . . . . . . . . . . . . . 206
6.9 Comments 211
7 The Laplace Transform 213
7.1 Definition and Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
7.2 NumericalInversion 216
7.3 TheFourierSeriesMethod 218
7.4 Applications to Quantitative Finance . . . . . . . . . . . . . . . . . . . . . . . . . . 219
7.4.1 Example 219
7.4.2 Example 225
7.5 Comments 228
8 Structuring Dependence using Copula Functions 231
8.1 Copula Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
8.2 Concordance and Dependence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
8.2.1 Fréchet–Hoeffding Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
8.2.2 Measures of Concordance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
8.2.3 Measures of Dependence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
8.2.4 Comparison with the Linear Correlation . . . . . . . . . . . . . . . . . 236
8.2.5 Other Notions of Dependence . . . . . . . . . . . . . . . . . . . . . . . . . . 238
8.3 Elliptical Copula Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
8.4 Archimedean Copulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
8.5 Statistical Inference for Copulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
8.5.1 Exact Maximum Likelihood . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
8.5.2 Inference Functions for Margins . . . . . . . . . . . . . . . . . . . . . . . . 254
8.5.3 Kernel-based Nonparametric Estimation . . . . . . . . . . . . . . . . . 255
8.6 MonteCarloSimulation 257
8.6.1 Distributional Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
8.6.2 Conditional Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
8.6.3 Compound Copula Simulation . . . . . . . . . . . . . . . . . . . . . . . . . 263
8.7 Comments 265
Part II Problems
Portfolio Management and Trading 271
9 Portfolio Selection: “Optimizing” an Error 273
9.1 ProblemStatement 274
9.2 Model and Solution Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
9.3 ImplementationandAlgorithm 278
9.4 ResultsandComments 280
9.4.1 In-sampleAnalysis 281
xi
9.4.2 Out-of-sampleSimulation 285
10 Alpha, Beta and Beyond 289
10.1 ProblemStatement 290
10.2 Solution Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
10.2.1 ConstantBeta:OLSEstimation 292
10.2.2 ConstantBeta:RobustEstimation 293
10.2.3 Constant Beta: Shrinkage Estimation . . . . . . . . . . . . . . . . . . . . 295
10.2.4 Constant Beta: Bayesian Estimation. . . . . . . . . . . . . . . . . . . . . 296
10.2.5 Time-Varying Beta: Exponential Smoothing . . . . . . . . . . . . . . 299
10.2.6 Time-Varying Beta: The Kalman Filter . . . . . . . . . . . . . . . . . . 300
10.2.7 Comparing the models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
10.3 ImplementationandAlgorithm 306
10.4 ResultsandComments 309
11 Automatic Trading: Winning or Losing in a kBit 311
11.1 ProblemStatement 312
11.2 Model and Solution Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
11.2.1 Measuring Trading System Performance . . . . . . . . . . . . . . . . . 314
11.2.2 StatisticalTesting 315
11.3 Code 317
11.4 ResultsandComments 322
Vanilla Options 329
12 Estimating the Risk-Neutral Density 331
12.1 ProblemStatement 332
12.2 Solution Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
12.3 ImplementationandAlgorithm 335
12.4 ResultsandComments 338
13 An “American” Monte Carlo 345
13.1 ProblemStatement 346
13.2 Model and Solution Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
13.3 ImplementationandAlgorithm 348
13.4 ResultsandComments 349
14 Fixing Volatile Volatility 353
14.1 ProblemStatement 354
14.2 Model and Solution Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
14.2.1 AnalyticalTransforms 356
14.2.2 Model Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
14.3 ImplementationandAlgorithm 360
14.3.1 CodeDescription 361
14.4 ResultsandComments 362
xii
Exotic Derivatives 371
15 An Average Problem 373
15.1 ProblemStatement 374
15.2 Model and Solution Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
15.2.1 MomentMatching 375
15.2.2 Upper and Lower Price Bounds . . . . . . . . . . . . . . . . . . . . . . . . 378
15.2.3 Numerical Solution of the Pricing PDE . . . . . . . . . . . . . . . . . . 379
15.2.4 Transform Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
15.3 ImplementationandAlgorithm 386
15.4 ResultsandComments 390
16 Quasi-Monte Carlo: An Asian Bet 395
16.1 ProblemStatement 396
16.2 Solution Metodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
16.2.1 Stratification and Latin Hypercube Sampling . . . . . . . . . . . . . 399
16.2.2 Low Discrepancy Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
16.2.3 DigitalNets 402
16.2.4 The Sobol’ Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
16.2.5 Scrambling Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
16.3 ImplementationandAlgorithm 406
16.4 ResultsandComments 407
17 Lookback Options: A Discrete Problem 411
17.1 ProblemStatement 412
17.2 Model and Solution Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
17.2.1 Analytical Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
17.2.2 Finite Difference Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
17.2.3 MonteCarloSimulation 419
17.2.4 Continuous Monitoring Formula . . . . . . . . . . . . . . . . . . . . . . . 419
17.3 ImplementationandAlgorithm 420
17.4 ResultsandComments 421
18 Electrifying the Price of Power 427
18.1 ProblemStatement 429
18.1.1 TheDemandSide 429
18.1.2 TheBidSide 429
18.1.3 The Bid Cost Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
18.1.4 TheBidStrategy 432
18.1.5 A Multi-Period Extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
18.2 Solution Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
18.3 Implementation and Experimental Results . . . . . . . . . . . . . . . . . . . . . . 435
19 A Sparkling Option 441
19.1 ProblemStatement 441
19.2 Model and Solution Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
xiii
19.3 ImplementationandAlgorithm 450
19.4 ResultsandComments 453
20 Swinging on a Tree 457
20.1 ProblemStatement 458
20.2 Model and Solution Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
20.3 ImplementationandAlgorithm 461
20.3.1 GasPriceTree 461
20.3.2 Backward Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
20.3.3 Code 464
20.4 ResultsandComments 464
Interest-Rate and Credit Derivatives 469
21 Floating Mortgages 471
21.1 Problem Statement and Solution Method . . . . . . . . . . . . . . . . . . . . . . . 473
21.1.1 Fixed-RateMortgage 473
21.1.2 Flexible-RateMortgage 474
21.2 ImplementationandAlgorithm 476
21.2.1 MarkovControlPolicies 476
21.2.2 Dynamic Programming Algorithm . . . . . . . . . . . . . . . . . . . . . . 477
21.2.3 TransactionCosts 480
21.2.4 Code 480
21.3 ResultsandComments 482
22 Basket Default Swaps 487
22.1 ProblemStatement 487
22.2 Models and Solution Methodologies . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
22.2.1 Pricing nth-to-default Homogeneous Basket Swaps . . . . . . . . 489
22.2.2 Modelling Default Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
22.2.3 MonteCarloMethod 491
22.2.4 A One-Factor Gaussian Model . . . . . . . . . . . . . . . . . . . . . . . . . 491
22.2.5 Convolutions, Characteristic Functions and Fourier
Transforms 493
22.2.6 The Hull and White Recursion . . . . . . . . . . . . . . . . . . . . . . . . . 495
22.3 ImplementationandAlgorithm 495
22.3.1 MonteCarloMethod 496
22.3.2 FastFourierTransform 496
22.3.3 Hull–White Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
22.3.4 Code 497
22.4 ResultsandComments 497
23 Scenario Simulation Using Principal Components 505
23.1 Problem Statement and Solution Methodology . . . . . . . . . . . . . . . . . . 506
23.2 ImplementationandAlgorithm 508
23.2.1 Principal Components Analysis . . . . . . . . . . . . . . . . . . . . . . . . 508
xiv
23.2.2 Code 511
23.3 ResultsandComments 511
Financial Econometrics 515
24 Parametric Estimation of Jump-Diffusions 519
24.1 ProblemStatement 520
24.2 Solution Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
24.3 ImplementationandAlgorithm 522
24.3.1 The Continuous Square-Root Model . . . . . . . . . . . . . . . . . . . . 523
24.3.2 The Mixed-Jump Square-Root Model . . . . . . . . . . . . . . . . . . . 525
24.4 ResultsandComments 528
24.4.1 Estimating a Continuous Square-Root Model . . . . . . . . . . . . . 528
24.4.2 Estimating a Mixed-Jump Square-Root Model . . . . . . . . . . . . 530
25 Nonparametric Estimation of Jump-Diffusions 531
25.1 ProblemStatement 532
25.2 Solution Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
25.3 ImplementationandAlgorithm 535
25.4 ResultsandComments 537
26 A Smiling GARCH 543
26.1 ProblemStatement 543
26.2 Model and Solution Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
26.3 ImplementationandAlgorithm 547
26.3.1 CodeDescription 551
26.4 ResultsandComments 554
A Appendix: Proof of the Thinning Algorithm 557
B Appendix: Sample Problems for Monte Carlo 559
C Appendix: The Matlab Solver 563
D Appendix: Optimal Control 569
D.1 Setting up the Optimal Stopping Problem . . . . . . . . . . . . . . . . . . . . . . 569
D.2 Proof of the Bellman Principle of Optimality. . . . . . . . . . . . . . . . . . . . 570
D.3 Proof of the Dynamic Programming Algorithm. . . . . . . . . . . . . . . . . . 570
Bibliography 573
Index 599
Preface
Introduction
This book presents and develops major numerical methods currently used for solving
problems arising in quantitative finance. Our presentation splits into two parts.
Part I is methodological, and offers a comprehensive toolkit on numerical meth-
ods and algorithms. This includes Monte Carlo simulation, numerical schemes for
partial differential equations, stochastic optimization in discrete time, copula func-
tions, transform-based methods and quadrature techniques.
Part II is practical, and features a number of self-contained cases. Each case
introduces a concrete problem and offers a detailed, step-by-step solution. Computer
code that implements the cases and the resulting output is also included.
The cases encompass a wide variety of quantitative issues arising in markets for
equity, interest rates, credit risk, energy and exotic derivatives. The corresponding
problems cover model simulation, derivative valuation, dynamic hedging, portfolio
selection, risk management, statistical estimation and model calibration.
We provide algorithms implemented using either Matlab
R
or Visual Basic for
Applications
R
(VBA). Several codes are made available through a link accessible
from the Editor’s web site.
Origin
Necessity is the mother of invention and, as such, the present work originates in class
notes and problems developed for the courses “Numerical Methods in Finance” and
“Exotic Derivatives” offered by the authors at Bocconi University within the Master
in Quantitative Finance and Insurance program (from 2000–2001 to 2003–2004) and
the Master of Quantitative Finance and Risk Management program (2004–2005 to
present).
The “Numerical Methods in Finance” course schedule allots 14 hours to the
presentation of Monte Carlo methods and dynamic programming and an additional
14 hours to partial differential equations and applications. These time constraints
Không có nhận xét nào:
Đăng nhận xét