Blog on SimianQuant
https://www.simianquant.com/blog/
Recent content in Blog on SimianQuantHugo -- gohugo.ioenWed, 06 Nov 2019 00:00:00 +0000The Importance of Algebraic Simplification
https://www.simianquant.com/blog/albegraicsimplimportance/
Wed, 06 Nov 2019 00:00:00 +0000https://www.simianquant.com/blog/albegraicsimplimportance/Algebraic simplifiers are submodules of the SimianQuant processing pipeline that use isomorphisms of the rules taught in algebra class to reduce expression complexity. They are significantly more powerful than the constant folders and common subexpression eliminators that are a part of modern compilers, and are a major contributor to the performance step achieved by the library. This article illustrates that contribution.
Newcomers to the library often view algebraic simplification as a cute party trick, akin to pedagogic tools like cymath.Conditional Graph Factorization
https://www.simianquant.com/blog/conditionalgraphfactorization/
Wed, 23 Oct 2019 00:00:00 +0000https://www.simianquant.com/blog/conditionalgraphfactorization/Conditional Graph Factorization is a submodule of the SimianQuant code generator that generalizes the concept of calibration. Given a sequence of partitions of the domain, it factorizes the full computational graph into a sequence of subgraphs conditional on the respective partition and the inferred codomain of the previous subgraph. This article illustrates the principle and some applications.
Concretely, given a computational graph $\Bbb G(\Bbb X)$ with its input partitioned into a sequence of $n$ subsets $x_i, i\in {1 \dots n}$, conditional graph factorization generates a sequence of subgraphs $g_i$ such that:Strata Benchmarks #5 - Two Dimensional Interpolation
https://www.simianquant.com/blog/stratabenchinterptwod/
Fri, 11 Oct 2019 00:00:00 +0000https://www.simianquant.com/blog/stratabenchinterptwod/Two dimensional interpolation is a simple and useful approach to model the volatility surface. SimianQuant’s algebraic simplifiers can reduce many classes of two-dimensional interpolators into one dimensional problems. This article compares Strata’s implementation of BiLinear and LinearCubic interpolation against those generated using the SimianQuant library.
This article follows up on the benchmarks for one dimensional interpolation and will reference the results presented there. As in that article, two classes of generated implementations are considered:Strata Benchmarks #4 - One Dimensional Interpolation
https://www.simianquant.com/blog/stratabenchinterponed/
Thu, 10 Oct 2019 00:00:00 +0000https://www.simianquant.com/blog/stratabenchinterponed/One dimensional interpolators are some of the simplest functions implemented by mathematical libraries. This article compares Strata’s implementation of linear and cubic spline interpolation against their equivalents generated using the SimianQuant library.
For an alternate open source reference, benchmarks for implementations provided by Apache Commons Math (ACM) are also included. Two classes of generated implementations are considered:
A Standard Variant, in which the data points are only known at runtime.Strata Benchmarks #3 - SABR Volatility
https://www.simianquant.com/blog/stratabenchsabr/
Mon, 08 Jul 2019 00:00:00 +0000https://www.simianquant.com/blog/stratabenchsabr/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.Strata Benchmarks #2 - Black Scholes
https://www.simianquant.com/blog/stratabenchblack/
Wed, 12 Jun 2019 00:00:00 +0000https://www.simianquant.com/blog/stratabenchblack/The Black formula is arguably the most important function in quantitative finance, and is either used directly (for pricing) or indirectly (for quotation), in most pricing calls. This article presents benchmarks for evaluating the formula.
Four cases of evaluating the formula for the price of a vanilla option:
The Spot Price, i.e. the discounted price The Spot Price and Greeks, i.e. the discounted price and all first order sensitivities The Forward Price, i.Strata Benchmarks #1 - Elementary Functions
https://www.simianquant.com/blog/stratabenchelementary/
Thu, 16 May 2019 00:00:00 +0000https://www.simianquant.com/blog/stratabenchelementary/Elementary functions are those that implement basic mathematical operations like exponentiation and logarithms. Swapping out numerically equivalent elementary operations is a cheap and easy way of improving runtime performance. This article presents benchmarks for three important elementary functions.
These benchmarks are useful for anyone deciding whether to import a library with the complexity of Strata into their project, or use something simpler, better documented and better understood like Apache Commons Math (ACM).Technical Indicators using SimianQuant
https://www.simianquant.com/blog/technicalindicatorbenchmark/
Tue, 14 May 2019 00:00:00 +0000https://www.simianquant.com/blog/technicalindicatorbenchmark/The SimianQuant library provides a Fluent API on top of its symbolic engine to implement functions with feedback. Technical indicators are a classic example of the usage of this pattern. This article presents the results of benchmarking the generated implementations (in C++) of common indicators.
To summarise:
The runtime performance on commodity hardware is in the single/double digit nanosecond range, and comparable with custom hardware The runtime cost of evaluating multiple indicators together is less than the total cost of evaluating them separately.Vectorizing Black Scholes - CPU vs. GPU
https://www.simianquant.com/blog/vectorizingblackscholes/
Mon, 29 Apr 2019 00:00:00 +0000https://www.simianquant.com/blog/vectorizingblackscholes/A data parallel operation is one in which the same function is applied to different inputs. Vectorizing data parallel operations is an important problem with applications in market risk, full portfolio evaluation and numerical schemes. This article compares different approaches for vectorizing the Black Scholes formula for a call option.
Four cases are considered:
Using AVX2 instructions Multi Threading Using AVX2 instructions and multi threading Using GPU computing The four implementations were generated using the SimianQuant library and therefore require equal programmer effort.Graph Compression Applied to Quantitative Finance
https://www.simianquant.com/blog/graphcompressionquantitativefinance/
Tue, 19 Mar 2019 00:00:00 +0000https://www.simianquant.com/blog/graphcompressionquantitativefinance/The sequence of operations that convert input to output can be visualized as a graph. Graph compression is the family name for a suite of SimianQuant algorithms that rewrite the computational graph to reduce the time and/or memory required.
At a conceptual level, they are similar to Common Subexpression Elimination. However, since this is not your grandfather’s compiler, the compression is semantic, i.e. based on the algebraic properties of the graph.Systems Biology using SimianQuant - Comparing with NumPy, SymPy and Octave
https://www.simianquant.com/blog/systembiologysqopensource/
Tue, 12 Mar 2019 00:00:00 +0000https://www.simianquant.com/blog/systembiologysqopensource/The SimianQuant library provides a Fluent API on top of its symbolic engine to model and solve Initial Value Problems. This article demonstrates how it can be used to solve a reference problem in systems biology, the repressilator, and how the SimianQuant approach compares with alternatives like NumPy, SymPy and Octave.
In summary,
For less effort on part of the programmer, the SimianQuant implementations are ~ 200x faster than NumPy, ~ 250x faster than SymPy and ~ 1800x faster than Octave Advanced numerical techniques like sensitivity analysis using algorithmic differentiation, which are tricky and tedious at best in Python, are trivial using the library The Model Following Elowitz’s classic paper, the system consists of six coupled non-linear first order differential equations, three modeling mRNA concentrations, $m_i$, and three modeling repressor protein concentrations $p_i$.Spire Issues - Algorithmic Differentiation
https://www.simianquant.com/blog/spirealgorithmicdifferentiation/
Fri, 08 Mar 2019 00:00:00 +0000https://www.simianquant.com/blog/spirealgorithmicdifferentiation/Spire is a Scala library that implements number types and numeric abstractions. With close to 1500 stars on github (as of writing), it seems to be the library around which the community has coalesced for those applications. However there are issues with the implementation of specific datastructures.
This article focuses on spire’s support for forward mode algorithmic differentiation, i.e. its implementation of Jets. There are three basic problems with the implementation - performance, mutability and numerical errors.Constructive Barriers
https://www.simianquant.com/blog/constructive-barriers/
Sun, 20 Jan 2019 00:00:00 +0000https://www.simianquant.com/blog/constructive-barriers/Conventional approaches to team structure attempt to minimize the barriers within and among teams. The stated hypothesis is that fewer barriers increase the frequency with which ideas are shared, built upon, experimented and dropped, and that this leads to the global optimum. The unstated hypothesis is that the ideas shared would have been thought through and developed in terms of the broader context. This is clearly false, and unless the company institutes some sort of a barrier, it can get lost in a dancing landscape of local optima.