ToC

BookCover

Table of Contents

Preface  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix

1.  An abridged introduction to finance   . . . . . . . . . . . . . . . . . . . . . . . . . .  1
1.1. Financial securities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  1
1.1.1. Bonds and the continuous compounding of interest rates . . . . .  2
1.1.2. Stocks: trade, price and indices . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  5
1.1.3. Options and other derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  12
1.1.4. Portfolios and collective investment . . . . . . . . . . . . . . . . . . . . . . . .  19
1.2. Financial engineering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  20
1.2.1. Trading positions and attitudes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.2.2. On price and value of stocks. The Discounted Cash Flow model . 23
1.2.3.  Arbitrage and risk-neutral valuation principle . . . . . . . . . . . . . . . . . 27
1.2.4. The Efficient Market Hypothesis and Computational Complexity 32
1.3.  Notes, Computer Lab and Problems . . . . . . . . . . . . . . . . . . . .  . . . . . . . 35

2. Statistics of financial time series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.1. Time series of returns . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.2. Distributions, density functions and moments . . . . . . . . . . . . . . . 45
2.3. Stationarity and autocovariance . . . . . . . . . . . . . . . . . . . . . . . 58
2.4. Forecasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.5. Maximum likelihood methods . . . . . . . . . . . . . . . . . . . . . . . 65
2.6. Volatility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
2.7. Notes, Computer Lab and Problems . . . . . . . . . . . . . . . . . . . . 69

3. Correlations, causalities and similarities . . . . . . . . . . . . . . . . . . . . . . . . .  74

3.1. Correlation as a measure of association . . . . . . . . . . . . . . . . . . 74
3.1.1. Linear correlation . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.1.2. Properties of a dependence measure . . . . . . . . . . . . . . . . 78
3.1.3. Rank correlation . . . . . . . . . . . . . . . . . . . . . . . . . . 79
3.2. Causality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
3.2.1. Granger causality . . . . . . . . . . . . . . . . . . . . . . . . . 81
3.2.2. Non parametric Granger causality . . . . . . . . . . . . . . . . . 83
3.3. Grouping by similarities . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.3.1. Basics of data clustering . . . . . . . . . . . . . . . . . . . . . . 87
3.3.2. Clustering methods . . . . . . . . . . . . . . . . . . . . . . . . 89
3.3.3. Clustering validation and a summary of clustering analysis . . . 97
3.3.4. Time series evolving clusters graph . . . . . . . . . . . . . . . . 98
3.4. Stylized empirical facts of asset returns . . . . . . . . . . . . . . . . . . 106
3.5. Notes, Computer Lab and Problems . . . . . . . . . . . . . . . . . . . . 108

4. Time series models in finance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  111
4.1. On trend and seasonality . . . . . . . . . . . . . . . . . . . . . . . . . . 112
4.2. Linear processes and Autoregressive Moving Averages models . . . . . . 113
4.3. Nonlinear models ARCH and GARCH . . . . . . . . . . . . . . . . . . . 126
4.3.1. The ARCH model . . . . . . . . . . . . . . . . . . . . . . . . . 126
4.3.2. The GARCH model . . . . . . . . . . . . . . . . . . . . . . . . 130
4.4. Nonlinear semiparametric models . . . . . . . . . . . . . . . . . . . . . 133
4.4.1. Neural Networks . . . . . . . . . . . . . . . . . . . . . . . . . . 134
4.4.2. Support Vector Machines . . . . . . . . . . . . . . . . . . . . . 137
4.5. Model adequacy and model evaluation . . . . . . . . . . . . . . . . . . . 139
4.5.1. Tests for nonlinearity . . . . . . . . . . . . . . . . . . . . . . . 139
4.5.2. Tests of model performance . . . . . . . . . . . . . . . . . . . . 141
4.6. Appendix: NNet and SVM modeling in R . . . . . . . . . . . . . . . . . 142
4.7. Notes, Computer Lab and Problems . . . . . . . . . . . . . . . . . . . . 145

5. Brownian motion, binomial trees and Monte Carlo simulation . . . . . . . .  147
5.1 Continuous time processes . . . . . . . . . . . . . . . . . . . . . . . . . 147
5.1.1 The Wiener process . . . . . . . . . . . . . . . . . . . . . . . . 148
5.1.2 Itˆo’s Lemma and geometric Brownian motion . . . . . . . . . . 151
5.2 Option pricing models: continuous and discrete time . . . . . . . . . . . 155

5.2.1 The Black-Scholes formula for valuing European options . . . . 155
5.2.2 The binomial tree option pricing model . . . . . . . . . . . . . . 160
5.3 Monte Carlo valuation of derivatives . . . . . . . . . . . . . . . . . . . . 167
5.4 Notes, Computer Lab and Problems . . . . . . . . . . . . . . . . . . . . 175

