Financial Modelling in Python

by ;
Edition: 1st
Format: Hardcover
Pub. Date: 2009-08-03
Publisher(s): Wiley
List Price: $162.39

Buy New

Usually Ships in 8 - 10 Business Days.
$154.66

Rent Textbook

Select for Price
There was a problem. Please try again later.

Rent Digital

Rent Digital Options
Online:1825 Days access
Downloadable:Lifetime Access
$139.20
*To support the delivery of the digital material to you, a digital delivery fee of $3.99 will be charged on each digital item.
$139.20*

Used Textbook

We're Sorry
Sold Out

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

This book will:Show the reader how to get started quickly: Although the Python programming language is a powerful object-oriented language, it's easy to learn, especially for programmers already familiar with C or C++. Show the reader how to write less code: Comparisons of program metrics (class counts, method counts, and so on) suggest that a program written in the Python programming language can be four times smaller than the same program written in C++. Show the reader how to write better code: The Python programming language encourages good coding practices, and automatic garbage collection helps you avoid memory leaks. Show the reader how to develop programs more quickly: The Python programming language is simpler than C++, and as such, your development time could be up to twice as fast when writing in it. Your programs will also require fewer lines of code.Chapter by chapter this book gradually builds up a practical body of code that will serve as an extensible financial engineering system in python. The book uses the Black-Scholes example to begin the building of the python package that will house the code that will be presented as the book progresses.Contents 1 Welcome to Python 1.1 Why Python? 1.1.1 Python is a high-level programming language 1.1.2 Python 'plays well with others' 1.1.3 Common misconceptions about Python 1.2 Roadmap for this book 2 First steps with Python 2.1 The Black-Scholes Formula 2.2 Modules and Packages 2.3 Unit-testing 3 Extending Python from C++ 3.1 Boost.Datetime types 3.2 Boost.MultiArray types 4 Basic Mathematical Tools 4.1 Random number generation 4.2 N(.) 4.3 Interpolation 4.3.1 Interpolation in a single dimension 4.3.2 Interpolation in multiple-dimensions 4.4 Root-finding 4.4.1 Bisection Method 4.4.2 Newton-Raphson Method 4.5 Quadrature 4.5.1 Hermite 4.5.2 Piecewise constant polynomial integration 4.6 Linear Algebra 4.6.1 Matrix Inversion 4.6.2 Singular Value Decomposition 4.6.3 Solving Tridiagonal Systems 4.6.4 Solving linear systems 4.6.5 Pseudo square root 5 Curve and surface construction 5.1 Discount Factor Curves 5.2 Caplet Volatility Curves 5.3 Intensity Curves 5.4 Swaption Volatility Skew Cube 6 Pricing using Numerical Methods 6.1 Monte-Carlo pricing framework 6.2 A lattice pricing framework 7 The Hull-White model 7.1 A component based design 7.1.1 The state 7.1.2 The cache 7.1.3 The requestor 7.1.4 The filler 7.1.5 The rollback 7.1.6 The evolve 7.2 Pricing a Bermudan 7.3 Pricing a TARN 8 Hybrid Python/C++ Pricing Systems Appendices 1 A Survey of Python Programming Tools .2 Hull-White model

Author Biography

