人大经济论坛下载系统

经济学 计量与统计 工商管理与财会金融投资学 其他
返回首页
当前位置: 主页 > 图书 > 金融投资学 >

Financial Recipes in C++ to be a quant!

文件格式:Pdf 可复制性:可复制 TAG标签: Financial quant Recipes 点击次数: 更新时间:2009-09-30 13:24
介绍

Contents
1 On C++ and programming. 4
1.1 Compiling and linking . . . . . . . . . . . . . . 4
1.2 The structure of a C++ program . . . . . . . . 4
1.2.1 Types . . . . . . . . . . . . . . . . . . . 4
1.2.2 Operations . . . . . . . . . . . . . . . . . 4
1.2.3 Functions and libraries . . . . . . . . . . 5
1.2.4 Templates and libraries . . . . . . . . . . 5
1.2.5 Flow control . . . . . . . . . . . . . . . . 6
1.2.6 Input Output . . . . . . . . . . . . . . . 6
1.2.7 Splitting up a program . . . . . . . . . . 7
1.2.8 Namespaces . . . . . . . . . . . . . . . . 7
1.3 Extending the language, the class concept. . . . 8
1.3.1 date, an example class . . . . . . . . . . 8
1.4 Const references . . . . . . . . . . . . . . . . . . 14
1.5 Other C++ concepts . . . . . . . . . . . . . . . 14
2 Matrix Tools 15
2.1 The rst screen . . . . . . . . . . . . . . . . . . 15
3 The value of time 16
3.1 Present value . . . . . . . . . . . . . . . . . . . 16
3.2 One interest rate with annual compounding . . . 16
3.2.1 Internal rate of return. . . . . . . . . . . 18
3.2.2 Bonds . . . . . . . . . . . . . . . . . . . 21
3.2.3 Measuring bond sensitivity to interest rate
changes . . . . . . . . . . . . . . . . . . . 25
3.3 Continously compounded interest . . . . . . . . 29
3.3.1 Present value . . . . . . . . . . . . . . . 29
3.3.2 Bond pricing and analysis . . . . . . . . 30
3.4 Further readings . . . . . . . . . . . . . . . . . . 32
4 The term structure of interest rates and an object
lesson 33
4.1 The interchangeability of discount factors, spot
interest rates and forward interest rates . . . . . 33
4.2 The term structure as an object . . . . . . . . . 36
4.2.1 Base class . . . . . . . . . . . . . . . . . 36
4.2.2 Flat term structure. . . . . . . . . . . . . 38
4.3 Using the currently observed term structure. . . 40
4.3.1 Linear Interpolation. . . . . . . . . . . . 40
4.3.2 Interpolated term structure class. . . . . 42
4.4 Bond calculations with a general term structure
and continous compounding . . . . . . . . . . . 45
5 Futures algoritms. 47
5.1 Pricing of futures contract. . . . . . . . . . . . . 47
6 Binomial option pricing 48
6.1 Multiperiod binomial pricing . . . . . . . . . . . 50
7 Basic Option Pricing, the Black Scholes formula 54
7.1 The formula . . . . . . . . . . . . . . . . . . . . 54
7.2 Understanding the why's of the formula . . . . . 57
7.2.1 The original Black Scholes analysis . . . 57
7.2.2 The limit of a binomial case . . . . . . . 57
7.2.3 The representative agent framework . . . 58
7.3 Partial derivatives. . . . . . . . . . . . . . . . . 58
7.3.1 Delta . . . . . . . . . . . . . . . . . . . . 58
7.3.2 Other Derivatives . . . . . . . . . . . . . 58

