numerical excellence in finance n a g jan2010

22
Experts in numerical algorithms and HPC services Numerical Excellence in Finance John Holden Banking on Monte Carlo and GPUs Paris, FRANCE 28 th January 2010

Upload: johncholden

Post on 23-Jun-2015

577 views

Category:

Technology


1 download

DESCRIPTION

The presentation will include examples relevant to finance. Attendees will gain an understanding of how NAG’s mathematical and statistical software can be integrated into many different programs and environments, including Excel, MATLAB (using the NAG Toolbox for MATLAB®), C, C++, and C#.

TRANSCRIPT

Page 1: Numerical Excellence In Finance N A G Jan2010

Experts in numerical algorithms and HPC services

Numerical Excellence in Finance

John Holden

Banking on Monte Carlo and GPUsParis, FRANCE

28th January 2010

Page 2: Numerical Excellence In Finance N A G Jan2010

2Numerical Excellence in Finance – January 2010

Agenda

NAG – An Introduction

NAG – Numerical Libraries

Page 3: Numerical Excellence In Finance N A G Jan2010

3Numerical Excellence in Finance – January 2010January 10

Introduction to NAG

Founded in 1970 as a co-operative project in UK Operates as a commercial, not-for-profit organization Worldwide operations

Oxford & Manchester, UK

Chicago, US

Tokyo, Japan

Taipei, Taiwan

Over 3,000 customer sites worldwide

Staff of ~100, over 50% technical, over 25 PhDs £7m+ financial turnover

Page 4: Numerical Excellence In Finance N A G Jan2010

4Numerical Excellence in Finance – January 2010

PortfolioNumerical Libraries

Highly flexible for use in many computing languages, programmingenvironments, hardware platforms and for high performance computing methods

Connector Products for Excel, MATLAB and Maple and Giving users of the Excel and mathematical software packages

MATLAB and Maple access to NAG’s library of highly optimized and often superior numerical routines and allowing easy integration

NAG Fortran Compiler and GUI based Windows Compiler: Fortran Builder

Visualization and graphics software Build data visualization applications with NAG’s IRIS Explorer

Consultancy services

Page 5: Numerical Excellence In Finance N A G Jan2010

5Numerical Excellence in Finance – January 2010

Why bother?

Numerical computation is difficult to do accurately

Problems of Overflow / underflow

How does the computation behave for large / small numbers?

Condition How is it affected by small changes in the input?

Stability How sensitive is the computation to rounding errors?

Importance of error analysis

information about error bounds on solution

Page 6: Numerical Excellence In Finance N A G Jan2010

6Numerical Excellence in Finance – January 2010

NAG development philosophy

First priority: accuracy

Second priority: performance How fast do you want the wrong answer?

Algorithms chosen for usefulness

robustness accuracy

stability

speed

Page 7: Numerical Excellence In Finance N A G Jan2010

7Numerical Excellence in Finance – January 2010

Why Use NAG Maths Libraries?

Global reputation for quality – accuracy, reliability and robustness… Extensively tested, supported and maintained

code Reduce development time Concentrate on your key areas Components

Fit into your environment Simple interfaces to your favourite packages

Regular performance improvements!

Page 8: Numerical Excellence In Finance N A G Jan2010

8Numerical Excellence in Finance – January 2010

NAG Library and Toolbox Contents

NAG provides high-level maths and stats components Nonlinear equation solvers

Summation of series and transformations, FFTs

Quadrature

ODEs, PDEs and integral equations

Approximation and curve and surface fitting

Optimization and operations research

Dense linear algebra, including LAPACK

Sparse linear systems and eigenproblems

Special functions

Random Number Generators

...

Page 9: Numerical Excellence In Finance N A G Jan2010

9Numerical Excellence in Finance – January 2010

Use of NAG Software in Finance

Portfolio analysis / Index tracking / Risk management Optimisation, linear algebra, copulas…

Derivative pricing PDEs, RNGs, multivariate normal, …

Fixed Income/ Asset management / Portfolio Immunization Operations research

Data analysis Time series, GARCH, principal component analysis, data smoothing,

Monte Carlo simulation RNGs

……

Page 10: Numerical Excellence In Finance N A G Jan2010

10Numerical Excellence in Finance – January 2010

Don’t take our word for it….

Financial Maths Professors speed up their optimization

Page 11: Numerical Excellence In Finance N A G Jan2010

11Numerical Excellence in Finance – January 2010 11

