Show HN: A high-performance TensorFlow library for quantitative finance
github.com
github.com
Backtesting a regular single symbol model on CPU is often not cheap, especially at higher frequencies. Now multiply that by 50 correlated instruments, each having say, 1500-3000 strikes+sides+expiries in their respective option markets, and the value of GPU offload should become obvious. Backtesting dispersion trades on the S&P 500 using just 5 strikes per underlying, or any other scenario where the evolution of the volatility surface is important would already potentially involve >25,000 individual option markets
All professionals backtest, often numerous times per day
I worked as a model quant for a year a couple of years ago in a bank in the team responsible for developing and implementing the derivatives pricing models. Everything was written in (a lot of) C++, but I suspected and still suspect that you could get the same performance by leveraging one of the off-the-shelf deep learning libraries with a lot less code. Maybe you would have to write a few central components in C++ and assembly to get the exact same performance. I am glad to see someone actually following through on that idea.
Yes.
Counterparty credit risk calculations are done as Monte Carlo simulations far into the future and on multiple scenarios on top of the baseline. It easily grows to 10^8 times of the number of valuations in the baseline scenario at present time (which itself can be millions of positions).
But this can just as easily be done in Pytorch right? Yes we can't have GPU's there but having your model train 50% slower (exaggeration) is better than having to spend 150% of the time taken in Pytorch to debug anything in TensorFlow.
I may be beating a dead horse here, but why doesn't google just accept that TensorFlow needs to be redesigned for more ease of use?
Can anyone point out the benefits of TensorFlow over Pytorch (besides TPU's) ? It's been a few years since I've used TF and I may have missed something.
However, I don’t think the Pytorch ecosystem really matches tensorflow yet for production, with TFX and all the other nice-to-haves that google and others have open sourced.
As someone who spends a lot of their time doing POCs and research work, I strongly prefer Pytorch. But I have colleagues who mainly productionize language models, and they all seem to like Tensorflow. I don’t know if that’s just inertia on their part, or the result of a considered choice however.
But framework wars are like language wars :) There's probably not too much productive arguments that haven't been made
This wholesale dismissal of floating point for "financial" systems ignores the real business needs which might point you toward fixed or floating point numbers. Always ask yourself - do you need to know this number to better than 1 in 10^14? Are you going to find its square root at some point? Also remember that storing fixed point numbers usually takes more bytes than double-precision floats.
Yes, because over time thousands of multiplies and divides means you will get more than a penny off. The more high frequency the more floats become a problem.
Quibbles aside, they're not suggesting doing accounting with floats. E.g., suppose you want to estimate the expected value of an option. You'll have a model that attempts to describe that option's behavior (e.g. Black Scholes), and you want to evaluate that model with a certain set of parameters. The model itself is imperfect, and given the transcendentals involved even if it were flawless there would be a guaranteed loss of precision when attempting to clamp a real option to its predicted expected value. The model is a tool that guides decisions, but nobody really cares if it's off by a little bit because there are a ton of other error sources anyway. 1 in 10^14 is more than good enough.
Edit: Unless you're just suggesting that people should do a little numerical analysis and be cognizant of the total error in a model?
But for actual simulating trading where calculastions compounds on itself, instead of one algorithm that calculates something and then is done, floating point becomes an issue.
----
Because of the downvotes, let's take a step back to 101 about floating point error:
>>> 1.20 - 1.00
> 0.199999999999999996
In this example, you're a penny off. This is a single equation. So you have to check for rounding error and possibly round up for EVERY calculation you do, which is time consuming.
Alternative, there is fixed precision types which are fast, very fast, faster than regularly checking for errors.
If you have an equation that calculates once and then is done, a penny or two off is no big deal, but when you're backtesting, a penny or two off for every trade compounds and you end up with dollars a day off. If the algorithm is identifying to the faction of a penny in the middle of the trading day and adjusting its configuration accordingly, it will be wrong, which creates a butterfly effect that ripples out into the day, and with high frequency trading it's somewhat uncommon, but possible, to get 10% off a day from floating point precision due to the actual algorithm failing on deciding the correct path forward while trading significantly compounding the issue. Now take that and compound it out months and you see the issue.
I am unaware of fixed precision types that have hardware optimized (other than FPGAs which are used for feed handling in HFT anyway). If you are modeling discrete things like Minimum Price Variations, then yes, use fixed precision, or even encode it in a way that saves space. But if you're numerically solving a partial differential equation, e.g., Black Scholes, it's difficult to see how fixed precision numbers are going to have an advantage.
In other words, they're describing a scenario where 1 in 10^14 error is potentially not tolerable because of some amplified discrete behavior.
https://stackoverflow.com/questions/2550281/floating-point-v...
Floats were not historically adopted for speed, but because you can get more decimal places with small numbers like 8 bit numbers.
Today with 64 and 128 bit numbers, floating point loses most of its historical benefit, but of course it still has its benefits.
This will be accelerated by Tensorflow - which means acceleration on Macbook M1 as well
My advice would be to only use Tensorflow with the python wrappers. It's just too complex.
Liquidity pool shares are asset backed by at least two other assets
Can Tensorflow help me with keeping pricing?
Google do shadow banking. They are "contracted" by Lloyds, but it's all Google on the backend, developing a Revolut alternative among other things
(I work for Alphabet but have nothing to do with this)
wtf.