7.3.3 Implied Volatility. . . . . . . . . . . . . . 61
8 Warrants 64
8.1 Warrant value in terms of assets . . . . . . . . . 64
8.2 Valuing warrants when observing the stock value 64
8.3 Readings . . . . . . . . . . . . . . . . . . . . . . 65
9 Extending the Black Scholes formula 67
9.1 Adjusting for payouts of the underlying. . . . . . 67
9.1.1 Continous Payouts from underlying. . . . 67
9.1.2 Dividends. . . . . . . . . . . . . . . . . . 68
9.2 American options. . . . . . . . . . . . . . . . . . 69
9.2.1 Exact american call formula when stock is
paying one dividend. . . . . . . . . . . . 69
9.3 Options on futures . . . . . . . . . . . . . . . . 73
9.3.1 Black's model . . . . . . . . . . . . . . . 73
9.4 Foreign Currency Options . . . . . . . . . . . . 75
9.5 Perpetual puts and calls . . . . . . . . . . . . . 77
9.6 Readings . . . . . . . . . . . . . . . . . . . . . . 78
10 Option pricing with binomial approximations 79
10.1 Introduction . . . . . . . . . . . . . . . . . . . . 79
10.2 Pricing of options in the Black Scholes setting . 80
10.2.1 European Options . . . . . . . . . . . . . 80
10.2.2 American Options . . . . . . . . . . . . . 80
10.2.3 Estimating partials. . . . . . . . . . . . . 83
10.3 Adjusting for payouts for the underlying . . . . 86
10.4 Pricing options on stocks paying dividends using
a binomial approximation . . . . . . . . . . . . . 87
10.4.1 Checking for early exercise in the binomial
model. . . . . . . . . . . . . . . . . . . . 87
10.4.2 Proportional dividends. . . . . . . . . . . 87
10.4.3 Discrete dividends . . . . . . . . . . . . . 87
10.5 Option on futures . . . . . . . . . . . . . . . . . 91
10.6 Foreign Currency options . . . . . . . . . . . . . 92
10.7 References . . . . . . . . . . . . . . . . . . . . . 93
11 Finite Dierences 94
11.1 Explicit Finite dierences . . . . . . . . . . . . . 94
11.2 European Options. . . . . . . . . . . . . . . . . 94
11.3 American Options. . . . . . . . . . . . . . . . . 96
12 Option pricing by simulation 98
12.1 Simulating lognormally distributed random vari-
ables . . . . . . . . . . . . . . . . . . . . . . . . 98
12.2 Pricing of European Call options . . . . . . . . . 98
12.3 Hedge parameters . . . . . . . . . . . . . . . . . 99
12.4 More general payos. Function prototypes . . . 102
12.5 Improving the eciency in simulation . . . . . . 103
12.5.1 Control variates. . . . . . . . . . . . . . 103
12.5.2 Antithetic variates. . . . . . . . . . . . . 104
12.5.3 Example . . . . . . . . . . . . . . . . . . 106
12.6 More exotic options . . . . . . . . . . . . . . . . 107
13 Approximations 109
13.1 A quadratic approximation to American prices
due to BaroneAdesi and Whaley. . . . . . . . . 109
14 Average, lookback and other exotic options 113
14.1 Bermudan options . . . . . . . . . . . . . . . . . 113
14.2 Asian options . . . . . . . . . . . . . . . . . . . 116
14.3 Lookback options . . . . . . . . . . . . . . . . . 117
14.4 Monte Carlo Pricing of options whose payo de-
pend on the whole price path . . . . . . . . . . . 119

14.4.1 Generating a series of lognormally dis-
tributed variables . . . . . . . . . . . . . 119
14.5 Control variate . . . . . . . . . . . . . . . . . . 122
15 Alternatives to the Black Scholes type option for-
mula 124
15.1 Merton's Jump diusion model. . . . . . . . . . 124
16 Using a library for matrix algebra 126
16.1 An example matrix class . . . . . . . . . . . . . 126
16.2 Finite Dierences . . . . . . . . . . . . . . . . . 126
16.3 European Options . . . . . . . . . . . . . . . . . 126
16.4 American Options . . . . . . . . . . . . . . . . . 128
17 The Mean Variance Frontier 130
17.1 Setup . . . . . . . . . . . . . . . . . . . . . . . . 130
17.2 The minimum variance frontier . . . . . . . . . . 131
17.3 Calculation of frontier portfolios . . . . . . . . . 132
17.4 The global minimum variance portfolio . . . . . 133
17.5 Ecient portfolios . . . . . . . . . . . . . . . . . 134
17.6 The zero beta portfolio . . . . . . . . . . . . . . 135
17.7 Allowing for a riskless asset. . . . . . . . . . . . 135
17.8 Ecient sets with risk free assets. . . . . . . . . 136
17.9 The Sharpe Ratio . . . . . . . . . . . . . . . . . 137
17.10Short-sale constraints . . . . . . . . . . . . . . . 137
18 Pricing of bond options, basic models 138
18.1 Black Scholes bond option pricing . . . . . . . . 138
18.2 Binomial bond option pricing . . . . . . . . . . . 140
19 Credit risk 142
19.1 The Merton Model . . . . . . . . . . . . . . . . 142
19.2 Issues in implementation . . . . . . . . . . . . . 142

20 Term Structure Models 144
20.1 The Nelson Siegel term structure approximation 144
20.2 Bliss . . . . . . . . . . . . . . . . . . . . . . . . 144
20.3 Cubic spline. . . . . . . . . . . . . . . . . . . . . 147
20.4 Cox Ingersoll Ross. . . . . . . . . . . . . . . . . 149
20.5 Vasicek . . . . . . . . . . . . . . . . . . . . . . . 151
21 Binomial Term Structure models 154
21.1 The Rendleman and Bartter model . . . . . . . 154
21.2 Readings . . . . . . . . . . . . . . . . . . . . . . 154
22 Term Structure Derivatives 157
22.1 Vasicek bond option pricing . . . . . . . . . . . 157
A Normal Distribution approximations. 159
A.1 The normal distribution function . . . . . . . . . 159
A.2 The cumulative normal distribution . . . . . . . 159
A.3 Multivariate normal . . . . . . . . . . . . . . . . 159
A.4 Calculating cumulative bivariate normal proba-
bilities . . . . . . . . . . . . . . . . . . . . . . . 160
A.5 Simulating random normal numbers . . . . . . . 163
A.6 Cumulative probabilities for general multivariate
distributions . . . . . . . . . . . . . . . . . . . . 163
A.7 References . . . . . . . . . . . . . . . . . . . . . 163
B C++ concepts 165
C Summarizing routine names 166
D Installation 174
D.1 Source availability . . . . . . . . . . . . . . . . . 174
E Acknowledgements. 178

下载地址
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------