Most quantitate libraries use float64 precision for monte-carlo or other method. Some academic papers do experiments on float16 and find it has some restrictions on float16.
I just wondering if float32 precision is enough in industry?
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It only takes a minute to sign up.
Sign up to join this communityMost quantitate libraries use float64 precision for monte-carlo or other method. Some academic papers do experiments on float16 and find it has some restrictions on float16.
I just wondering if float32 precision is enough in industry?
float32
is enoughFor most applications in finance, float32
is plenty of precision. This is generally suitable for naively achieving about 5-6 significant figures of accuracy. There are so many sources of error, that to trust results beyond this are moot. Consider for example:
If you want really high precision, either for a more theoretical (and less data driven) options pricing question, then it may be useful to switch to high precision. However, in many cases the average accuracy of single precision simulations gives (after averaging) a much greater accuracy than the constituent parts.
For many options pricing problems, note that a double precision accumulator is often required (e.g. to avoid numerical overflow).
float64
but the speed of float16
For Monte Carlo based methods, it is possible (under certain conditions) to utilise low precision formats such as float32
or float16
or even Bfloat16
, but still retain the accuracy of a much higher precision. How? Formulate the problem as a nested multilevel Monte Carlo. The simple explanation of this can be phrased as "Do lots of imprecise calculations very fast, and then do a handful of high accuracy corrections as negligible cost".
My PhD research was in exactly this topic, and I have written an article on interleaving numerical precisions in exactly this way to speed up Monte Carlo applications. See the following article:
Rounding error using low precision approximate random variables
As an example this article demonstrates how to achieve a 10-12 fold speed improvement without any loss in accuracy by mixing precisions in the calculations. It also takes into account how rounding error propagates in Monte Carlo simulations, and how to ensure this is correctly taken care of.
There are also a few companion articles about how to achieve further speed improvements if by similarly relaxing the precision of the random numbers in the right way and in the right places.