SHAYNE FLETCHER has a BSc. from the University of Sydney, Australia. He has had more than 10 years experience working for major investment banks in London, The Netherlands and Japan. In 2009 he founded QuantSoft (http://www.quantsoft.co.jp) providing technical consulting services to meet the financial engineering programming needs of its clients.

CHRISTOPHER GARDNER has a PhD in Applied Mathematics from King's College, London. He began his career working for UKAEA Fusion at Culham Laboratory before moving to the City of London. He has 10 years experience working as a Quantitative analyst. He is currently working on the pricing of Life derivatives for the Asset Management Pricing Desk at Swiss Re.

Table of Contents

Welcome to Pythonp. 1
Why Python?p. 1
Python is a general-purpose high-level programming languagep. 1
Python integrates well with data analysis, visualisation and GUI toolkitsp. 2
Python 'plays well with others'p. 2
Common misconceptions about Pythonp. 2
Roadmap for this bookp. 3
The PPF Packagep. 5
PPF topologyp. 5
Unit testingp. 6
doctestp. 6
PyUnitp. 7
Building and installing PPFp. 7
Prerequisites and dependenciesp. 7
Building the C++ extension modulesp. 8
Installing the PPF packagep. 9
Testing a PPF installationp. 9
Extending Python from C++p. 11
Boost.Date_Time typesp. 11
Examplesp. 12
Boost.MultiArray and special functionsp. 17
NumPy arraysp. 19
Accessing array data in C++p. 19
Examplesp. 23
Basic Mathematical Toolsp. 27
Random number generationp. 27
N(.)p. 28
Interpolationp. 29
Linear interpolationp. 31
Loglinear interpolationp. 32
Linear on zero interpolationp. 32
Cubic spline interpolationp. 33
Root findingp. 35
Bisection methodp. 35
Newton-Raphson methodp. 36
Linear algebrap. 38
Matrix multiplicationp. 38
Matrix inversionp. 38
Matrix pseudo-inversep. 39
Solving linear systemsp. 39
Solving tridiagonal systemsp. 39
Solving upper diagonal systemsp. 40
Singular value decompositionp. 42
Generalised linear least squaresp. 44
Quadratic and cubic rootsp. 46
Integrationp. 49
Piecewise constant polynomial fittingp. 49
Piecewise polynomial integrationp. 51
Semi-analytic conditional expectationsp. 57
Market: Curves and Surfacesp. 63
Curvesp. 63
Surfacesp. 64
Environmentp. 65
Data Modelp. 69
Observablesp. 69
LIBORp. 70
Swap ratep. 74
Flowsp. 79
Adjuvantsp. 82
Legsp. 84
Exercisesp. 85
Tradesp. 87
Trade utilitiesp. 88
Timeline: Events and Controllerp. 93
Eventsp. 93
Timelinep. 94
Controllerp. 97
The Hull-White Modelp. 99
A component-based designp. 99
Requestorp. 100
Statep. 101
Fillerp. 104
Rollbackp. 108
Evolvep. 112
Exercisep. 115
The model and model factoriesp. 118
Concluding remarksp. 121
Pricing using Numerical Methodsp. 123
A lattice pricing frameworkp. 123
A Monte-Carlo pricing frameworkp. 128
Pricing non-callable tradesp. 129
Pricing callable tradesp. 131
Concluding remarksp. 142
Pricing Financial Structures in Hull-Whitep. 145
Pricing a Bermudanp. 145
Pricing a TARNp. 152
Concluding remarksp. 157
Hybrid Python/C++ Pricing Systemsp. 159
nth_imm_of_year revisitedp. 159
Exercising nth_imm_of_year from C++p. 161
Python Excel Integrationp. 165
Black-scholes COM serverp. 165
VBS clientp. 167
VBA clientp. 167
Numerical pricing with PPF in Excelp. 168
Common utilitiesp. 168
Market serverp. 169
Trade serverp. 176
Pricer serverp. 187
Appendicesp. 191
Pythonp. 193
Python interpreter modesp. 193
Interactive modep. 193
Batch modep. 193
Basic Pythonp. 194
Simple expressionsp. 194
Built-in data typesp. 195
Control flow statementsp. 197
Functionsp. 200
Classesp. 201
Modules and packagesp. 203
Conclusionp. 205
Boost.Pythonp. 207
Hello worldp. 207
Classes, constructors and methodsp. 207
Inheritancep. 209
Python operatorsp. 212
Functionsp. 212
Enumsp. 214
Embeddingp. 214
Conclusionp. 216
Hull-White Model Mathematicsp. 217
Pickup Value Regressionp. 219
Bibliographyp. 221
Indexp. 223
Table of Contents provided by Ingram. All Rights Reserved.

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.