42
© 2006 The MathWorks, Inc. Managing Risk with Extreme Managing Risk with Extreme Value Theory and Copulas : Value Theory and Copulas : A MATLAB Financial Case A MATLAB Financial Case Study Study Financial Products Group Financial Products Group Eugene McGoldrick & Rick Baker Financial Products Development

Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

© 2

00

6 T

he

Ma

thW

ork

s,

Inc.

Managing Risk with ExtremeManaging Risk with Extreme

Value Theory and Copulas :Value Theory and Copulas :

A MATLAB Financial CaseA MATLAB Financial Case

StudyStudy

Financial Products GroupFinancial Products Group

Eugene McGoldrick & Rick Baker

Financial Products Development

Page 2: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

2

$0

$100

$200

$300

1998 1999 2000 2001 2002 2003 2004 2005

The MathWorks Today2005 - continued MATLAB - Simulink growth

� 2005 Revenue - $350M

� 16% total revenue growth

� 1,300 employees - 38%in product development

� 1,000,000 current users -in 175 countries

Earth’s topography on an equidistant cylindrical projection, created with the

MATLAB® Mapping Toolbox

Page 3: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

3

Business ChallengesBusiness Challenges

� Development time

� Computational speed

� Deployment time

Lost opportunity or added riskLost opportunity or added risk

Page 4: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

© 2

00

6 T

he

Ma

thW

ork

s,

Inc.

OverviewOverview

Page 5: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

5

Excel L

ink

Typical Process Flow

MATLAB

Financial

Fin

an

cia

l

Deri

vati

ves

GA

RC

H

Statistics

Fix

ed

-

Inc

om

e

OptimizationData

base

Data

feed B

uild

er

Fo

r E

xcel

Bu

ild

er

for

.Net

MATLAB

Compiler

Rep

ort

Gen

era

tor

Data

Analysis &

Visualization

Data

Analysis &

Visualization

DataData

Financial

Modeling

Financial

ModelingReportsReports

Deploy

Applications

Deploy

Applications

Bu

ild

er

Fo

r Java

Page 6: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

6

The Power of MATLABThe Power of MATLAB

MATLAB is both

An Application Development Environment: Models developed in MATLAB by financial professionals are translated into components using the MATLAB Compiler and distributed as stand-alone applications or quickly integrated into new or existing legacy applications by Information Technology Engineers

A Computational Environment:

Financial professional develop complex financialmodels using MATLAB and its family of toolboxes

and

Page 7: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

7

The Case Study

� Extreme Value Theory and Copula

modeling with MATLAB

� Generating supporting

documentation from

MATLAB

� Deploying to desktop applications

Page 8: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

8

MATLAB Presentation

Managing Risk with Extreme Value Theory and CopulasManaging Risk with Extreme Value Theory and Copulas

Rick BakerRick Baker

Page 9: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

9

Products used to develop the model

� MATLAB

� Statistics Toolbox

� Optimization Toolbox

� GARCH Toolbox

� Database Toolbox

MATLAB

FinancialG

AR

CH

Statistics OptimizationData

base

Page 10: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

© 2

00

6 T

he

Ma

thW

ork

s,

Inc.

Interaction with Excel … Excel LinkInteraction with Excel … Excel Link

Page 11: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

11

Excel Link

� Excel is the front end

� Excel Link is the communication layerbetween the MATLAB and Excel

� MATLAB is the computational/graphics engine

Page 12: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

12

MATLAB – Excel Link ApplicationE

xcel L

ink

MATLAB

FinancialG

AR

CH

Statistics OptimizationData

base

� MATLAB connects to the database

� Numerical algorithms are written and executed inMATLAB

� Excellent test environment for future models that willbe deployed onto the desktop.

Page 13: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

© 2

00

6 T

he

Ma

thW

ork

s,

Inc.

Deploying the model/algorithmDeploying the model/algorithm

Page 14: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

14

Academic

Research

Quantitative

Research

Analytic

Prototyping and

Application

Development

Analytic

Prototyping

Investment

Professionals:

Analysts, Traders,

Portfolio Managers

Finance

Professionals:

Accountants,

Financial Analysts

Actuaries

Model Development ProcessModel Development Process

� Learning curve

� Deployment

� FunctionalityApplicationSpecific Software

� Limited functionality� Ease of use

� Deployment

Excel

Excel, C/C++,VB

WeaknessStrength

Page 15: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

15

MATLAB Prototype to ProductionMATLAB Prototype to Production

Academic

Research

Quantitative

Research

Analytic

Prototyping and

Application

Development

Analytic

Prototyping

Requests

