7
$\begingroup$

What is the fastest way to numerically compute Black-Scholes-Merton option prices?

I'm trying to find fastest and still precise method. Currently I'm using numerical approximation of Normal cdf with 10-9 precision and standard formulae.

Is there another way to compute them numerically using any programming language without built-in libraries for option pricing and cdf computation? If any what is the speed of the algorithm in comparison with standard method and what is precision of an answer?

There is a question about approximations to the Black-Scholes formula, but there are aproximations for ATM options. And it is not obvious that this methods would show better results.

$\endgroup$
4
  • 4
    $\begingroup$ Make sure you do not over-engineer things. In the end nobody cares about implied vols beyond a single decimal digit and 2 for the option price. $\endgroup$
    – Matt Wolf
    Jun 25, 2013 at 8:21
  • 1
    $\begingroup$ @MattWolf Your warning is reasonable, but there are cases where precision is still valuable. For instance when using these prices/vols as inputs to more complicated models. If you round early, the effect is magnified by further calculations. So it depends on how the OP is going to be using the answers. $\endgroup$ Jun 25, 2013 at 17:40
  • $\begingroup$ Can you elaborate on what data you have given and what you intend to do with it? I don't really see need for a numerical method yet, but perhaps I'm just looking from the wrong angle here... $\endgroup$
    – zuiqo
    Jun 25, 2013 at 21:33
  • $\begingroup$ @phi It is used in real time computatoin of option prices, as a part of implied volatility calibration etc. Performance is crucial. For example there is no analytical representarion of Normal cdf, that can be computed easily. Thus we use approximations with some polynomials rather then compute integrals each time. Thus I'm testing the fastest way to compute OP. $\endgroup$
    – Ilya
    Jun 26, 2013 at 6:11

2 Answers 2

8
$\begingroup$

Fastest method is a pre-generated lookup table with carefully selected in-memory structure so you don't get too many CPU cache misses (avoiding the memory latency).

If you want an absolute speed, you also can go for a hardware specific implementation (GPU, FPGA).

$\endgroup$
4
  • $\begingroup$ Thank you for your comment. It would dramatically improve performance if done correctly, but the algorithm used to compute this table should be still optimized. $\endgroup$
    – Ilya
    Jun 26, 2013 at 11:25
  • 2
    $\begingroup$ @Ilya You need to compute this table only once. Then you can store it in a file and load on the start of application. $\endgroup$ Jun 26, 2013 at 12:40
  • $\begingroup$ Even if the table is simplified to time-IV-underlying-OPspace it is necessary to compute it once a day or more frequently if, for example, underlying had large shock. And if it is made not for one option, but for tenths or hundreds. $\endgroup$
    – Ilya
    Jun 26, 2013 at 19:41
  • 1
    $\begingroup$ @Ilya, I thought we are talking about the normal cdf here. Why would you have to generate such lookup table more than once? $\endgroup$
    – Matt Wolf
    Jun 27, 2013 at 3:54
3
$\begingroup$

The only special function needed for computing Black-Scholes option prices is the cumulative normal function ("N" or "Phi") or equivalently the error function ("erf"). These are very widely available with good standard library implementations. The erf function in single and double precision is part of the c99 and c++11 math standard libraries. For your favorite language, search for "error function" possibly in a "special functions" library. Generally there is no need to trade speed vs. accuracy; the library functions here give full precision with timing in the 10s or 100s of processor cycles. In almost any application the math expense is completely negligible.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.