Preface |
|
xi | |
Part I Python and Finance |
|
|
1 Why Python for Finance? |
|
|
3 | (22) |
|
|
3 | (6) |
|
|
5 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
|
8 | (1) |
|
|
9 | (4) |
|
|
10 | (1) |
|
|
10 | (1) |
|
Technology and Talent as Barriers to Entry |
|
|
10 | (1) |
|
Ever-Increasing Speeds, Frequencies, Data Volumes |
|
|
11 | (1) |
|
The Rise of Real-Time Analytics |
|
|
12 | (1) |
|
|
13 | (9) |
|
Finance and Python Syntax |
|
|
14 | (3) |
|
Efficiency and Productivity Through Python |
|
|
17 | (4) |
|
From Prototyping to Production |
|
|
21 | (1) |
|
|
22 | (1) |
|
|
23 | (2) |
|
2 Infrastructure and Tools |
|
|
25 | (24) |
|
|
26 | (8) |
|
|
26 | (6) |
|
|
32 | (2) |
|
|
34 | (13) |
|
|
34 | (1) |
|
|
35 | (10) |
|
|
45 | (2) |
|
|
47 | (1) |
|
|
48 | (1) |
|
|
49 | (30) |
|
|
50 | (9) |
|
|
59 | (9) |
|
|
61 | (2) |
|
|
63 | (2) |
|
Full Vectorization with Log Euler Scheme |
|
|
65 | (2) |
|
|
67 | (1) |
|
|
68 | (6) |
|
|
74 | (1) |
|
|
75 | (4) |
Part II Financial Analytics and Development |
|
|
4 Data Types and Structures |
|
|
79 | (30) |
|
|
80 | (6) |
|
|
80 | (1) |
|
|
81 | (3) |
|
|
84 | (2) |
|
|
86 | (9) |
|
|
87 | (1) |
|
|
88 | (1) |
|
Excursion: Control Structures |
|
|
89 | (2) |
|
Excursion: Functional Programming |
|
|
91 | (1) |
|
|
92 | (2) |
|
|
94 | (1) |
|
|
95 | (7) |
|
|
96 | (1) |
|
|
97 | (4) |
|
|
101 | (1) |
|
|
102 | (4) |
|
|
102 | (3) |
|
|
105 | (1) |
|
|
106 | (1) |
|
|
107 | (2) |
|
|
109 | (28) |
|
|
109 | (19) |
|
|
110 | (5) |
|
|
115 | (6) |
|
|
121 | (7) |
|
|
128 | (4) |
|
|
132 | (3) |
|
|
135 | (1) |
|
|
135 | (2) |
|
|
137 | (36) |
|
|
138 | (13) |
|
First Steps with DataFrame Class |
|
|
138 | (4) |
|
Second Steps with DataFrame Class |
|
|
142 | (4) |
|
|
146 | (3) |
|
|
149 | (1) |
|
|
150 | (1) |
|
|
151 | (6) |
|
|
157 | (9) |
|
|
166 | (4) |
|
|
170 | (1) |
|
|
171 | (2) |
|
7 Input/Output Operations |
|
|
173 | (30) |
|
|
174 | (9) |
|
|
174 | (3) |
|
Reading and Writing Text Files |
|
|
177 | (2) |
|
|
179 | (2) |
|
Writing and Reading NumPy Arrays |
|
|
181 | (2) |
|
|
183 | (7) |
|
|
184 | (1) |
|
|
185 | (3) |
|
|
188 | (1) |
|
|
189 | (1) |
|
|
190 | (10) |
|
|
190 | (6) |
|
Working with Compressed Tables |
|
|
196 | (1) |
|
|
197 | (1) |
|
Out-of-Memory Computations |
|
|
198 | (2) |
|
|
200 | (1) |
|
|
201 | (2) |
|
|
203 | (30) |
|
Python Paradigms and Performance |
|
|
204 | (3) |
|
Memory Layout and Performance |
|
|
207 | (2) |
|
|
209 | (6) |
|
The Monte Carlo Algorithm |
|
|
209 | (1) |
|
The Sequential Calculation |
|
|
210 | (1) |
|
|
211 | (3) |
|
|
214 | (1) |
|
|
215 | (2) |
|
|
217 | (6) |
|
|
217 | (1) |
|
|
218 | (5) |
|
Static Compiling with Cython |
|
|
223 | (3) |
|
Generation of Random Numbers on GPUs |
|
|
226 | (4) |
|
|
230 | (1) |
|
|
231 | (2) |
|
|
233 | (32) |
|
|
234 | (15) |
|
|
234 | (11) |
|
|
245 | (4) |
|
|
249 | (6) |
|
|
250 | (1) |
|
|
251 | (2) |
|
|
253 | (2) |
|
|
255 | (3) |
|
|
256 | (1) |
|
Integration by Simulation |
|
|
257 | (1) |
|
|
258 | (4) |
|
|
258 | (1) |
|
|
259 | (1) |
|
|
260 | (1) |
|
|
261 | (1) |
|
|
262 | (1) |
|
|
263 | (2) |
|
|
265 | (42) |
|
|
266 | (5) |
|
|
271 | (19) |
|
|
271 | (3) |
|
|
274 | (13) |
|
|
287 | (3) |
|
|
290 | (8) |
|
|
291 | (4) |
|
|
295 | (3) |
|
|
298 | (7) |
|
|
298 | (4) |
|
|
302 | (3) |
|
|
305 | (1) |
|
|
305 | (2) |
|
|
307 | (50) |
|
|
308 | (14) |
|
|
309 | (8) |
|
|
317 | (5) |
|
|
322 | (13) |
|
|
323 | (1) |
|
|
324 | (4) |
|
|
328 | (2) |
|
|
330 | (2) |
|
|
332 | (3) |
|
Principal Component Analysis |
|
|
335 | (6) |
|
The DAX Index and Its 30 Stocks |
|
|
336 | (1) |
|
|
337 | (1) |
|
|
338 | (3) |
|
|
341 | (14) |
|
|
341 | (1) |
|
|
342 | (1) |
|
|
343 | (4) |
|
|
347 | (8) |
|
|
355 | (1) |
|
|
355 | (2) |
|
|
357 | (24) |
|
Basic Spreadsheet Interaction |
|
|
358 | (11) |
|
Generating Workbooks (.xls) |
|
|
359 | (1) |
|
Generating Workbooks (.xslx) |
|
|
360 | (2) |
|
|
362 | (2) |
|
|
364 | (2) |
|
Using pandas for Reading and Writing |
|
|
366 | (3) |
|
Scripting Excel with Python |
|
|
369 | (10) |
|
|
369 | (1) |
|
|
370 | (9) |
|
|
379 | (1) |
|
|
379 | (1) |
|
|
380 | (1) |
|
13 Object Orientation and Graphical User Interfaces |
|
|
381 | (22) |
|
|
381 | (12) |
|
|
382 | (5) |
|
|
387 | (4) |
|
|
391 | (2) |
|
Graphical User Interfaces |
|
|
393 | (8) |
|
Short Rate Class with GUI |
|
|
394 | (2) |
|
|
396 | (2) |
|
Cash Flow Series Class with GUI |
|
|
398 | (3) |
|
|
401 | (1) |
|
|
401 | (2) |
|
|
403 | (52) |
|
|
404 | (7) |
|
|
405 | (2) |
|
|
407 | (1) |
|
|
408 | (3) |
|
|
411 | (13) |
|
|
411 | (3) |
|
|
414 | (3) |
|
|
417 | (7) |
|
|
424 | (18) |
|
|
426 | (1) |
|
|
426 | (1) |
|
|
427 | (7) |
|
|
434 | (6) |
|
|
440 | (2) |
|
|
442 | (9) |
|
|
443 | (2) |
|
|
445 | (6) |
|
|
451 | (1) |
|
|
452 | (3) |
Part III Derivatives Analytics Library |
|
|
|
455 | (12) |
|
Fundamental Theorem of Asset Pricing |
|
|
455 | (3) |
|
|
456 | (1) |
|
|
457 | (1) |
|
|
458 | (4) |
|
Modeling and Handling Dates |
|
|
458 | (2) |
|
|
460 | (2) |
|
|
462 | (3) |
|
|
465 | (1) |
|
|
466 | (1) |
|
16 Simulation of Financial Models |
|
|
467 | (22) |
|
|
468 | (2) |
|
|
470 | (3) |
|
Geometric Brownian Motion |
|
|
473 | (5) |
|
|
474 | (2) |
|
|
476 | (2) |
|
|
478 | (4) |
|
|
478 | (3) |
|
|
481 | (1) |
|
|
482 | (4) |
|
|
483 | (2) |
|
|
485 | (1) |
|
|
486 | (1) |
|
|
487 | (2) |
|
|
489 | (22) |
|
|
489 | (4) |
|
|
493 | (7) |
|
|
494 | (2) |
|
|
496 | (4) |
|
|
500 | (7) |
|
Least-Squares Monte Carlo |
|
|
501 | (1) |
|
|
502 | (2) |
|
|
504 | (3) |
|
|
507 | (2) |
|
|
509 | (2) |
|
|
511 | (18) |
|
|
512 | (3) |
|
|
512 | (2) |
|
|
514 | (1) |
|
|
515 | (10) |
|
|
516 | (4) |
|
|
520 | (5) |
|
|
525 | (2) |
|
|
527 | (2) |
|
|
529 | (18) |
|
|
530 | (4) |
|
|
530 | (1) |
|
|
531 | (2) |
|
|
533 | (1) |
|
|
534 | (8) |
|
|
535 | (1) |
|
|
536 | (2) |
|
|
538 | (4) |
|
American Options on the VSTOXX |
|
|
542 | (3) |
|
Modeling Option Positions |
|
|
543 | (1) |
|
|
544 | (1) |
|
|
545 | (1) |
|
|
546 | (1) |
A Selected Best Practices |
|
547 | (10) |
B Call Option Class |
|
557 | (6) |
C Oates and Times |
|
563 | (12) |
Index |
|
575 | |