Hedging Strategy, Simulation and Backtesting | GTC...

30
Hedging Strategy Simulation and Backtesting with DSLs, GPUs and the Cloud GPU Technology Conference 2013 Aon Benfield Securities, Inc. Annuity Solutions Group (ASG) March 20, 2013

Transcript of Hedging Strategy, Simulation and Backtesting | GTC...

Page 1: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Hedging Strategy Simulation

and Backtesting

with DSLs, GPUs and the Cloud

GPU Technology Conference 2013

Aon Benfield Securities, Inc. Annuity Solutions Group (ASG)

March 20, 2013

Page 2: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

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.

Page 3: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Section 1: Problem Description

Page 4: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 4

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

Page 5: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 5

Hedging Hedging business process (for a single point in time)

– 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

Liability Cashflow

Projection Model

Scenario Generator

MarketQuotes

Liability Risks

Hedging Strategy

Hedging Asset Models

Asset Risks

Net Risks

Legend

GPU Accelerated

Page 6: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 6

Simulation-Based Risk Management

Hedging process is simulated through multiple time-steps and multiple scenarios

(generated scenarios, stress scenarios and historical back-testing scenarios)

Notice: Doubly–nested simulation

EconomicScenarios

Time-SeriesData

Scenario Generator

Hedging Simulation

Results

Liability Cashflow

Projection Model

Scenario Generator

Liability Risks

Hedging Strategy

Hedging Asset Models

Asset Risks

Net Risks

Next time step

“Inner Loop”

“Outer Loop”

Page 7: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 7

Hedging Process in Detail

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

Liability Cashflow

Projection Model

Scenario Generator

MarketQuotes

Page 8: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 8

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

Page 9: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 9

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

Hedging Strategy

Asset Risks

Net Risks

Page 10: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 10

Hedging Process in Detail

Typical hedging instruments used by insurance companies

Equity

Futures

Interest

Rate

Swaps

Variance

Swaps

Vanilla

Options

Hybrid

Options

Lookback

Options

Structured

HedgeReinsurance

Delta

Rho

Vega

Gamma

Vanna

Vol Skew

Correlation

Policyholder

Behavior

Basis Risk

Ris

ksHedging Instruments

Page 11: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 11

Simulation-Based Risk Management

Outer-Loop Economic Scenarios

– Real-World scenarios generated from a

model

– Historical Time-Series (back testing)

– Stress Scenarios

Good simulations require realistic Risk-Neutral

and Real-World models

– Wide tails

– Stochastic volatility, jumps

– Interest rate risk

– Mortality and lapse risk

– Intricate connections between Real-World

and Risk-Neutral models

EconomicScenarios

Scenario Generator

EconomicScenarios

Time-SeriesData

Scenario Generator

...Hedging

Simulation Results

“Outer Loop”

“Inner Loop”

Page 12: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 12

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.

Page 13: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 13

Simulation-Based Risk Management Example Variable Annuity Hedging and Business Plan simulation results

Page 14: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 14

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

Page 15: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 15

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!)

Page 16: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 16

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

Page 17: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Section 2: Description of Solutions

Page 18: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 18

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)

1http://en.wikipedia.org/wiki/Language-oriented_programming

Page 19: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 19

Domain Specific Languages Simple DSL Compiler for GPUs

Parser

AbstractSyntaxTree

Business Logic

Front-End JIT Compiler

LLVM IR

LLVM Optimizer

Back-End JIT Compiler

(NVPTX target)

PTX kernel

CUDA Runtime / Driver

GPU

Legend

Supplied by NVIDIA

Page 20: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 20

Domain Specific Languages Language Parser

– 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

Parser2*(X+Y)

Mul

Int

2

Add

Var Var

X Y

Page 21: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 21

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

Page 22: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 22

Domain Specific Languages Example DSL Application (PathWise Modeling Studio)

Page 23: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 23

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

Page 24: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 24

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

HPC Middleware

ResultsPython Script

Data Store

GPU Cloud

Page 25: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 25

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

Page 26: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 26

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:

63 billion valuations

756 quadrillion random samples (may exceed periodicity of RNG!)

Proposed Solution

– 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

Page 27: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 27

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)

GPU cloud compared to a traditional CPU cluster collocated in a data center achieves an

estimated performance per dollar cost efficiency of 1500x

-

200,000.00

400,000.00

600,000.00

800,000.00

1,000,000.00

1,200,000.00

1,400,000.00

Data Center Colocation EC2 Reserved Instances

Annual Infrastructure Cost 100 GPU Cluster, Quarterly Runs

Page 28: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 28

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)

Page 29: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Section 3: Conclusion

Page 30: Hedging Strategy, Simulation and Backtesting | GTC 2013on-demand.gputechconf.com/gtc/2013/presentations/S...(generated scenarios, stress scenarios and historical back-testing scenarios)

Aon Benfield Securities, Inc. | Annuity Solutions Group

March 20, 2013 30

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