6. Trade on pattern mining or value estimation . . . . . . . . . . . . . . . . . . . . . . . .   179
6.1 Technical Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
6.1.1 Dow’s Theory and Technical Analysis basic principles . . . . . . 180
6.1.2 Charts, support and resistance levels, and trends . . . . . . . . . 182
6.1.3 Technical trading rules . . . . . . . . . . . . . . . . . . . . . . 185
6.1.4 A mathematical foundation for Technical Analysis . . . . . . . . 193
6.2 Fundamental Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
6.2.1 Fundamental Analysis basic principles . . . . . . . . . . . . . . 200
6.2.2 Business indicators . . . . . . . . . . . . . . . . . . . . . . . . 201
6.2.3 Value indicators . . . . . . . . . . . . . . . . . . . . . . . . . . 202
6.2.4 Value investing . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
6.3 Notes, Computer Lab and Problems . . . . . . . . . . . . . . . . . . . . 208

7. Optimization heuristics in finance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
7.1 Combinatorial optimization problems . . . . . . . . . . . . . . . . . . . 211
7.2 Simulated annealing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
7.2.1 The basics of simulated annealing . . . . . . . . . . . . . . . . . 215
7.2.2 Estimating a GARCH(1;1) with simulated annealing . . . . . . . 216
7.3 Genetic programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
7.3.1 The basics of genetic programming . . . . . . . . . . . . . . . . 220
7.3.2 Finding profitable trading rules with genetic programming . . . . 224
7.4 Ant colony optimization . . . . . . . . . . . . . . . . . . . . . . . . . . 233
7.4.1 The basics of ant colony optimization . . . . . . . . . . . . . . . 233
7.4.2 Valuing options with ant colony optimization . . . . . . . . . . . 236
7.5 Hybrid heuristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
7.6 Practical considerations on the use of optimization heuristics . . . . . . . 241
7.7 Notes, Computer Lab and Problems . . . . . . . . . . . . . . . . . . . . 243

8. Portfolio optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
8.1 The mean-variance model . . . . . . . . . . . . . . . . . . . . . . . . . 245

8.1.1 The mean-variance rule and diversification . . . . . . . . . . . . 245
8.1.2 Minimum risk mean-variance portfolio . . . . . . . . . . . . . . 247
8.1.3 The efficient frontier and the minimum variance portfolio . . . . 248
8.1.4 General mean-variance model and the maximum return portfolio 250
8.2 Portfolios with a risk-free asset . . . . . . . . . . . . . . . . . . . . . . . 253
8.2.1 The Capital Market Line and the Market Portfolio . . . . . . . . 254
8.2.2 The Sharpe ratio . . . . . . . . . . . . . . . . . . . . . . . . . . 256
8.2.3 The Capital Asset Pricing Model and the beta of a security . . . 257
8.3 Optimization of portfolios under different constraint sets . . . . . . . . . 261
8.3.1 Portfolios with upper and lower bounds in holdings . . . . . . . 263
8.3.2 Portfolios with limited number of assets . . . . . . . . . . . . . 263
8.3.3 Simulated annealing optimization of portfolios . . . . . . . . . . 264
8.4 Portfolio selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
8.5 Notes, Computer Lab and Problems . . . . . . . . . . . . . . . . . . . . 269

9. Online finance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  271
9.1 Online problems and competitive analysis . . . . . . . . . . . . . . . . . 272
9.2 Online price search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
9.2.1 Searching for the best price . . . . . . . . . . . . . . . . . . . . 273
9.2.2 Searching for a price at random . . . . . . . . . . . . . . . . . . 274
9.3 Online trading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
9.3.1 One-way trading . . . . . . . . . . . . . . . . . . . . . . . . . . 276
9.4 Online portfolio selection . . . . . . . . . . . . . . . . . . . . . . . . . . 277
9.4.1 The Universal Online Portfolio . . . . . . . . . . . . . . . . . . 278
9.4.2 Efficient universal online portfolio strategies . . . . . . . . . . . 282
9.5 Notes, Computer Lab and Problems . . . . . . . . . . . . . . . . . . . . 284

Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287

Appendix A. The R programming environment . . . . . . . . . . . . . . . . . . . .  295
A.1 R, what is it and how to get it . . . . . . . . . . . . . . . . . . . . . . . . 295
A.2 Installing R packages and obtaining financial data . . . . . . . . . . . . . 296
A.3 To get you started in R . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
A.4 References for R and packages used in this book . . . . . . . . . . . . . 299

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . .  301