Hedging Strategy Simulation and Backtesting with DSLs, GPUs and the Cloud GPU Technology Conference 2013 Aon Benfield Securities, Inc. Annuity Solutions Group (ASG)
This document is the confidential property of Aon Benfield Securities, Inc. ( Aon ), has been prepared by Aon for informational purposes only and is intended only for the designated recipient. As a condition to reviewing this document, the recipient agrees that without the prior written consent of Aon, which may be withheld for any reason, the recipient will not copy the document or any of its contents, and will not disclose or disseminate the document or any of its contents to (i) any third party, or (ii) any person within recipient s organization who does not have a need to know in connection with the express business purpose for which the document is being provided to recipient. If the recipient is legally compelled to disclose this document or any of its contents, it will promptly give notice to Aon and will reasonably cooperate with Aon in any attempts by Aon to obtain a protective order or otherwise limit disclosure. Upon request by Aon, the recipient will promptly return or destroy the document and any copies it has made with Aon s consent (as described above), provided that recipient may maintain, in strict confidentiality, such copy or copies as required by law or regulation. Aon makes no representation of any kind as to the suitability of the products or services described in this document for any entity in any jurisdiction. The recipient is advised to undertake its own review of the legal, regulatory, tax, accounting and actuarial implications of the products and services described in this document, as Aon does not provide legal, regulatory, tax, accounting or actuarial opinions. This document should not be considered an offer to sell or a solicitation of any agreement to purchase any security. All securities advice, products or services are offered solely through Aon Benfield Securities, Inc. or an appropriately licensed affiliate.
Section 1: Problem Description
Context Equity-Based Insurance Guarantees Investment Guarantees embedded in Life Insurance contracts Modeled as complex, long-term derivatives contracts Examples Variable Annuities, Equity-Indexed Annuities Risk Management and Hedging These derivatives create market risks for insurers, e.g. Equity market risk Interest Rate risk Volatility risk Systematic risk accretes as the insurer sells more product Risk therefore needs to be transferred or hedged 4
Hedging Hedging business process (for a single point in time) Market Quotes Scenario Generator Liability Cashflow Projection Model Hedging Asset Models Liability Risks Asset Risks Hedging Strategy Net Risks Legend GPU Accelerated Market quotes used to calibrate the Market Model (Economic Scenario Generator) Market Model used to value assets and liabilities Monte Carlo simulation offloaded to GPU grid for near real-time risk analytics Hedging Strategy rebalances asset positions to reduce (or eliminate) net risk 5
Simulation-Based Risk Management Outer Loop Time-Series Data Scenario Generator Economic Scenarios Scenario Generator Liability Cashflow Projection Model Hedging Asset Models Liability Risks Asset Risks Hedging Strategy Net Risks Hedging Simulation Results Next time step Inner Loop Hedging process is simulated through multiple time-steps and multiple scenarios (generated scenarios, stress scenarios and historical back-testing scenarios) Notice: Doubly nested simulation 6
Hedging Process in Detail Market Quotes Scenario Generator Liability Cashflow Projection Model Scenario Generation (inner-loop) This typically refers to Risk-Neutral scenarios (calibrated to Market Quotes) There are many different modeling choices and assumptions Stochastic Equity (Geometric Brownian Motion, Jump Diffusion, etc) Stochastic Interest Rates (Hull-White, LIBOR Market Model, etc) Stochastic Volatility (Heston, SABR, etc) Could also refer to Real-World scenarios in the context of regulatory capital requirements 7
Hedging Process in Detail Liability Cashflow Projection Model Model of complex insurance guarantee payoffs Practical approach is to use Monte Carlo method Insurance company may have dozens of different models for different products Liability Risks Risk-Neutral Fair Market Value (Economic Risk) Sensitivities (Greeks) Delta, Rho, Vega, etc Capital (Balance Sheet Risk) Tail measures (similar to VaR) are used by the insurance industry to set regulatory capital requirements 8
Hedging Process in Detail Hedging Strategy Goal of hedging is for Asset and Liability Risks to be offsetting Many different possible strategies and hedging instruments Dynamic Hedging Continuous rebalancing of assets to match liabilities Many different possible rebalancing rules Static Hedging Long-term, structured hedges Often structured as reinsurance deals Semi-Static Hedging Some combination of the two Liability Risks Asset Risks Hedging Strategy Net Risks 9
Risks Hedging Process in Detail Typical hedging instruments used by insurance companies Equity Futures Interest Rate Swaps Variance Swaps Hedging Instruments Vanilla Options Hybrid Options Lookback Options Structured Hedge Reinsurance Delta Rho Vega Gamma Vanna Vol Skew Correlation Policyholder Behavior Basis Risk 10
Simulation-Based Risk Management Outer-Loop Economic Scenarios Real-World scenarios generated from a model Outer Loop Historical Time-Series (back testing) Stress Scenarios Time-Series Data Good simulations require realistic Risk-Neutral and Real-World models Economic Scenarios Scenario Generator Economic Scenarios... Hedging Simulation Results Wide tails Scenario Generator Stochastic volatility, jumps Inner Loop Interest rate risk Mortality and lapse risk Intricate connections between Real-World and Risk-Neutral models 11
Simulation-Based Risk Management Rationale The ability to understand, measure, and weigh risk is at the heart of modern life 1 Hedging is a risky business Riddled with choices many different, market models (scenario generators), hedging instruments, hedging strategies, assumptions and parameters Sensitivity to decisions and assumptions should be studied and documented Should insist on comprehensive historical and simulation studies of hedging strategy Simulation-based risk assessments are increasingly part of regulatory requirements for financial institutions 1 Bernstein, Peter L. 1996. Against the Gods: The Remarkable Story of Risk. New York: John Wiley and Sons. 12
Simulation-Based Risk Management Example Variable Annuity Hedging and Business Plan simulation results 13
Simulation-Based Risk Management Computational Challenges Realistic modeling Many different complex mathematical models must be implemented by Subject Matter Experts Models must frequently change as businesses and markets evolve Numerical stability Sufficient number of Monte Carlo samples Sufficient number of simulation time-steps Double precision versus single precision Computational Steering Implementing this logic in a maintainable and efficient manner is a major Software Design problem in itself 14
Simulation-Based Risk Management Nested Simulation Problem Simulating hedging leads to a Doubly-Nested Simulation problem Also called Stochastic-on-Stochastic (SoS) simulation Example SoS problem: 500 policies 1000 Risk-Neutral (inner-loop) scenarios, 1200 Risk-Neutral (inner-loop) time-steps 5000 Real-World (outer-loop) scenarios, 1200 Risk-Neutral (outer-loop) time-steps 10 risk factors (sources of randomness) 10 Greeks ( two-sided sensitivities, i.e. 21 re-valuations ) Result 63 billion valuations 756 quadrillion random samples (may exceed periodicity of RNG!) 15
Simulation-Based Risk Management Computational Challenges Reliability Business-critical process must not fail SoS is often part of critical processes such as quarter-end financial reporting Grid processing required prone to random failures Huge computational load, requires very large number of parallel processors, continuously running for multiple days More servers and longer run-time increases probability of hardware faults Therefore, solution must be highly fault-tolerant at the software level 16
Section 2: Description of Solutions
Solutions Computational Challenges in Hedging Simulations Realistic modeling Numerical stability Reliability Proposed Solution Language-Oriented Programming Rather than solving problems in general-purpose programming languages, the programmer creates one or more domain-specific languages for the problem first, and solves the problem in those languages 1 DSLs are an old idea. We propose that they are an excellent fit for GPU programming for data parallel applications in specialized domains (e.g. financial Monte Carlo) 1 http://en.wikipedia.org/wiki/language-oriented_programming 18
Domain Specific Languages Simple DSL Compiler for GPUs Business Logic LLVM IR CUDA Runtime / Driver Parser LLVM Optimizer GPU Abstract Syntax Tree Back-End JIT Compiler (NVPTX target) Legend Front-End JIT Compiler PTX kernel Supplied by NVIDIA 19
Domain Specific Languages Language Parser Mul Int Add 2*(X+Y) Parser Var Var 2 X Y By constraining application to a specific domain, it is relatively simple to define a small formal grammar and parser for a Domain Specific Language Implementation Steps Define a Context-Free, Right-Recursive Grammar in Backus-Naur Form (BNF) Use the BNF grammar rules to Use a parser generator (e.g. ANTLR, or Lex/Yacc/Bison), or Hand-code a recursive descent parser Parser outputs an Abstract Syntax Tree (AST) in the host language 20
Domain Specific Languages Front-End Compiler Using LLVM Compiler Infrastructure simplifies compiler construction User must print Abstract Syntax Tree to LLVM IR (Intermediate Representation) and existing Compiler Infrastructure will take care of the rest Back-End Compiler NVIDIA provides CUDA Compiler SDK for handling this part of the tool-chain 21
Domain Specific Languages Example DSL Application (PathWise Modeling Studio) 22
Domain Specific Languages Benefits Productivity Business Logic can be implemented by Subject Matter Experts (SMEs), without requiring programming expertise Programming experts can develop and improve software infrastructure without requiring subject matter expertise One SME can implement a Monte Carlo model in 1 week (versus 6-12 months if directly using general-purpose language, GPUs, grid middleware, and cloud APIs) Models implemented in the DSL can be automatically targeted to execute on GPU hardware, grid middleware and cloud infrastructure Massive performance gains are essentially free for the DSL user Auditing and debugging Auditors and SMEs can easily validate and debug business logic, without being exposed to programming complexities 23
Solutions Computational Challenges in Hedging Simulations Computational Steering Implementing this logic in a maintainable and efficient manner is a major Software Design problem in itself Proposed Solution General-Purpose High Level Scripting Data Store Python Script Results GPU Cloud HPC Middleware 24
Computational Steering Benefits Python High-level, interactive scripting languages (such as Python) have well documented productivity benefits for users Large number of scientific computing tools available out-of-the-box (e.g. numerical arrays, plotting, etc) Libraries and APIs allow vast majority of computations to be off-loaded to underlying C function calls Providing necessary APIs to integrate seamlessly with DSL models and data Grid / Cloud Middleware API Data storage API Large Scale Optimization library Bloomberg Open API 25
Solutions Computational Challenges in Hedging Simulations Nested Simulation Problem Simulating hedging leads to a Doubly-Nested Simulation problem Also called Stochastic-on-Stochastic (SoS) simulation Example SoS problem: Proposed Solution 63 billion valuations 756 quadrillion random samples (may exceed periodicity of RNG!) Accelerate simulations using GPU processors 35-500x observed gains in Monte Carlo throughput (vs quad-core x86 CPU) Distribute computations on GPU clusters Linearly scale up to 100s of GPUs Burst peak computational demands onto elastic cloud 26
GPU Cloud Computing Benefits Amazon EC2 offers Cluster GPU Reserved Instances and 10GigE interconnects Highly economical when provisioning large clusters for short periods of time Example: Quarterly Stochastic-on-Stochastic reporting (1 run per quarterly, 100 GPUs) 1,400,000.00 1,200,000.00 1,000,000.00 800,000.00 600,000.00 400,000.00 200,000.00 Annual Infrastructure Cost 100 GPU Cluster, Quarterly Runs - Data Center Colocation EC2 Reserved Instances GPU cloud compared to a traditional CPU cluster collocated in a data center achieves an estimated performance per dollar cost efficiency of 1500x 27
GPU Cloud Computing Cloud Computing Challenges Performance Cloud GPUs do not behave in the same way as bare-metal GPUs Para-virtualization technology used in by cloud providers leads to significant overheads, especially in CPU-GPU synchronization critical sections of code Our initial attempts to run our models on Amazon s GPU cloud led to a 200% performance loss Optimizations to our DSL compiler and runtime allowed us to reduce this overhead to 10-20% Integration DSL runtime and middleware had to be modified to integrate with cloud API Stability Fault-tolerance has to be built into application in order to effectively use the cloud (especially if utilizing spot instances) 28
Section 3: Conclusion
Conclusion Simulation-Based Risk Management An important risk management tool (hedging simulation and backtesting) However commonly avoided in practice due to computational challenges Subject Matter Experts must implement complex models Doubly-nested simulation Huge amount of calculations required Highly complex orchestration required New technologies are enabling practical, Simulation-Based Risk Management Domain Specific Languages High-level languages for Subject Matter Experts Automatically target low-level hardware and massive parallelism High-Level Scripting Languages Productive environments for computational steering of large simulations on distributed systems GPUs and Cloud Computing Massive increases in throughput per dollar for Monte Carlo simulation 30