Computational Finance

Here is my opinion on the computational finance industry.

I have been working in computational finance for over 15 years. I have seen many programming languages, platforms, good solutions and bad solutions to various problems (and a lot of outright junk) over the years in various places: US, UK, and Germany. The most intriguing pattern I have found over many years was that C/C++ and Matlab afficionados and sometimes SAS, S, SPSS, and R programmers stubbornly claim that Mathematica was "slow". They never substantiated their claims. They just made their bold statements, and when I asked for substance they ran away.

Before version 4.2 of Mathematica, which came out in spring/summer 2002, I would have agreed, that Matlab was faster on strictly numerical computations. But, 4.2, and the "numerics release" of 5.0, which came out in spring 2003, have changed the rules. A thorough redesign of the numerics functions in the kernel gave Mathematica the lead, and Matlab has not been able to keep up with it. And we are just talking about numerical speed here, we will completely ignore all the other features that Matlab is missing, such as infinite precision computing, built-in precision and stability control, an independence of machine numbers, and, of course, we won't hold against Matlab that it never had the features it was never designed for: symbolic computing, high quality graphics, and interactivity. No, we'll just keep it with raw math speed for numerical computing.

A few times I was actually able to get a C/C++/Matlab/SAS/S/SPSS/R afficionado to listen and to give me the chance to prove them wrong. When I showed them that with Mathematica the computation was faster, had more correct digits, or was simply more stable (and the trajectory didn't diverge to nirvana), they were stunned and admitted "I didn't know that Mathematica could do that". But now the real problem began for me. They hated me even more. It reminded me of a quote from Bill Gates: "There will always be people that have problems with the success of others".

Let's face it, people don't like it when they are proved wrong. Maybe this is just human nature of people that are not scientists. A scientist is more interested in the item he/she studies, no matter, who would benefit from the development of a better solution. He/she constantly wants to improve things, and a true scientist can appreciate if someone else has a better solution. Then this scientist is very eager to learn the better solution, so he/she can adopt it, instead of fighting the other person. Not so with senior (managing and non-managing) people in traditional finance companies. They are not interested that much in the subject matter, they see things completely from a tactical viewpoint, so the person with a better solution is now seen as someone somewhere in the "competitor-roadblock-enemy" spectrum. Don't get me wrong, I am all in favor of competition, but there is a big difference between friendly competition and hostile underhandedness. Friendly competition is the very foundation of the free-market economy. Hostile underhandedness is the reality in computational finance.

A senior manager in computational finance is VERY reluctant to see innovation materialize, if this results in his codes getting replaced with codes from someone else that outperform his codes. In my experience the degree of reluctance, our outright fear of innovation, can be measured with the extent of the silliness of the replies. "I've used this code before at a previous employer" (yeah, so now you are probably also doing something illegal, bringing proprietary code from a previous employer here), "Binomial trees are used all over the world" (yeah, but not by practitioners that know what they are doing, binomial trees are only useful in undergrad math programs to EXPLAIN something), "It's in C++, so it's really fast" (yeah, but bad numbers. How can speed fix wrong math?), "If it's not precise enough, we'll just use more steps in the tree" (really? the computation time grows exponentially with the number of steps, and you never can converge fast enough with a binomial tree). When people tell me that binomial trees are state-of-the-art or are "the way to go" because everyone else is using them or are better than trinomial trees because they are simpler, they already tell me they don't understand the math of the grid method-based option pricing theory, or they have to prevent at all cost that the problems they have implemented come to the surface.

I have seen personally in the code that a major US-based online brokerage uses binomial trees with a mere 42 steps (!!!) for option pricing, both on their proprietary side as well as on the customer side (the trading application they give to their customers). A binomial tree with 42 steps is trash, downright junk! When I mentioned it, I was told that a larger number of steps was used before, but that it slowed down the overall trading system, so was cut back to 42 steps again. Wow. So we value speed over quality, although we need sub-penny precision, and our errors are several cents big. Maybe I am being a bit unfair here, because I noticed pretty quickly that all "innovation" talk at that company was just about fake. Can I really *expect* a professional reply in a fake environment? Maybe I had some "expectation misalignment" here.

Matlab is used about 3 times more frequently world-wide, and in computational finance this ratio is even worse, about 5 times more frequently. This ratio has been fairly stable over the past couple of years. Ever since 4.2, but certainly since 5.0, Mathematica's numerics and statistics functions beat those of Matlab, SAS, S, SPSS, R, but people are very slow to adopt. I can understand a little bit of hesitancy (after all, one has to learn another programming language), but major performance improvements are not reason enough to step up? The fight among the high-frequency traders is so fierce that they spend *any* amount of money to get even the smallest edge. The large market makers all over the planet that participate in high-frequency trading are spending *billions* in computer and network infrastructure systems to get a *tiny* improvement in their latency: milliseconds, microseconds, nanoseconds, ... but they don't care if their option pricing is slow or has big errors. Transacting fast with bad prices is more important than quality pricing. You should really have both: precision AND speed!

It's THAT type of senior management incompetence in finance companies that has caused the melt-down of the financial systems of all developed nations a few years ago. The societies of many nations had to pay billions because finance managers were allowed to advance due to their incompetence, falsehood, and maliciousness. The low use of Mathematica in computational finance is just one piece of evidence for this.

Now we see the next round of Mathematica feature upgrades. Version 8 was released today, and among several other things, just to mention a few that are of interest to me, are C code export, Mathematica-to-C-code conversion, symbolic CUDA support, and further improved statistics functions. Symbolic CUDA means that one can write top-level Mathematica code, just a couple of lines of Mathematica code, and it generates the CUDA code that can now run on as many GPUs as the NVidia hardware supports (modern NVidia cards have 512 - 1024 GPUs!). This degree of parallelization is *massive*, to say the least. 4 - 8 cores is state-of-the-art today, now consider that instead of 8 cores/CPUs you can have 512 - 1024 GPUs. Of course, a GPU can do much fewer things than a CPU/core, but with clever programming on the pipeline structure and proper memory usage it's possible to parallelize many problems and make them amenable for CUDA or OpenCL. Given that there are natural limits as to how many cores/CPUs can be put on a chip (thermal problems on today's die size, but not only), it makes sense to look into GPU parallelization. Next, consider the cost of a modern NVidia graphics card -- much less than a CPU/motherboard combination with just 8 cores/CPUs, and "pluggable": you just buy the graphics card and insert it and bingo. You can even buy two for the price of a new computer system and use them in SLI configuration and don't even have to trash your old system, you upgraded in a very "pluggable" manner. Next, consider payroll. It takes a very senior C++/CUDA programmer three months to write high-performing CUDA code for options pricing. The new symbolic CUDA functions in Mathematica version 8 let you write top-level code in Mathematica to auto-generate the CUDA code for you. I know how huge IT budgets have been for the past ten years in various industries, not just in the market-making and hedge fund business. They are GARGANTUAN, sometimes reaching billions of dollars, for computer hardware, networking technology, and payroll. Sometimes you just need a few lines of top-level code to auto-generate the low-level code for you, but then nobody would want to admit that, because a) it would be better than what you did in the past, which you cannot admit without looking like a donkey, and b) people like to be in charge of big budgets and huge programmer fleets. It's important for them to be able to write in the resume "oversaw x million IT budget with y programmers". The business owners of proprietary firms and shareholders of publicly traded firms don't understand enough of the technical details to question it, so will gladly approve anything requested, no matter how silly. The requestors will babble along the lines of "... have to keep up with the competition and extend our cutting edge technology ..." and get their IT budgets approved.

We will see how fast the traditional Matlab/SAS/S/SPSS/C/C++ shops will step up to the new Mathematica features released today. For me, it has become another measure of innovation: how fast are you able to change and embrace the improvement of the innovation, once you have become aware of it. Are you innovative, or are you traditional? Do you put performance first, or do you put career first? Do you make a career by being a stifling roadblock to innovation, or is it a corporate culture where career is TIED to innovation?

Copyright 2010 Andreas Lauschke Consulting. All Rights Reserved.