Quantile Mechanics II: Changes of Variables in Monte Carlo Methods and GPU-Optimized Normal Quantiles

31 Pages Posted: 7 Dec 2011

See all articles by William Thornton Shaw

William Thornton Shaw

University College London

Thomas Luu

University College London

Nick Brickman

affiliation not provided to SSRN

Date Written: December 7, 2011

Abstract

With financial modelling requiring a better understanding of model risk, it is helpful to be able to vary assumptions about underlying probability distributions in an efficient manner, preferably without the noise induced by resampling distributions managed by Monte Carlo methods. This article presents differential equations and solution methods for the functions of the form Q(x) = F-1(G(x)), where F and G are cumulative distribution functions. Such functions allow the direct recycling of Monte Carlo samples from one distribution into samples from another. The method may be developed analytically for certain special cases, and illuminate the idea that it is a more precise form of the traditional Cornish-Fisher expansion. In this manner the model risk of distributional risk may be assessed free of the Monte Carlo noise associated with resampling. The method may also be regarded as providing both analytical and numerical bases for doing more precise Cornish-Fisher transformations. Examples are given of equations for converting normal samples to Student t, and converting exponential to hyperbolic, variance gamma and normal. In the case of the normal distribution, the change of variables employed allows the sampling to take place to good accuracy based on a single rational approximation over a very wide range of the sample space. The avoidance of any branching statement is of use in optimal GPU computations as it avoids the effect of warp divergence, and we give examples of branch-free normal quantiles that offer performance improvements in a GPU environment, while retaining the best precision characteristics of well-known methods. We also offer models based on a low-probability of warp divergence. Comparisons of new and old forms are made on the Nvidia Quadro 4000, GTX 285 and 480, and Tesla C2050 GPUs. We argue that in single-precision mode, the change-of-variables approach offers performance competitive with the fastest existing scheme while substantially improving precision, and that in double-precision mode, this approach offers the most GPU-optimal Gaussian quantile yet, and without compromise on precision for Monte Carlo applications, working twice as fast as the CUDA 4 library function with increased precision.

Keywords: CUDA, Monte Carlo, student, hyperbolic, variance gamma, computational finance, quantile mechanics, normal quantile, Gaussian quantile, GPU, Acklam, AS241, inverse error function, erfinv, inverse CDF, probit

JEL Classification: C15, C63, G12, G13

Suggested Citation

Shaw, William Thornton and Luu, Thomas and Brickman, Nick, Quantile Mechanics II: Changes of Variables in Monte Carlo Methods and GPU-Optimized Normal Quantiles (December 7, 2011). Available at SSRN: https://ssrn.com/abstract=1969331 or http://dx.doi.org/10.2139/ssrn.1969331

William Thornton Shaw (Contact Author)

University College London ( email )

Departments of Mathematics and Computer Science
Gower Street
London, WC1E 6BT
United Kingdom

Thomas Luu

University College London ( email )

Gower Street
London, WC1E 6BT
United Kingdom

Nick Brickman

affiliation not provided to SSRN ( email )

Do you have a job opening that you would like to promote on SSRN?

Paper statistics

Downloads
129
Abstract Views
1,281
Rank
406,286
PlumX Metrics