20
1 © 2013 The MathWorks, Inc. Counterparty Credit Risk (CCR) with MATLAB Production Server Brendan Hannigan and Gabo Lopez-Calva

Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

  • Upload
    others

  • View
    23

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

1 © 2013 The MathWorks, Inc.

Counterparty Credit Risk (CCR) with

MATLAB Production Server

Brendan Hannigan and Gabo Lopez-Calva

Page 2: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

2

Outline

Counterparty Credit Risk (CCR)

Introduction to MATLAB Production Server

Scaling CCR to Enterprise

Summary and Conclusions

Page 3: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

3

CCR Workflow Overview

CCR: Credit-risk assessment of OTC instruments

Credit Valuation Adjustment (CVA): Expected loss

Price Portfolio (each date, each

instrument, each

scenario)

Get Default

Probabilities

Determine

CVA

Compute

Exposures

Simulate Risk

Factors

Page 4: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

4

CCR Example in MATLAB

Goal: Compute exposure profiles & CVA for each

counterparty

Page 5: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

5

CCR Example

Simulation

– Hull-White 1-factor model

– 1,000 scenarios

– 1 year monthly, 6 more years quarterly

Pricing

Default Prob CVA

Exposures Simulation

Page 6: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

6

CCR Example

Pricing

– IR Swap Portfolio

– 5 Counterparties

– Netting Agreements

Pricing

Default Prob CVA

Exposures Simulation

Instruments

D

a

t

e

s

Page 7: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

7

CCR Example

Exposure

– EE, PFE, EPE, etc.

– Exposure contributions,

counterparty and instrument

level

Pricing

Default Prob CVA

Exposures Simulation

Page 8: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

8

CCR Example

CVA

– Default probability calibrated to CDS spreads

– CVA calculation

Pricing

Default Prob CVA

Exposures Simulation

Simulation Time

Default Probability Density

Simulation Time

Discounted Exposure

𝐶𝑉𝐴 = (1 − 𝑅) 𝐷𝑖𝑠𝑐𝐸𝑥𝑝 𝑡 𝑑𝑃𝐷(𝑡)𝑇

0

Page 9: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

9

Enterprise Challenges

Accessing large data

Responding to new requirements

Maintaining software version

Supporting multiple use cases

Page 10: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

10

Potential Solutions

Page 11: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

11

Ideal Solution

Small data transfers

– Server and database collocated

Flexible analytics

Centralized analytics

Multiple interfaces

Scalable

Page 12: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

12

What is MATLAB Production Server?

Enterprise framework for running packaged MATLAB programs

Server software

– Manages packaged MATLAB programs & worker pool

Runtime libraries

– MATLAB Compiler Runtime (MCR)

Lightweight client library (.NET & Java)

– Request MATLAB programs (functions)

.NET

MATLAB Production Server

Request

Broker

&

Program

Manager

Page 13: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

13

Counterparty Risk & MATLAB Production Server

Web

Server

Application

Server

Database Server

Pricing

Risk

Analytics

Scenario

Generation

MATLAB Production Server

MATLAB

Compiler

Web Applications

(Risk Manager)

Desktop Applications

(Trader)

Batch Applications

(Overnight Simulations)

Page 14: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

14

Use Case: Risk Manager

Goal: Monitor exposure profiles and CVA for each

counterparty

Web front end

Page 15: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

15

Risk Manager: Architecture

Architecture

Other risk management use cases:

– CVA sensitivity analysis

– Different simulation models / calibration methods

– What-if scenarios, stress scenarios

Web

Server

MATLAB Production Server

Request

Broker

&

Program

Manager

Database Server

Page 16: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

16

Use Case: Trader

Spreadsheet front end

Analyze a new trade

– Compute CVA

Up front charge

Running spread

– Compute new exposures

Page 17: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

17

Trader: Architecture

VB to the .NET client library

Adds trade to portfolio

New exposures & CVA

Small data transfer

Page 18: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

18

Use Case: The Developers

MATLAB Developer

– Goal: Develop and deploy new analytics

– Tools: MATLAB, MATLAB Compiler

Java / .NET Developer

– Goal: Build interfaces for new analytics

– Tools: Java, .NET, Excel, …

System Administrators

– Goal: Support software installation and maintenance

– Tools: MATLAB Production Server, other software

Page 19: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

19

Algorithm

Use Case: The Developers

MATLAB

Developer

Production

MATLAB Production Server

MATLAB Production Server

CTF CTF

Application

Development

Production

Application

Client

Library

.NET or JAVA

Developer

MATLAB

Compiler

System

Administrator CTF

CTF

Client

Library

Page 20: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB

20

Summary

Counterparty credit risk is a big problem

– Large data

– Lots of users

– Changing landscape

MATLAB is a great development environment

End-to-end workflow support

– Research & develop analytics in MATLAB

– Enterprise deployment with MATLAB Production Server