Financial Modelling in Python

Book description

Fletcher and Gardner have created a comprehensive resource that will be of interest not only to those working in the field of finance, but also to those using numerical methods in other fields such as engineering, physics, and actuarial mathematics. By showing how to combine the high-level elegance, accessibility, and flexibility of Python, with the low-level computational efficiency of C++, in the context of interesting financial modeling problems, they have provided an implementation template which will be useful to others seeking to jointly optimize the use of computational and human resources. They document all the necessary technical details required in order to make external numerical libraries available from within Python, and they contribute a useful library of their own, which will significantly reduce the start-up costs involved in building financial models. This book is a must read for all those with a need to apply numerical methods in the valuation of financial claims.–David Louton, Professor of Finance, Bryant University

This book is directed at both industry practitioners and students interested in designing a pricing and risk management framework for financial derivatives using the Python programming language.

It is a practical book complete with working, tested code that guides the reader through the process of building a flexible, extensible pricing framework in Python. The pricing frameworks' loosely coupled fundamental components have been designed to facilitate the quick development of new models. Concrete applications to real-world pricing problems are also provided.

Topics are introduced gradually, each building on the last. They include basic mathematical algorithms, common algorithms from numerical analysis, trade, market and event data model representations, lattice and simulation based pricing, and model development. The mathematics presented is kept simple and to the point.

The book also provides a host of information on practical technical topics such as C++/Python hybrid development (embedding and extending) and techniques for integrating Python based programs with Microsoft Excel.

The book is accompanied by a CD ROM containing a code library; and a companion website www.wiley.com/go/fletcher_python which will feature code-based updates relating to Python 3.0.

Table of contents

  1. Financial Modelling in Python
    1. Copyright
    2. Contents
    3. Chapter 1: Welcome to Python
      1. Why Python?
      2. Common misconceptions about Python
      3. Roadmap for this book
    4. Chapter 2: The PPF Package
      1. PPF topology
      2. Unit testing
      3. Building and installing PPF
    5. Chapter 3: Extending Python from C++
      1. Boost.Date Time types
      2. Boost.MultiArray and special functions
      3. NumPy arrays (1/2)
      4. NumPy arrays (2/2)
    6. Chapter 4: Basic Mathematical Tools
      1. Random number generation
      2. N (.)
      3. Interpolation (1/2)
      4. Interpolation (2/2)
      5. Root finding
      6. Linear algebra (1/2)
      7. Linear algebra (2/2)
      8. Generalised linear least squares
      9. Quadratic and cubic roots
      10. Integration (1/3)
      11. Integration (2/3)
      12. Integration (3/3)
    7. Chapter 5: Market: Curves and Surfaces
      1. Curves
      2. Surfaces
      3. Environment
    8. Chapter 6: Data Model
      1. Observables
      2. Flows
      3. Adjuvants
      4. Legs
      5. Exercises
      6. Trades
      7. Trade utilities
    9. Chapter 7: Timeline: Events and Controller
      1. Events
      2. Timeline
      3. Controller
    10. Chapter 8: The Hull–White Model
      1. A component-based design
      2. The model and model factories
      3. Concluding remarks
    11. Chapter 9: Pricing using Numerical Methods
      1. A lattice pricing framework
      2. A Monte-Carlo pricing framework (1/3)
      3. A Monte-Carlo pricing framework (2/3)
      4. A Monte-Carlo pricing framework (3/3)
      5. Concluding remarks
    12. Chapter 10: Pricing Financial Structures in Hull–White
      1. Pricing a Bermudan
      2. Pricing a TARN
      3. Concluding remarks
    13. Chapter 11: Hybrid Python/C++ Pricing Systems
      1. nth_imm_of_year REVISITED
      2. Exercising nth imm of year from C++
    14. Chapter 12: Python Excel Integration
      1. Black–scholes COM server
      2. Numerical pricing with PPF in Excel (1/5)
      3. Numerical pricing with PPF in Excel (2/5)
      4. Numerical pricing with PPF in Excel (3/5)
      5. Numerical pricing with PPF in Excel (4/5)
      6. Numerical pricing with PPF in Excel (5/5)
    15. Appendices
      1. Appendix A: Python (1/3)
      2. Appendix A: Python (2/3)
      3. Appendix A: Python (3/3)
        1. Python interpreter modes
        2. Basic Python
        3. Conclusion
      4. Appendix B: Boost.Python (1/2)
      5. Appendix B: Boost.Python (2/2)
        1. Hello world
        2. Classes, constructors and methods
        3. Inheritance
        4. Python operators
        5. Functions
        6. Enums
        7. Embedding
        8. Conclusion
      6. Appendix C: Hull–White Model Mathematics
      7. Appendix D: Pickup Value Regression
    16. Bibliography
    17. Index (1/3)
    18. Index (2/3)
    19. Index (3/3)

Product information

  • Title: Financial Modelling in Python
  • Author(s): Shayne Fletcher, Christopher Gardner
  • Release date: August 2009
  • Publisher(s): Wiley
  • ISBN: 9780470987841