Don’t take our word for it…...Senior Quant @ Tier 1 bank“concerning the ‘nearest correlation’ algo.I have to say, it is very fast, it uses all the power of my pc and the result is very satisfactory.”

www.walkingrandomly.com“I really like the NAG toolbox for MATLAB for the following reasons (among others): It can speed up MATLAB calculations – see my article on MATLAB's interp1 function for example, and it has some functionality that can't currently be found in MATLAB.”

Page 12: Numerical Excellence In Finance N A G Jan2010

12Numerical Excellence in Finance – January 2010

NAG Libraries Ease of Integration

C++ (various) C# / .NET CUDA Visual Basic Java Borland Delphi Python F# … and more

Excel MATLAB

SciLab, Octave

Mathematica Maple PowerBuilder R and S-Plus SAS … … and more

Page 13: Numerical Excellence In Finance N A G Jan2010

13Numerical Excellence in Finance – January 2010

NAG and Excel..

Our libraries are easily accessible from Excel Calling DLLs using VBA NAG provide VB

Declaration Statements and Examples

Page 14: Numerical Excellence In Finance N A G Jan2010

14Numerical Excellence in Finance – January 2010

NAG and .NET

NAG solutions for .NET1. Call NAG C (or Fortran) DLL from C#

2. NAG Library for .NET (beta)“a more natural solution”

DLL with C# wrappers Integrated help

3. NAG Library for .NET (Work-in-Progress) as above pure C# functions

Page 15: Numerical Excellence In Finance N A G Jan2010

15Numerical Excellence in Finance – January 2010

NAG Toolbox for MATLAB

Contains essentially all NAG functionality not a subset

Currently runs under Windows (32/64bit) or Linux (32/64-bit). Installed under the usual MATLAB toolbox

directory Can be used with MATLAB compiler

Page 16: Numerical Excellence In Finance N A G Jan2010

16Numerical Excellence in Finance – January 2010

Case study – e04uc vs fmincon

A problem from a customer from a European bank.The problem involves 48 variables and has 9 linear constraints. (No nonlinear constraints.)No derivatives supplied.

fmincon required 1890 evaluations of the objective function and tool 87.6 seconds

e04uc required only 1129 evaluations and took 49.4 seconds

Page 17: Numerical Excellence In Finance N A G Jan2010

17Numerical Excellence in Finance – January 2010Sunday, 31 January 2010 17NAG Toolbox for MATLAB

Subset of Eigenvalues and Eigenvectors

Speedup

Page 18: Numerical Excellence In Finance N A G Jan2010

18Numerical Excellence in Finance – January 2010

Best Advice – Use the Decision Trees

Page 19: Numerical Excellence In Finance N A G Jan2010

19Numerical Excellence in Finance – January 2010 19

NAG Library and Toolbox – recent additions

Global optimizationANOVA – Analysis of

VarianceNearest Correlation MatrixPartial Least Squares

Regression AnalysisPrediction intervals for

fitted modelsOption PricingGeneralised Mixed Effect

Regression

More CopulasExtreme Value Theory

StatisticsFast quantile selection

routineWaveletsAdoption of LAPACK 3.1New RNGs

Scrambled Seq for QMC Mersenne Twister Sobol Sequence generator

(50,000 dimensions)

Page 20: Numerical Excellence In Finance N A G Jan2010

20Numerical Excellence in Finance – January 2010

Other NAG software

NAG’s High Performance libraries NAG SMP Library (for multi/many core/processor)

NAG Parallel Library (for clusters architectures - MPI)

NAG Fortran Compiler Windows version with GUI & Debugger Automatic Differentiation (AD) enabled

In collaboration with RWTH Aachen University

Routines for SIMD architectures (GPUs etc) Early successes with Monte Carlo components on NVIDIA

hardware In collaboration with Professor Mike Giles

Page 21: Numerical Excellence In Finance N A G Jan2010

21Numerical Excellence in Finance – January 2010

Summary

NAG for Quality, World-leading Numerical Software Components accurate, reliable, robust

extensively tested, supported and maintained code

updated for new architectures and new algorithms

Page 22: Numerical Excellence In Finance N A G Jan2010

22Numerical Excellence in Finance – January 2010

NAG Key Contacts

www.nag.com

Technical Support and [email protected]

Sales in [email protected] Dial +33 6 87 88 12 94

NAGNews http://www.nag.co.uk/NAGNews/Index.asp