A practice-oriented guide to using C# to design and program pricing and trading models
In this step-by-step guide to software development for financial analysts, traders, developers and quants, the authors show both novice and experienced practitioners how to develop robust and accurate pricing models and employ them in real environments. Traders will learn how to design and implement applications for curve and surface modeling, fixed income products, hedging strategies, plain and exotic option modeling, interest rate options, structured bonds, unfunded structured products, and more. A unique mix of modern software technology and quantitative finance, this book is both timely and practical. The approach is thorough and comprehensive and the authors use a combination of C# language features, design patterns, mathematics and finance to produce efficient and maintainable software.
Designed for quant developers, traders and MSc/MFE students, each chapter has numerous exercises and the book is accompanied by a dedicated companion website, http: //
www.datasimfinancial.com/forum/viewfo..., providing all source code, alongside audio, support and discussion forums for readers to comment on the code and obtain new versions of the software.
Author(s): Daniel J. Duffy; Andrea Germani
Publisher: Wiley
Year: 2013
Language: English
Pages: 856
C# for Financial Markets
Contents
List of Figures
List of Tables
Introduction
0.1 What Is This Book?
0.2 Special Features in This Book
0.3 Who Is This Book for and What Do You Learn?
0.4 Structure of This Book
0.5 C# Source Code
1 Global Overview of the Book
1.1 Introduction and Objectives
1.2 Comparing C# and C++
1.3 Using This Book
2 C# Fundamentals
2.1 Introduction and Objectives
2.2 Background to C#
2.3 Value Types, Reference Types and Memory Management
2.4 Built-in Data Types in C#
2.5 Character and String Types
2.6 Operators
2.7 Console Input and Output
2.8 User-defined Structs
2.9 Mini Application: Option Pricing
2.10 Summary and Conclusions
2.11 Exercises and Projects
3 Classes in C#
3.1 Introduction and Objectives
3.2 The Structure of a Class: Methods and Data
3.3 The Keyword ‘this’
3.4 Properties
3.5 Class Variables and Class Methods
3.6 Creating and Using Objects in C#
3.7 Example: European Option Price and Sensitivities
3.7.1 Supporting Mathematical Functions
3.7.2 Black-Scholes Formula
3.7.3 C# Implementation
3.7.4 Examples and Applications
3.8 Enumeration Types
3.9 Extension Methods
3.10 An Introduction to Inheritance in C#
3.11 Example: Two-factor Payoff Hierarchies and Interfaces
3.12 Exception Handling
3.13 Summary and Conclusions
3.14 Exercises and Projects
4 Classes and C# Advanced Features
4.1 Introduction and Objectives
4.2 Interfaces
4.3 Using Interfaces: Vasicek and Cox-Ingersoll-Ross (CIR) Bond and Option Pricing
4.3.1 Defining Standard Interfaces
4.3.2 Bond Models and Stochastic Differential Equations
4.3.3 Option Pricing and the Visitor Pattern
4.4 Interfaces in .NET and Some Advanced Features
4.4.1 Copying Objects
4.4.2 Interfaces and Properties
4.4.3 Comparing Abstract Classes and Interfaces
4.4.4 Explicit Interfaces
4.4.5 Casting an Object to an Interface
4.5 Combining Interfaces, Inheritance and Composition
4.5.1 Design Philosophy: Modular Programming
4.5.2 A Model Problem and Interfacing
4.5.3 Implementing the Interfaces
4.5.4 Examples and Testing
4.6 Introduction to Delegates and Lambda Functions
4.6.1 Comparing Delegates and Interfaces
4.7 Lambda Functions and Anonymous Methods
4.8 Other Features in C#
4.8.1 Static Constructors
4.8.2 Finalisers
4.8.3 Casting
4.8.4 The var Keyword
4.9 Advanced .NET Delegates
4.9.1 Provides and Requires Interfaces: Creating Plug-in Methods with Delegates
4.9.2 Multicast Delegates
4.9.3 Generic Delegate Types
4.9.4 Delegates versus Interfaces, Again
4.10 The Standard Event Pattern in .NET and the Observer Pattern
4.11 Summary and Conclusions
4.12 Exercises and Projects
5 Data Structures and Collections
5.1 Introduction and Objectives
5.2 Arrays
5.2.1 Rectangular and Jagged Arrays
5.2.2 Bounds Checking
5.3 Dates, Times and Time Zones
5.3.1 Creating and Modifying Dates
5.3.2 Formatting and Parsing Dates
5.3.3 Working with Dates
5.4 Enumeration and Iterators
5.5 Object-based Collections and Standard Collection Interfaces
5.6 The List Class
5.7 The Hashtable Class
5.8 The Dictionary Class
5.9 The HashSet Classes
5.10 BitArray: Dynamically Sized Boolean Lists
5.11 Other Data Structures
5.11.1 Stack
5.11.2 Queue
5.11.3 Sorted Dictionaries
5.12 Strings and StringBuilder
5.12.1 Methods in string
5.12.2 Manipulating Strings
5.13 Some new Features in .NET 4.0
5.13.1 Optional Parameters
5.13.2 Named Parameters
5.13.3 COM Interoperability in .NET 4.0
5.13.4 Dynamic Binding
5.14 Summary and Conclusions
5.15 Exercises and Projects
6 Creating User-defined Data Structures
6.1 Introduction and Objectives
6.2 Design Rationale and General Guidelines
6.2.1 An Introduction to C# Generics
6.2.2 Generic Methods and Generic Delegates
6.2.3 Generic Constraints
6.2.4 Generics, Interfaces and Inheritance
6.2.5 Other Remarks
6.3 Arrays and Matrices
6.4 Vectors and Numeric Matrices
6.5 Higher-dimensional Structures
6.6 Sets
6.7 Associative Arrays and Matrices
6.7.1 Associative Arrays
6.7.2 Associative Matrices
6.8 Standardisation: Interfaces and Constraints
6.9 Using Associative Arrays and Matrices to Model Lookup Tables
6.10 Tuples
6.11 Summary and Conclusions
6.12 Exercises and Projects
7 An Introduction to Bonds and Bond Pricing
7.1 Introduction and Objectives
7.2 Embedded Optionality
7.3 The Time Value of Money: Fundamentals
7.3.1 A Simple Bond Class
7.3.2 Testing the Bond Functionality
7.4 Measuring Yield
7.5 Macauley Duration and Convexity
7.6 Dates and Date Schedulers for Fixed Income Applications
7.6.1 Accrued Interest Calculations and Day Count Conventions
7.6.2 C# Classes for Dates
7.6.3 DateSchedule Class
7.7 Exporting Schedulers to Excel
7.8 Other Examples
7.9 Pricing Bonds: An Extended Design
7.10 Summary and Conclusions
7.10.1 Appendix: Risks Associated with Bonds
7.11 Exercises and Projects
8 Data Management and Data Lifecycle
8.1 Introduction and Objectives
8.2 Data Lifecycle in Trading Applications
8.2.1 Configuration Data and Calculated Data
8.2.2 Which Kinds of Data Storage Devices Can We Use?
8.3 An Introduction to Streams and I/O
8.3.1 Stream Architecture
8.3.2 Backing Store Streams Functionality
8.3.3 Stream Decorators
8.3.4 Stream Adapters
8.4 File and Directory Classes
8.4.1 The Class Hierarchy
8.4.2 FileInfo and DirectoryInfo Classes
8.5 Serialisation Engines in .NET
8.5.1 DataContractSerializer
8.5.2 NetDataContractSerializer
8.5.3 Formatters
8.5.4 Implicit and Explicit Serialisation
8.6 The Binary Serialiser
8.7 XML Serialisation
8.7.1 Subclasses and Child Objects
8.7.2 Serialisation of Collections
8.7.3 The IXmlSerializable Interface
8.8 Data Lifetime Management in Financial and Trading Applications
8.9 Summary and Conclusions
8.10 Exercises and Projects
9 Binomial Method, Design Patterns and Excel Output
9.1 Introduction and Objectives
9.2 Design of Binomial Method
9.3 Design Patterns and Classes
9.3.1 Creating Input Data: Factory Method Pattern
9.3.2 Binomial Parameters and the Strategy Pattern
9.3.3 The Complete Application Object and the Mediator Pattern
9.3.4 Lattice Presentation in Excel
9.4 Early Exercise Features
9.5 Computing Hedge Sensitivities
9.6 Multi-dimensional Binomial Method
9.7 Improving Performance Using Padé Rational Approximants
9.8 Summary and Conclusions
9.9 Projects and Exercises
10 Advanced Lattices and Finite Difference Methods
10.1 Introduction and Objectives
10.2 Trinomial Model of the Asset Price and Its C# Implementation
10.3 Stability and Convergence of the Trinomial Method
10.4 The Black-Scholes Partial Differential Equation and Explicit Schemes
10.5 Implementing Explicit Schemes in C#
10.5.1 Using the Explicit Finite Difference Method
10.6 Stability of the Explicit Finite Difference Scheme
10.7 An Introduction to the Alternating Direction Explicit Method (ADE)
10.7.1 ADE in a Nutshell: The One-factor Diffusion Equation
10.7.2 ADE for Equity Pricing Problems
10.8 Implementing ADE for the Black-Scholes PDE
10.9 Testing the ADE Method
10.10 Advantages of the ADE Method
10.11 Summary and Conclusions
10.12 Appendix: ADE Numerical Experiments
10.13 Exercises and Projects
11 Interoperability: Namespaces, Assemblies and C++/CLI
11.1 Introduction and Objectives
11.2 Namespaces
11.2.1 Applications of Namespaces
11.3 An Introduction to Assemblies
11.3.1 Assembly Types
11.3.2 Specifying Assembly Attributes in AssemblyInfo.cs
11.3.3 The Relationship between Namespaces and Assemblies
11.4 Reflection and Metadata
11.4.1 Other Classes in the Reflection Namespace
11.4.2 Dynamic Method Invocation
11.4.3 Dynamic Object Creation
11.4.4 Dynamic Assembly Loading
11.4.5 Attributes and Reflection
11.4.6 Custom Attributes
11.5 C# and Native C++ Interoperability: How Is That Possible?
11.5.1 Using Native C++ from C#
11.6 Using C# from C++
11.7 Code Generation Using the Reflection API
11.7.1 The DynamicMethod Class
11.7.2 The Evaluation Stack and Argument Passing to Dynamic Methods
11.7.3 The Case in Hand: Operator Overloading for Generic Vectors and Matrices
11.8 Application Domains
11.8.1 Creating and Destroying Application Domains
11.8.2 Multiple Application Domains
11.8.3 Sharing Data between Domains
11.8.4 When to Use Application Domains
11.9 Summary and Conclusions
11.10 Exercises and Projects
12 Bond Pricing: Design, Implementation and Excel Interfacing
12.1 Introduction and Objectives
12.2 High-level Design of Bond Pricing Problem
12.3 Bond Scheduling
12.4 Bond Functionality and Class Hierarchies
12.5 Calculating Price, Yield and Discount Factors: MathTools
12.6 Data Presentation and Excel Interop
12.7 Bond Data Management
12.7.1 Data into Memory
12.7.2 Serialisation and Deserialisation
12.8 Using the Excel Files
12.9 Summary and Conclusions
12.10 Exercises and Projects
1 Code Integration: Handling Bond Details
2 Spread on Benchmark
3 Floating Rate Bond and Other Structured Notes
4 Class Hierarchy Integration
13 Interpolation Methods in Interest Rate Applications
13.1 Introduction and Objectives
13.2 Interpolation and Curve Building: Basic Formula for Interpolator Tests
13.3 Types of Curve Shape
13.4 An Overview of Interpolators
13.5 Background to Interpolation
13.6 Approximation of Function Derivatives
13.7 Linear and Cubic Spline Interpolation
13.8 Positivity-preserving Cubic Interpolations: Dougherty/Hyman and Hussein
13.9 The Akima Method
13.10 Hagan-West Approach
13.11 Global Interpolation
13.11.1 Polynomial Interpolation
13.11.2 Rational Interpolation
13.12 Bilinear Interpolation
13.13 Some General Guidelines, Hints and Tips
13.14 Using the Interpolators and Test Examples
13.14.1 The 101 Example, from A to Z
13.14.2 Some Financial Formulae
13.14.3 Cubic Spline Interpolation: an Application Example
13.14.4 A Bilinear Interpolation Simple Example
13.15 Summary and Conclusions
13.16 Exercises and Projects
14 Short Term Interest Rate (STIR) Futures and Options
14.1 Introduction and Objectives
14.2 An Overview of Cash Money Markets
14.3 Sources of Risk in Money Market Transactions
14.4 Reference Rate and Fixings
14.5 STIR Futures
14.6 Pricing STIR Options
14.7 Generating International Monetary Market (IMM) Dates
14.7.1 Modelling Option Delta and Sensitivity Analysis
14.7.2 Listed Instruments and Contracts
14.8 List STIR Futures and STIR Futures Options
14.9 Putting It All Together: STIR versus OTC from a Trader’s Perspective
14.10 Summary and Conclusions
14.11 Exercises and Projects
15 Single-curve Building
15.1 Introduction and Objectives
15.2 Starting Definitions and Overview of Curve Building Process
15.3 Building Blocks
15.3.1 Unsecured Deposit
15.3.2 Forward Rate Agreements (FRA)
15.3.3 Future Implied Rate
15.3.4 Interest Rate Swap (IRS)
15.4 Introduction to Interest Rate Swap
15.4.1 IRS Cash Flow
15.4.2 The Use of Interest Rate Swaps
15.4.3 Contract Specification and Practical Aspects
15.4.4 Traditional Swap Valuation
15.4.5 Overnight Index Swap (OIS)
15.5 The Curve Construction Mechanism
15.5.1 Traditional Bootstrapping Method
15.5.2 Best Fit Method
15.5.3 The Key Role of Interpolation
15.6 Code Design and Implementation
15.6.1 Process Design
15.6.2 ISingleRateCurve Interface
15.6.3 RateSet Class and BuildingBlock Class
15.6.4 Interpolator and Adapters
15.6.5 The Generic Base Class SingleCurveBuilder
15.6.6 Derived Class for Traditional Bootstrapping Method
15.6.7 Derived Class for Global Method with Interpolation
15.6.8 Derived Class for Global Method with Smoothness Condition
15.7 Console Examples
15.7.1 Calculating Present Value (PV) of the Floating Leg of a Swap
15.7.2 Checking If the Curve is Calibrated
15.7.3 Calculate the Time Taken to Instantiate a SingleCurveBuilder
15.7.4 Visualise Forward Rates in Excel
15.7.5 Computing Forward Start Swap
15.7.6 Computing Sensitivities: An Initial Example
15.7.7 More on Sensitivities
15.8 Summary and Conclusions
15.9 Exercises and Projects
15.10 Appendix: Types of Swaps
16 Multi-curve Building
16.1 Introduction and Objectives
16.2 The Consequences of the Crisis on Interest Rate Derivatives Valuation
16.2.1 The Growing Importance of Overnight Indexed Swap
16.2.2 Collateralisation under a CSA
16.2.3 The Role of OIS Discounting: One Curve Is Not Enough
16.2.4 Basis
16.2.5 The Par Swap Rate Formulae
16.3 Impact of Using OIS Discounting
16.3.1 Effect on Forward Rates
16.3.2 Effect on Mark-to-Market
16.3.3 Risk Effect
16.4 The Bootstrapping Process Using Two Curves: Description of the Mechanism
16.5 Sensitivities
16.6 How to Organise the Code: A Possible Solution
16.6.1 IRateCurve Base Interface and Derived Interfaces
16.6.2 The class MultiCurveBuilder
16.7 Putting it Together, Working Examples
16.7.1 Calibration Consistency
16.7.2 Print Forward Rates and Discount Factors on Excel
16.7.3 Sensitivities on Console
16.7.4 Forward Swap Matrix
16.7.5 Mark-to-Market Differences
16.7.6 Comparing Two Versions of the MultiCurveBuilder
16.7.7 Input Data, Interpolation and Forward Rates
16.7.8 Comparing Discount Factor
16.8 Summary and Conclusions
16.9 Exercises and Projects
16.10 Appendix: Par Asset Swap Spread and Zero Volatility Spread
17 Swaption, Cap and Floor
17.1 Introduction and Objectives: A Closed Formula World
17.2 Description of Instruments and Formulae
17.2.1 Cap and Floor: Description and Formulae
17.2.2 Cap and Floor at the money Strike
17.2.3 Cap Volatility and Caplet Volatility
17.2.4 Implied Volatility
17.2.5 Multi-strike and Amortising Cap and Floor
17.2.6 Swaption: Mechanism and Closed Pricing Formulae
17.2.7 Call Put Parity for Cap, Floor and Swaption
17.3 Multi-curve Framework on Cap, Floor and Swaption
17.4 Bootstrapping Volatility for Cap and Floor
17.4.1 Cap Stripping
17.4.2 Missing Data, Volatility Models and Interpolation
17.5 How to Organise the Code in C#: A Possible Solution
17.5.1 Ready to Use Formula
17.5.2 Cap Stripping Code
17.5.3 Calculating Mono-strike Caplet Volatilities
17.5.4 Managing More Mono-strike Caplet Volatilities
17.6 Console and Excel Working Examples
17.6.1 Simple Caplet Price
17.6.2 Cap As a Sum of Caplets
17.6.3 Simple Cap Volatility Bootstrapping: First Unknown Volatility
17.6.4 ATM Strike and Recursive Bootstrapping
17.6.5 Sparse Data from the Market: Volatility Optimisation and Input Interpolation
17.7 Summary and Conclusions
17.8 Exercise and Discussion
18 Software Architectures and Patterns for Pricing Applications
18.1 Introduction and Objectives
18.2 An Overview of the GOF Pattern
18.3 Creational Patterns
18.4 Builder Pattern
18.5 Structural Patterns
18.5.1 Facade Pattern
18.5.2 Layers Pattern
18.6 Behavioural Patterns
18.6.1 Visitor Pattern
18.6.2 Strategy and Template Method Patterns
18.7 Builder Application Example: Calibration Algorithms for Cap and Floor
18.7.1 Example Caplet Volatility Matrix
18.7.2 Volatility Matrix with Multiple Strikes
18.8 A PDE/FDM Patterns-based Framework for Equity Options
18.8.1 High-level Design
18.8.2 Generalisations and Extensions
18.9 Using Delegates to Implement Behavioural Design Patterns
18.10 A System Design for Monte Carlo Applications
18.10.1 A Universal System Design Methodology
18.11 Dynamic Programming in .NET
18.11.1 Numeric Type Unification
18.11.2 Implementing Dynamic Objects
18.12 Summary and Conclusions
18.13 Exercises and Projects
19 LINQ (Language Integrated Query) and Fixed Income Applications
19.1 Introduction and Objectives
19.2 Scope of Chapter and Prerequisites
19.3 LINQ Query Operators
19.3.1 Collection as Input, Collection as Output
19.3.2 Collection as Input, Noncollection as Output
19.3.3 Noncollection to Collection
19.4 LINQ Queries and Initial Examples
19.4.1 Lambda Queries and Composition
19.4.2 Comprehension Queries
19.4.3 Deferred Execution
19.5 Advanced Queries
19.5.1 Subqueries
19.5.2 Composition Strategies
19.5.3 Interpreted Queries
19.6 A Numerical Example
19.6.1 Basic Functionality
19.6.2 User-defined Aggregation Methods
19.6.3 Set Operations
19.7 Join and GroupJoin
19.8 Examples in Fixed Income Applications
19.8.1 Using Conversion Operators
19.8.2 Discount Factors
19.8.3 Bonds
19.8.4 Scenarios
19.8.5 Cash Flow Aggregation
19.8.6 Ordering Collections
19.8.7 Eonia Rates Replication
19.9 LINQ and Excel Interoperability
19.9.1 Applications in Computational Finance
19.10 Summary and Conclusions
19.11 Exercises and Projects
20 Introduction to C# and Excel Integration
20.1 Introduction and Objectives
20.2 Excel Object Model
20.3 Using COM Technology in .NET
20.4 Primary Interop Assemblies (PIA)
20.5 Standalone Applications
20.5.1 Standalone Application: Workbook and Worksheets
20.5.2 Charts
20.5.3 Using Excel with C++/CLI
20.6 Types of Excel Add-ins
20.6.1 XLL
20.6.2 XLA
20.6.3 COM
20.6.4 Automation
20.6.5 VSTO
20.7 The IDTExtensibility2 Interface and COM/.NET Interoperability
20.8 Data Visualisation in Excel
20.8.1 Excel Driver
20.8.2 Data Structures
20.8.3 ExcelMechanisms and Exception Handling
20.8.4 Examples and Applications
20.9 Conclusion and Summary
20.10 Exercises and Projects
21 Excel Automation Add-ins
21.1 Introduction and Objectives
21.2 COM Overview
21.3 Creating Automation Add-ins: The Steps
21.4 Example: Creating a Calculator, Version 1
21.5 Example: Creating a Calculator, Version 2
21.6 Versioning
21.7 Working with Ranges
21.8 Volatile Methods
21.9 Optional Parameters
21.10 Using VBA with Automation Add-ins
21.11 Summary and Conclusions
21.12 Exercises and Projects
22 C# and Excel Integration COM Add-ins
22.1 Introduction and Objectives
22.2 Preparations for COM Add-ins
22.3 The Interface IDTExtensibility2
22.4 Creating COM Add-ins: The Steps
22.5 Utility Code and Classes
22.6 Using Windows Forms
22.7 Example: Creating a COM Add-in
22.8 Debugging and Troubleshooting
22.9 An Introduction to Excel-DNA
22.9.1 Example 001: Hello World
22.9.2 Example 101: Simple Option Pricer
22.9.3 Excel-DNA and Rate Curves
22.9.4 Registration and Loading
22.9.5 What Is Inside ExcelDna.Integration.dll?
22.10 Excel COM Interoperability and Rate Multi-curve
22.11 Conclusion and Summary
22.12 Exercises and Projects
23 Real-time Data (RTD) Server
23.1 Introduction and Objectives
23.2 Real-time Data in Excel: Overview
23.3 Real-time Data Function
23.4 Example
23.5 The Topic Class and Data
23.6 Creating an RTD Server
23.7 Using the RTD Server
23.8 Testing and Troubleshooting the RTD Server
23.9 Conclusion and Summary
23.10 Exercises and Projects
24 Introduction to Multi-threading in C#
24.1 Introduction and Objectives
24.2 Processes
24.3 Using ProcessStartInfo to Redirect Process I/O
24.4 An Introduction to Threads in C#
24.4.1 The Differences between Processes and Threads
24.5 Passing Data to a Thread and between Threads
24.6 Thread States and Thread Lifecycle
24.6.1 Sleep
24.6.2 Thread Joining
24.6.3 Thread Interrupt and Abort
24.7 Thread Priority
24.8 Thread Pooling
24.9 Atomic Operations and the Interlocked Class
24.10 Exception Handling
24.11 Multi-threaded Data Structures
24.11.1 Extended Producer–Consumer Pattern
24.12 A Simple Example of Traditional Multi-threading
24.13 Summary and Conclusions
24.14 Exercises and Projects
25 Advanced Multi-threading in C#
25.1 Introduction and Objectives
25.2 Thread Safety
25.3 Locking Mechanisms for Objects and Classes
25.3.1 Locking a Class
25.3.2 Nested Locking
25.4 Mutex and Semaphore
25.5 Notification and Signalling
25.5.1 Thread Notification and the Monitor Class
25.6 Asynchronous Delegates
25.7 Synchronising Collections
25.8 Timers
25.9 Foreground and Background Threads
25.10 Executing Operations on Separate Threads: the BackgroundWorker Class
25.11 Parallel Programming in .NET
25.11.1 The Parallel Class
25.12 Task Parallel Library (TPL)
25.12.1 Creating and Starting Tasks
25.12.2 Continuations
25.13 Concurrent Data Structures
25.13.1 An Example: Producer Consumer Pattern and Random Number Generation
25.13.2 The Barrier Class
25.13.3 PLINQ
25.14 Exception Handling
25.15 Shifting Curves
25.16 Summary and Conclusions
25.17 Exercises and Projects
26 Creating Multi-threaded and Parallel Applications for Computational Finance
26.1 Introduction and Objectives
26.2 Multi-threaded and Parallel Applications for Computational Finance
26.3 Fork and Join Pattern
26.4 Geometric Decomposition
26.5 Shared Data and Reader/Writer Locks: Multiple Readers and Multiple Writers
26.5.1 Upgradeable Locks and Recursion
26.6 Monte Carlo Option Pricing and the Producer–Consumer Pattern
26.7 The StopWatch Class
26.8 Garbage Collection and Disposal
26.8.1 Disposal and the IDisposable Interface
26.8.2 Automatic Garbage Collection
26.8.3 Managed Memory Leaks
26.9 Summary and Conclusions
26.10 Exercises and Projects
A1 Object-oriented Fundamentals
A1.1 Introduction and Objectives
A1.2 Object-oriented Paradigm
A1.3 Generic Programming
A1.4 Procedural Programming
A1.5 Structural Relationships
A1.5.1 Aggregation
A1.5.2 Association
A1.5.3 Generalisation/Specialisation (Gen/Spec Relationship)
A1.6 An Introduction to Concept Modelling
A1.6.1 The Defining Attribute View
A1.6.2 The Prototype View
A1.6.3 The Exemplar-based View
A1.6.4 The Explanation-based View
A1.7 Categorisation and Concept Levels
A1.8 Whole–Part Pattern
A1.8.1 Data Decomposition
A1.9 Message-passing Concept versus Procedural Programming
A2 Nonlinear Least-squares Minimisation
A2.1 Introduction and Objectives
A2.2 Nonlinear Programming and Multi-variable Optimisation
A2.3 Nonlinear Least Squares
A2.3.1 Nonlinear Regression
A2.3.2 Simultaneous Nonlinear Equations
A2.3.3 Derivatives of Sum-of-Squares Functions
A2.4 Some Specific Methods
A2.5 The ALGLIB Library
A2.6 An Application to Curve Building
A2.7 Rate Calibration Example
A2.8 Exercises and Projects
A3 The Mathematical Background to the Alternating Direction Explicit (ADE) Method
A3.1 Introduction and Objectives
A3.2 Background to ADE
A3.3 Scoping the Problem: One-factor Problems
A3.4 An Example: One-factor Black-Scholes PDE
A3.5 Boundary Conditions
A3.6 Example: Boundary Conditions for the One-factor Black-Scholes PDE
A3.7 Motivating the ADE Method
A3.8 The ADE Method Exposed
A3.9 The Convection Term
A3.10 Other Kinds of Boundary Conditions
A3.11 Nonlinear Problems
A3.12 ADE for PDEs in Conservative Form
A3.13 Numerical Results and Guidelines
A3.13.1 The Consequences of Conditional Consistency
A3.13.2 Call Payoff Behaviour at the Far Field
A3.13.3 General Formulation of the ADE Method
A3.14 The Steps to Use when Implementing ADE
A3.15 Summary and Conclusions
A3.16 Exercises and Projects
A4 Cap, Floor and Swaption Using Excel-DNA
A4.1 Introduction
A4.2 Different Ways of Stripping Cap Volatility
A4.3 Comparing Caplet Volatility Surface
A4.4 Call Put Parity
A4.5 Cap Price Matrix
A4.6 Multi-strike and Amortising
A4.7 Simple Swaption Formula
A4.8 Swaption Straddle
A4.9 Exercises
Bibliography
Web References
Index