MATLABMATLAB

Investment

Professionals:

Analysts, Traders,

Portfolio

Managers.

Finance

Professionals:

Accountants,

Financial Analysts,

Actuaries

MATLAB prototype to production system

… single command at the command line

Traditional prototype to production system port

… development timeline : 2 weeks ~ 6+ months

Page 16: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

16

The MATLAB CompilerThe MATLAB Compiler

• Works with C/C++ compilers (Microsoft Visual Studio)

• Creates executables, components, or libraries

• Supports the entire MATLAB language (OOP’s, JAVA, EVAL, ActiveX)

• Deploy applications at no cost

Your

MATLAB

App

Your

MATLAB

Functions

Integrate into other

environments

Deploy as a

standalone

Page 17: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

17

Compiler architecture … 3 Components

• Executable, Component orLibrary

• Component Technology File(CTF)

• CTF file contains all supportingm files, mex files, java files, MATfiles, etc. that are needed toallow application to run.

• Enables customers to protecttheir IP due to new encryptionmodel used in building the CTFarchive.

• MATLAB ComponentRuntime (MCR)

MathWorks

supplied MCR

CTF

Archive

EXE, COM, or Lib

Components

built by the

compiler

(usually 300KB)

Deployed

once onto

the desktop

(100 MEG)

Page 18: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

18

C/CC/C++ Shared Objects++ Shared Objects

WebWebStand-aloneStand-alone

Excel

COM

Deploying with MATLABDeploying with MATLAB

.Net

Page 19: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

19

Deployed

Application/Algorithm

Application/Component Deployment from MATLAB

• Taking a thin slice of Toolbox functionality that is relevant for the

Application/Algorithm and packaging it up to support the Standalone

Application/Component

User Developed

GUI’s,

Algorithms,

And

Graphics

Financial

Financial

Derivatives

GARCH

Statistics

Fixed-Income

OptimizationDatabase

Datafeed

Application/Algorithm in MATLAB

MATLAB Compiler

Page 20: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

20

Standalone Applications

� Single commandat commandprompt (mcc)

� Build fullapplications inMATLAB

� Deploy todesktop …royalty free

MATLAB

MATLAB

CompilerMATLAB Application

Page 21: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

21

Deploying to Excel … Excel Add-ins

� Component and VBA code generated byExcel Builder

� “Black Box” model deployed to desktop,algorithms are protected.

Page 22: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

22

Deploying with COM

� Deploy componentsto any COM compliantlanguage

– C

– C++

– VB

MATLAB

Bu

ild

er

for .N

et

MATLAB

Compiler

MATLAB Algorithm

Page 23: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

23

Deploying to .Net

� Develop componentsthat can be used with.Net languages

– VB.Net

– C#

MATLAB

Bu

ild

er

for .N

et

MATLAB

Compiler

MATLAB Algorithm

Page 24: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

24

Deploying to Java (Beta)

� Generate Javaclasses fromMATLAB.

� SeamlessIntegration intoJAVA applications

MATLAB

MATLAB

Compiler

Bu

ild

er

Fo

r J

ava

MATLAB Algorithm

Page 25: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

25

Web Applications … .Net/COM

� MATLAB generated .Net and COM components can bedeployed to the web via Active Server Pages (ASP)

MATLAB .NET

Component

Microsoft IIS

Web Server

MATLAB COM

Component

MATLAB Component Runtime (MCR)

Page 26: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

26

Web Applications … Java

� MATLAB generated Java components can bedeployed to the web using JAVA Server Pages (JSP)

MATLAB JAVA

Component

MATLAB Component Runtime (MCR)

Apache Web

Server

Tomcat Servlet

Engine

JAVA Servlet

Page 27: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

© 2

00

6 T

he

Ma

thW

ork

s,

Inc.

ReportingReporting

• Documents for compliance and modelverification

• Generating custom daily/nightly reports

Page 28: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

28

Compliance and Model VerificationCompliance and Model Verification

� Documentation of code– Display code and comments

– Headings, links, and fonts

– Graphics

– Multi –output formats

• HTML, XML, Word, LaTex, PowerPoint

� Create dependency reports– Understand parent/child relationships

� Performance reports– Recommendations for improvements

– Check unused variables

Page 29: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

29

Custom Report GenerationCustom Report Generation

Create � Template based report design– Develop report outline

– Reusable templates

� Scripting features– Chapters

– Text, tables, links, graphs, code, etc

� Multiple output formats– HTML

– XML

– RTF

Page 30: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

© 2

00

6 T

he

Ma

thW

ork

s,

Inc.

Wrap UpWrap Up

