Building, Scaling, and Implementing Risk Model and Stress Test Frameworks By Bet Herrera Sucarrat, PhD Application Engineer MathWorks

Size: px
Start display at page:

Download "Building, Scaling, and Implementing Risk Model and Stress Test Frameworks By Bet Herrera Sucarrat, PhD Application Engineer MathWorks"

Transcription

1 Building, Scaling, and Implementing Risk Model and Stress Test Frameworks By Bet Herrera Sucarrat, PhD Application Engineer MathWorks 2016 The MathWorks, Inc. 1

2 Risk Communities: Manage Risk Banks Solvency II AIFMD EBA/CCAR EMIR Basel III IFRS 13 MIFID II Brokers AIFMs Custodians/ Fund Admin Insurance Asset Managers Wealth Management = Direct = Indirect 2

3 Stress Testing Calendar REGION CB delivers stress & method Banks to deliver stress plans Stress Results delivered Results Published by CB Euro Region February 2016 Q Q USA (CCAR) Nov Apr Apr 2016 First year plans and results are combined UK End Jun st Dec 2016 CCAR submission in spring dominates Quant time. There is a workflow involved. You have to go through portfolios, apply scenarios,.. but there is a lot needed to improve this process. 3

4 Model Interdependence 4

5 Organizational Interdependence Supervisors Scenario Providers Strategy / Exec Finance Group Treasury (Internal or External) ALM Group Risk Stress Testing Team Market Risk Operational Risk Credit Risk Liquidity Risk Wholesale Retail FICC Consultancies Equities 5

6 Challenges Business Challenges Many regulators Short Seasonal Cycles Multiple Teams Transparency Reproducibility Supervisor requests Technical Challenges Data Aggregation and alignment Scenarios and Models Model Management Validation and Verification Aggregation Reporting and Access Excel 6

7 Potential Solutions Business Challenges Many regulators Short Seasonal Cycles Multiple Teams Transparency Reproducibility Supervisor requests Technical Challenges Data Aggregation Scenarios and Models Model Management Validation and Verification Aggregation Reporting and Access Excel MATLAB Philosophy Single Stack; Easily Repurposed Rapid Development with Formal Methods Common and Bespoke Interfaces to Stack Readable, documented code Encapsulation and Objects, documented code & scripts Clear Process. Trusted numerics by industry MATLAB Capabilities Database, Tables, Reading from Multiple Formats and Feeds Proven pre-built tools, Build-Your-Own; Objects Object Oriented Programming Debugging Statistical Aggregation, Database Report Generator, Interactive Analysis in Spreadsheets, apps Web, Databases Managed Excel add-ins 7

8 Model-Centered Research and Production Process Our Macro Stress Testing Example PROTOTYPING, MODELLING & ANALYSIS Risk Modeller; Quant; Analyst APPLICATION DEVELOPMENT Developer (ENTERPRISE) IMPLEMENTATION CRO; Risk Manager; Analyst TESTING: VALIDATION AND VERIFICATION 8

9 Example: Stress test value portfolio of bonds We want to forecast value of portfolio of bonds under distressed scenarios We need: A model of the yield curve A way to generate scenarios A way to apply scenarios from regulators A way to document results and save data 9

10 Enterprise implementation 10

11 Give access to the models to more people Excel add-ins Desktop Royalty-free Encryption to protect intellectual property MATLAB Production Server(s) Web Server(s) Web & Enterprise 11

12 Scale up with MATLAB Production Server Most efficient path for creating enterprise applications Deploy MATLAB programs into production Manage multiple MATLAB programs and versions Update programs without server restarts Reliably service large numbers of concurrent requests Integrate with web, database, and application servers MATLAB Production Server(s) HTML XML Java Script The example seen uses RESTful API for the request-response relationship with the server. JSON to represent MATLAB data types. Client code is written JavaScript and embedded in HTML pages. Web Server(s) 12

13 Stress Test Example: Macroeconomic Modelling Diebold et al proposed a yield curve model with macro factors that tries to describe an economy We implement this for the Modelling the US Economy demo Vector Autoregressive Model Use Econometrics Toolbox Load and transform the data Partition to support backtesting Fit the models to the data Decide best model Make forecasts 13

14 Process: Yield Curve Modelling Diebold et al Model the yield curve following Nelson Siegel (1987) Diebold & Li (2002) showed that the yield curve could be interpreted in a dynamic fashion with time varying constants Level, Slope and Curvature 14

15 MATLAB is Developer Friendly 15

16 Application development Use OO features to Hide low level implementation by model developer so that framework is easy to use by non experts Save objects with data, description, model used and results for reproducibility Use parallel computing to speed up the process Use deployment products to give easy access to the tools developed by other teams Use automatically report generator functionality to document diagnostics, test results and model outputs 16

17 Apply models to more data Prototype Access Explore Share/Deploy Scale Work on the desktop MATLAB Parallel Computing Toolbox Scale capacity as needed MATLAB Distributed Computing Server (MDCS) 17

18 Results Business Challenges Many regulators Short Seasonal Cycles Multiple Teams Transparency Reproducibility Supervisor requests Technical Challenges Data Aggregation Scenarios and Models Model Management Validation and Verification Aggregation Reporting and Access Excel MATLAB Philosophy Single Stack; Easily Repurposed Rapid Development with Formal Methods Common and Bespoke Interfaces to Stack Readable, documented code Encapsulation and Objects, documented code & scripts Clear Process. Trusted numerics by industry MATLAB Capabilities Database, Tables, Reading from Multiple Formats and Feeds Proven pre-built tools, Build-Your-Own; Objects Object Oriented Programming Debugging Statistical Aggregation, Database Report Generator, Interactive Analysis in Spreadsheets, apps Web, Databases Managed Excel add-ins 18

19 Q&A? 19