Accelerating Option Risk Analytics in R Using GPUs
7 Pages Posted: 26 Nov 2013 Last revised: 12 Feb 2014
Date Written: November 25, 2013
In this paper we describe our work on speeding up the Heston stochastic volatility model calibration, a financial application, on GPUs. The Heston volatility model is used extensively across the capital markets to price and measure the market risk of exchange traded financial options. When fitted to sub-minute level market mid-price quotes, the model may require frequent calibration every few minutes. The R statistical software package is easy to use and is popular with quantitative analysts in the financial industry. However, a typical R based implementation of the Heston Model calibration on a CPU does not meet the performance requirements for sub-minute level trading, i.e. mid to high frequency trading. The calibration of a Heston model is performed over M option data points which remains fixed during the calibration computation. A typical organization of this computation involves calling an optimization routine with a pointer to ErrorFunction() which estimates the error between market observed and model option prices. We implemented the calibration computation in R and observed that the computation time is dominated by the calculation of the ErrorFunction().
This paper describes the implementation of a GPU optimized kernel for this computation that can be called by the R script performing the calibration process. For M=1024 we demonstrate a factor of 760x improvement in the overall calibration time over the R sequential implementation by off-loading ErrorFunction() on a system with an Intel Core i5 processor and NVIDIA Tesla K20c (Kepler architecture) consisting of 2496 cores. Note that not all the performance gain is due to the GPU – partly it is due to the reduction in the overhead of R for the Heston model calculation. For comparison we also implemented the calibration code using C. We observed a speed up of 230x for the GPU based implementation over the C version indicating that a factor of 3.4x improvement is due to avoiding the R overhead for the Heston Model Calculation. However, the overall calibration time using R based optimization routines combined with the GPU off-loaded ErrorFunction() is comparable to a C GPU based calibration code.
Keywords: Stochastic Volatility, Calibration, R, GPGPU computing
JEL Classification: C61, C63, G12, G13
Suggested Citation: Suggested Citation