Page 31: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

31

Business Tools on the Desktop MATLAB Tools

- Excel

- Word

- Browsers

- Live Market Data

- Databases

• Oracle

• Microsoft Access

• Microsoft SQLServer

• Sybase SQLServer

• ….

- Excel Link & Data Import Tool

- Publisher, copy figure

- Publisher and Report Generator

- Datafeed Toolbox

- Database Toolbox

• ODBC & JDBC

• …

MATLAB for Business ApplicationsMATLAB for Business Applications

Page 32: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

32

Benefits of MATLABBenefits of MATLAB

• Interactive environment

• An extensive library of viewable code that can beused “as is” or modified to incorporate businessmodels

• Matrix based — handle and manipulate large datasets

• First rate graphics engine

• A considerably shorter application developmentprocess resulting in rapid delivery of model to theend user desktop

Page 33: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

33

The MATLAB AdvantageThe MATLAB Advantage

• Develop models faster

• Run large scale simulations

• Reduces the costs of model integration

Page 34: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

34

Representative CustomersRepresentative Customers

• Federal Reserve Bank

• Goldman Sachs

• J.P. Morgan Chase

• State Street

• Salomon Smith Barney

• Merrill Lynch

• Ernst & Young

• Deloitte & Touche

• Lehman Brothers

• Putnam Investments

• Prudential Securities

• Bank of America

• Freddie Mac

• Fannie Mae

• Moody’s Investors

• Scudder Investment

• Price WaterhouseCoopers

Page 35: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

35

Insurance and Energy Trading CompaniesInsurance and Energy Trading Companies

• Allstate Insurance

• American RE

• AXA

• Element RE

• John Hancock

• Kemper RE

• Liberty Mutual

• New York Life

• Zurich RE

• Williams Energy

• Reliant Energy

• TXU

• Mirant

• ExxonMobil

• Entergy Koch

• Constellation PowerSource

• Sempra Energy

• Allegheny Energy

• Dominion Energy

Page 36: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

36

Representative US Business SchoolsRepresentative US Business Schools

• University of Chicago, GSB

• University of Pennsylvania, Wharton

• Stanford University

• Cornell University (Johnson)

• Sloan School (MIT)

• Carnegie Mellon University (Tepper)

• Duke University (Fuqua)

• Harvard Business School

• Northwestern University (Kellogg)

• University of Michigan (Ross)

• University of California at Berkeley (Haas)

• NYU (Stern)

Page 37: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

37

Support and Community

Page 38: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

38

Consulting from The MathWorks

� Engineering expertise and deep product knowledge,specializing in:– Application development using MATLAB

– Model-based design using Simulink and Stateflow

– Embedded-system development

– Enterprise-wide integration of MathWorks products intoengineering process and systems

– Jumpstart services

� Project-based services for a growing number ofindustries, including Aerospace and Defense,Automotive, Communications, Power and Marine, andFinancial Services

www.mathworks.com/consulting

Page 39: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

39

� Introductory and intermediate training in MATLAB andApplication Deployment

� Specialized courses in Optimization, Statistics, andinteracting with external applications like Excel.

� Pre-sale (“Try it before you buy it”) or post-sale

� Flexible delivery:

– Our place: Public training worldwide

– Your place: Standard or customized training at yoursite

– Cyberspace: Web-based training• Interactive, instructor-led e-learning

• Train at work or at home, with flexible dates and times

www.mathworks.com/training

Page 40: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

40

MATLAB Central

� 130,000 visits per month

� Over 2,800 files in the exchange

– General-purpose functions,industry- and application-specific tools and examples

– 100 new submissions per month

– 5,000 downloads per day

� 5,000 posts to “CSSM” (comp.soft-sys.matlab) per month,60% routed through MATLAB Central

www.mathworks.com/matlabcentral

File exchange and newsgroup access for MATLAB and

Simulink users

Page 41: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

41

The MathWorks Connections Program

Over 300 add-on products and services from partnersthat complement and extend MathWorks products

– Specialized third-party toolboxes for MATLAB

– Interfaces to partners’ software and hardware products

– Specialized training courses and consulting services

– System integrators and suppliers that incorporateMathWorks products

Page 42: Managing Risk with Extreme Value Theory and Copulas : A … · 2006-05-26 · models using MATLAB and its family of toolboxes and. 7 The Case Study Extreme Value Theory and Copula

42

Further informationFurther information

• Visit MATLAB Central for some

of the tools you’ve seen today

• Trials, onsite demonstrations,technical literature:

http://www.mathworks.com/products/

industry/finance

• Company and productinformation:

www.mathworks.com