
Financial Modeling on Parallel Computers using High-Level Programming Languages Matthew Dixon1, Jorg Lotze2 and Mohammad Zubair3 1School of Management University of San Francisco Email: [email protected] 2Xcelerit 2832 Upper Pembroke Street Dublin 2, Ireland Email: [email protected] 3Department of Computer Science Old Dominion University Norfolk, VA Thalesians Seminar Introduction Vision Case Study Implementation Next Steps Additional Slides Overview The need for design space exploration in financial modeling and the consequential emergence of the "implementation gap" The vision of how a financial domain specific parallel software framework can address the implementation gap Case study: finding performance critical financial applications: detailed insights from using Python, R and C++ for mid to high frequency stochastic volatility modeling Towards a parallel implementation of Quantlib for the Intel Xeon Phi coprocessor Introduction Vision Case Study Implementation Next Steps Additional Slides Background reference materials M.F. Dixon, A Pattern Oriented Approach for Designing Scalable Analytics Applications, PPoPP'15, San Francisco, 2015. M.F. Dixon, J. Lotze and M. Zubair, A Portable and Fast Stochastic Volatility Model Calibration using Multi and Many-Core Processors, Journal of Concurrency and Computation: Practice and Experience, March 2015. M.F. Dixon, S. Khan and M. Zubair, gpusvcalibration: A R Package for Fast Stochastic Volatility Model Calibration using GPUs, R/Finance, Chicago, 2014. M.F. Dixon and M. Zubair, Calibration of Stochastic Volatility Models on a Multi-Core CPU Cluster, Proceedings of the Workshop on High Performance Computational Finance, SC'13, November, 2013. Introduction Vision Case Study Implementation Next Steps Additional Slides Shi$ to Parallelism 1 Figure: Courtesy of UC Berkeley EECS Parlab Introduction Vision Case Study Implementation Next Steps Additional Slides Variety of Parallel Hardware CPU-GPUCPU-GPU Block Diagram Multi-CoreMulti-Core CPU Block CPU Diagram Thread Execution Control Unit CPU Core 0 CPU Core 1 CPU Core 2 CPU Core 3 CPU Core 0 CPU Core 1 L1/L2 Cache L1/L2 Cache L1/L2 Cache L1/L2 Cache L1/L2 Cache L1/L2 Cache Shared L3 Cache Shared L3 Cache Memory Controller Memory Controller LS LS LS LS LS LS DRAM CPU DRAM DMA GPU DRAM Host CPU GPU Device Compute Cluster Interconnection Network Node 0 Node 1 Node 2 Node3 1 Compute Cluster Block Diagram Figure: Courtesy of UC Berkeley EECS Parlab Introduction Vision Case Study Implementation Next Steps Additional Slides Implementaon Gap 1 Figure: Courtesy of UC Berkeley EECS Parlab Introduction Vision Case Study Implementation Next Steps Additional Slides Implementaon Gap Enables applicaon design space exploraon Prohibits applicaon design space exploraon 1 Introduction Vision Case Study Implementation Next Steps Additional Slides Example: design space exploration in financial modeling There is typically an overwhelming choice of models for a financial instrument, risk factor or derived mathematical variable: Diffusion: Bachelier, Black-Scholes, CEV, Displaced Diffusion, Hull-White Stochastic Volatility: Heston, SABR, Displaced Diffusion Heston, Heston-Hull-White Jump-Diffusion: Merton, Bates, Bates-Hull-White Levy: Variance Gamma, Normal Inverse Gaussian Levy+Stochastic Volatility: Gamma Ornstein-Uhlenbeck and CIR clock Problem: When fitting the model, its parameters can be sensitive to the choice of numerical solver, choice of error measure, and the set of observables => design space exploration is compute intensive Introduction Vision Case Study Implementation Next Steps Additional Slides Research Literature K. Keutzer and T. G. Mattson, Introduction to Design Patterns for Parallel Computing, first article, Chapter 8 E. Gonina and G. Friedland and K. Keutzer, Chapter 8, The Berkeley Par Lab: Progress in the Parallel Computing Landscape, eds. D. Patterson, D. Gannon and M. Wrinn, 2013. PyCASP, E. Gonina and G. Friedland and K. Keutzer, http://www.eecs.berkeley.edu/egonina/pycasp.html Introduction Vision Case Study Implementation Next Steps Additional Slides The Vision of the Research Vision A new software framework shall bridge the implementation gap and enable application quantitative financial developers to productively utilize parallel hardware and develop efficient, scalable, portable applications. This software framework shall Evolve from a pattern-oriented design for defining scope and vocabulary Target critical financial application patterns which are routine computational bottle-necks in financial modeling infrastructure Enable financial developers using C++, Python or R to take advantage of various parallel architectures Introduction Vision Case Study Implementation Next Steps Additional Slides Our Pattern Language (OPL) Our Paern Language Applicaons Structural Paerns Model-View-Controller Computaonal Paerns Graphical-Models Finite-State-Machines Pipe-and-Filter Iterave-Refinement Graph-Algorithms Backtrack-Branch-and-Bound Agent-and-Repository Map-Reduce Dynamic-Programming N-Body-Methods Process-Control Layered-Systems Dense-Linear-Algebra Circuits Event-Based/Implicit- Arbitrary-Stac-Task-Graph Sparse-Linear-Algebra Spectral-Methods Invocaon Unstructured-Grids Monte-Carlo Puppeteer Structured-Grids Parallel Algorithm Strategy Paerns Discrete-Event Task-Parallelism Data-Parallelism Geometric-DecomposiCon Divide and Conquer Pipeline Speculaon Implementaon Strategy Paerns Shared-Queue Distributed-Array SPMD Fork/Join Loop-Parallelism Shared-Map Shared-Data Kernel-Par. Actors Workpile ParCConed graph Vector-Par Program structure Algorithms and Data structure ExecuCon Target Architectures Distributed Memory MIMD GPU SIMD Shared Address Space MIMD Vector SIMD Introduction Vision Case Study Implementation Next Steps Additional Slides Motivation for a Pattern Oriented Design Defines the scope of the software framework Provides a common vocabulary for application developers and efficiency programmers Enables modularity and comprehensive coverage of the application domain Provides a language for describing the software architecture of applications Introduction Vision Case Study Implementation Next Steps Additional Slides Example of Patterns in Financial Applications Applicaon Paerns Computaonal Paerns Dynamic programming Spectral methods Calibraon Characteris'c func'on Binomial Trees Characteris'c func'on Grid Based PDE method Calibraon Derivave Modeling Binomial Trees Sparse linear algebra Dense linear algebra Applicaon Paerns PCA PCA Grid Based PDE method Vector Auto- GARCH (bekk) Regression Factor Modeling GARCH (bekk) Vector Auto- Regression PorEolio Analysis Factor Modeling Structural Patterns MapReduce Iterative Refinement Pipe and Filter Introduction Vision Case Study Implementation Next Steps Additional Slides Tangible outcome of the research Provide a library of financial application patterns which are composed from the computational and structural patterns A single optimized implementation of each computational and structural pattern on each architecture (such as GPUs, Intel Xeon Phi, FPGAs) can be used by multiple application patterns The library can be made available to C++, Python and R users and the application developer needn't concern themselves with the details of the parallel implementation Re-use legacy code without having to migrate prototype modeling code into low level programming environments Introduction Vision Case Study Implementation Next Steps Additional Slides Evidence of the Leverage Effect Daily changes of squared volality indices versus daily returns. Using the volality indices as the proxy of volality, the leverage effect can clearly be seen. Le?: S&P 500 data from January 2004 to December 2007, in which the VIX is used as a proxy of the volality; Right: Dow Jones Industrial Average data from January 2005 to March 2007 in which the Chicago Board Op8ons Exchange (CBOE) DJIA Volality Index (VXD) is used as the volality measure. Source: Yacine Ait-Sahalia, Jianqing Fan and Yingying Li, The leverage effect puzzle: Disentangling sources of bias at high frequency, Journal of Financial Economics 109 (2013): 224–249 Introduction Vision Case Study Implementation Next Steps Additional Slides Implied Volatility Surface Stochas(c Volality Modeling Background Parallel Design 1. Choose a SV model, e.g. Bates Model Definition (Bates Model) dSt 1 = µdt + Vt dWt +(Y 1)St dNt , (1) St − dVt p 2 = (✓ Vt )dt + σ Vt dWt , (2) Vt − p Vt is given by a mean reverting square root process constrained by 2✓ σ2 > 0. − Nt is a standard Poisson process with intensity λ>0 and Y is the log-normal jump size distribution, where σ2 µ = ln(1 + a) j , a > 1 and σ 0. j − 2 − j ≥ 3. Imply the volality 2. Es(mate the European Op(on Price surface from the fiEed Definition (Bates European Option Pricing Model) Call price of a vanilla European option is model prices C(S , K,⌧; p)=S P K exp (r q)⌧ P , 0 0 1 − {− − } 2 4. Trading desks use the P1 and P2 can be expressed as: 1 1 1 exp iulnK φ (S ,⌧,u; p) implied volality surface to P = + Re {− } j 0 du, j =1, 2. j 2 ⇡ iu price non-quoted op(ons Zo and price and hedge exo(cs where the parameter set p := [✓,σ,,⇢, v0,µj ,σj ,λ]. Introduction Vision Case Study Implementation Next Steps Additional Slides Implied Volatility Surface Fundamental building block of derivave modeling Stochas(c Volality Modeling Background Parallel Design 1. Choose a SV model, e.g. Bates Model Definition (Bates Model) dSt 1 = µdt + Vt dWt +(Y 1)St dNt , (1) St − dVt p 2 = (✓ Vt )dt + σ Vt dWt , (2) Vt − p Vt is given by a mean reverting square root
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages66 Page
-
File Size-