Strata Benchmarks #3 - SABR Volatility July 8, 2019 Harshad Deo 3 minutes read Twitter Facebook Reddit LinkedIn Email The Stochastic Alpha, Beta, Rho (SABR) volatility model is a popular approach to model the volatility smile. This article presents benchmarks of implementations of the asymptotic solution of the model for the volatility and volatility adjoint of a vanilla European option. Two cases for the parameter $\beta$ are considered: $\beta = 1$, which is commonly used in foreign exchange markets $\beta = 0.5$, which is commonly used in interest rate markets In each case, the time taken to evaluate the relevant formula provided by Strata’s formula repository was compared with that taken by a numerically equivalent implementation generated using the SimianQuant library. Aside from the time taken by the generated scalar implementations, the amortized time taken by a vectorized implementation was also measured. In practice, the vector case is the one that is the most relevant. To summarize the results, the SimianQuant implementation is upto 115x faster than the equivalent Strata implementation. For exotic options, or cases where simulation is required (e.g. market risk), these numbers are a lower bound on the performance step achievable. All measurements were made on an AWS c5 instance with a clock speed of 3GHz. Volatility The first case considered is the evaluation of the volatility function. Strata’s implementation for $\beta = 1$ is significantly faster than its implementation for $\beta = 0.5$ because it was algebraically simplified by the developers. This is clearly not scalable for all possible (or even common) values of $\beta$. This limitation is not relevant for implementations generated using the SimianQuant library, which is why both have roughly the same performance. Even in the case where algebraic simplification was implemented, the SimianQuant implementation was faster because the library is better at algebraic simplification than humans. The vectorized implementations are predictably faster still. Adjoint The second case considered is the evaluation of the volatility adjoint, essentially the volatility and its first order derivatives. This case is useful for calibration and sensitivity analysis. Here, the benefits of graph compression become obvious, with the SimianQuant implementations taking scarcely more time to evaluate the five additional formulae. Even without vectorization, the time taken by the SimianQuant implementations to evaluate the adjoint is less than that taken by Strata’s implementation to evaluate the volatility. About Strata Strata is an award winning open source analytics and market risk library published by Open Gamma. The company, however, is opaque about its performance and that of its subcomponents. This article is the third in a series that will benchmark the library against open source alternatives and code generated using the SimianQuant library. The source code for the majority of the benchmarks can be found in the companion github repository. Other articles in this series are: Elementary Functions Black Scholes One Dimensional Interpolation Two Dimensional Interpolation Harshad Actually being good is an expensive way to seem to be good.