counterparty credit risk (ccr) with matlab production server › content › dam › mathworks ›...
TRANSCRIPT
![Page 1: Counterparty Credit Risk (CCR) with MATLAB Production Server › content › dam › mathworks › ...MATLAB Developer –Goal: Develop and deploy new analytics –Tools: MATLAB, MATLAB](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/1.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/2.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/3.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/4.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/5.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/6.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/7.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/8.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/9.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/10.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/11.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/12.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/13.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/14.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/15.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/16.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/17.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/18.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/19.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022040414/5f180b48ad978d62da20788d/html5/thumbnails/20.jpg)
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