On the Solution of the Black–Scholes Equation Using Feed-Forward Neural Networks

Abstract

This paper deals with a comparative numerical analysis of the Black–Scholes equation for the value of a European call option. Artificial neural networks are used for the numerical solution to this problem. According to this method, we approximate the unknown function of the option value using a trial function, which depends on a neural network solution and satisfies the given boundary conditions of the Black–Scholes equation. We consider some optimization methods, not examined in the standard literature, such as particle swarm optimization and the gradient-type monotone iteration process, to obtain the unknown parameters of the neural network. Numerical results show that this proposed version of neural network method obtains all data from the terminal value and boundary conditions with sufficient accuracy.

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Notes

  1. 1.

    https://github.com/kgunel/Black-Scholes.

References

  1. Amornwattana, S., Enke, D., & Dagli, C. H. (2007). A hybrid option pricing model using a neural network for estimating volatility. International Journal of General Systems, 36(5), 558–573.

    Article  Google Scholar 

  2. Andreou, P. C., Charalambous, C., & Martzoukos, S. H. (2008). Pricing and trading European options by combining artificial neural networks and parametric models with implied parameters. European Journal of Operational Research, 185(3), 1415–1433.

    Article  Google Scholar 

  3. Anwar, M. N., & Andallah, L. S. (2018). A study on numerical solution of Black–Scholes model. Journal of Mathematical Finance, 8, 372–381.

    Article  Google Scholar 

  4. Bangyal, W. H., Rauf, H. T., Batool, H., Bangyal, S. A., Ahmed, J., & Pervaiz, S. (2019). An improved particle swarm optimization algorithm with chi-square mutation strategy. International Journal of Advanced Computer Science and Applications, 10(3), 481–491.

    Article  Google Scholar 

  5. Bates, D. S. (1996) 20 Testing option pricing models, Handbook of Statistics, Elsevier, vol. 14, 1996, 567–611, ISBN: 9780444819642.

  6. Black, F., & Scholes, M. S. (1973). The pricing of options and corporate liabilities. Journal of Political Economy, 81(3), 637–654.

    Article  Google Scholar 

  7. Chowdhury, R., Mahdy, M. R. C., Alam, T. N., Al Quaderi, G. D., & Rahman, M. A. (2020) Predicting the stock price of frontier markets using machine learning and modified Black–Scholes Option pricing model. Physica A-Statistical Mechanics and its Applications, 555, Article Number: 124444.

  8. Cybenko, G. (1989). Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals and Systems, 2(4), 303–314.

    Article  Google Scholar 

  9. Das, S. P., & Padhy, S. (2017). A new hybrid parametric and machine learning model with homogeneity hint for European-style index option pricing. Neural Computing & Applications, 28(12), 4061–4077.

    Article  Google Scholar 

  10. Eberhart, R. C., & Kennedy, J. (1995). A new optimizer using particle swarm theory, in Symposium on Micro Machine and Human Science. Japan: Nagoya, Piscataway, NJ.

  11. Farnoosh, R., Sobhani, A., Rezazadeh, H., & Beheshti, M. H. (2015). Numerical method for discrete double barrier option pricing with time-dependent parameters. Computers and Mathematics with Applications, 70(8), 2006–2013.

    Article  Google Scholar 

  12. Farnoosh, R., Rezazadeh, H., Sobhani, A., et al. (2016). A numerical method for discrete single barrier option pricing with time-dependent parameters. Computational Economics, 48, 131–145.

    Article  Google Scholar 

  13. Freitas, D., Lopes, L. G., & Morgado-Dias, F. (2020). Particle swarm optimisation: A historical review up to the current developments. Entropy, 22(3), 1–32.

    Article  Google Scholar 

  14. Fusai, G., & Recchioni, M. C. (2008). Analysis of quadrature methods for pricing discrete barrier options. Journal of Economic Dynamics and Control, 31, 826–860.

    Article  Google Scholar 

  15. Golbabai, A., Nikan O. , & Nikazad, T. (2019). Numerical analysis of time fractional Black–Scholes European option pricing model arising in financial market. Computational and Applied Mathematics, 38(4), Article Number: 173.

  16. Golbabai, A., & Nikan, O. (2020). A computational method based on the moving least-squares approach for pricing double barrier options in a time-fractional Black–Scholes model. Computational Economics, 55(1), 119–141.

    Article  Google Scholar 

  17. Halton, J. H. (1964). Algorithm 247: Radical-inverse quasi-random point sequence. Communications of the ACM, 7(12), 701–702.

    Article  Google Scholar 

  18. Hobson, D. (2004). Review Paper: A survey of mathematical finance. Proceedings of the Royal Society of London. Series A: Mathematical, Physical and Engineering Sciences, 460(2052), 3369–3401.

    Article  Google Scholar 

  19. Jang, H., & Lee, J. (2019). Generative Bayesian neural network model for risk-neutral pricing of American index options. Quantitative Finance, 19(4), 587–603.

    Article  Google Scholar 

  20. Kennedy, J., & Eberhart, R. (1995). Particle swarm optimization. In: Proceedings of ICNN’95 - International Conference on Neural Networks, Perth, WA, Australia (pp. 1942–1948, vol. 4). https://doi.org/10.1109/ICNN.1995.488968.

  21. Kolmogorov, A. N. (1957). On the representation of continuous functions of several variables by superpositions of continuous functions of one variable and addition. Dokl. Akad. Nauk SSSR 114, 953–956. English Translation: American Mathematical Society Translation 28(2), 1963, 55–59.

  22. Lajbcygier, P. (2004). Improving option pricing with the product constrained hybrid neural network. IEEE Transactions on Neural Networks, 15(2), 465–476.

    Article  Google Scholar 

  23. Levy, G. (2016). Computational Finance Using C and C#. Derivatives and Valuation, 2nd Edition, Quantitative Finance Series, Academic Press, London, UK, ISBN: 978-0-12-803579-5.

  24. Malek, A., & Shekari Beidokhti, R. (2006). Numerical solution for high order differential equations using a hybrid neural network-optimization method. Applications and Mathematical Computation, 183, 260–271.

    Article  Google Scholar 

  25. Malliaris, M., & Salchenberger, L. (1993). A neural-network model for estimating option prices. Applied Intelligence, 3(3), 193–206.

    Article  Google Scholar 

  26. Martinez-Cantin, R. (2014). BayesOpt: A bayesian optimization library for nonlinear optimization, experimental design and bandits. Journal of Machine Learning Research, 15(115), 3915–3919.

    Google Scholar 

  27. Muller, B., Reinhardt, J., & Strickland, M. T. (2002). Neural networks: An introduction (2nd ed.). Berlin: Springer.

    Google Scholar 

  28. Ojha, V. K., Abraham, A., & Snasel, V. (2017). Metaheuristic design of feedforward neural networks: A review of two decades of research. Engineering Applications of Artificial Intelligence, 60, 97–116.

    Article  Google Scholar 

  29. Ozbayoglu, A. M., Gudelek, M. U., & Sezer, O. B. (2020). Deep learning for financial applications : A survey. Applied Soft Computing, Article Number: 106384.

  30. Ömür, U. (2008). An introduction to computational finance. Imperial College Press: Series in Quantitative Finance. World Scientific Publishing Co.

    Google Scholar 

  31. Pradip Roul, P. (2020). A high accuracy numerical method and its convergence for time-fractional Black–Scholes equation governing European options. Applied Numerical Mathematics, 151, 472–493.

    Article  Google Scholar 

  32. Roul, P., & Goura, V. M. K. P. (2020). A sixth order numerical method and its convergence for generalized Black–Scholes PDE. Journal of Computational and Applied Mathematics, 377, 112881.

    Article  Google Scholar 

  33. Sobol, I. Y. M. (1967). On the distribution of points in a cube and the approximate evaluation of integrals. Zhurnal Vychislitel’noi Matematiki i Matematicheskoi Fiziki, 7(4), 784–802.

    Google Scholar 

  34. Susan, S., Ranjan, R., Taluja, U., et al. (2020). Global-best optimization of ANN trained by PSO using the non-extensive cross-entropy with Gaussian gain. Soft Computation.

  35. Wilmott, P., Dewynne, J., & Howison, S. (1994). Option pricing: Mathematical models and computation. Oxford: Oxford Financial Press.

    Google Scholar 

  36. Yao, J. T., Li, Y. L., & Tan, C. L. (2000). Option price forecasting using neural networks. Omega-International Journal of Management Science, 28(4), 455–466.

    Article  Google Scholar 

  37. Yarpiz, (2020). Particle Swarm Optimization (PSO), 2015, https://www.mathworks.com/matlabcentral/fileexchange/52857-particle-swarm-optimization-pso, MATLAB Central File Exchange. Retrieved July 8.

Download references

Acknowledgements

We would like to gratefully thank the anonymous reviewers for their constructive comments and recommendations, which are definitely helped to improve the paper. Thanks are also given to Ian Collins, the Assistant Director of the School of Foreign Languages at Yaşar University, for his contribution in proof-reading.

Author information

Affiliations

Authors

Corresponding author

Correspondence to Korhan Günel.

Ethics declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendix 1: The Partial Derivatives of Cost Function

Appendix 1: The Partial Derivatives of Cost Function

The partial derivatives of the cost function F depending on the unknown parameters of the neural network given in Eqs. 27, 28, 29 and 30

$$\begin{aligned} \dfrac{\partial F}{\partial \alpha _k} = \sum _{i=1}^{N_x}\sum _{j=1}^{N_t}e_{ij}\dfrac{\partial e_{ij}}{\partial \alpha _k} \end{aligned}$$
(27)

where \(\dfrac{\partial e_{ij}}{\partial \alpha _k} = \dfrac{\partial ^2 \psi }{\partial \alpha _k \partial t_j} +\dfrac{1}{2}S_i^2\sigma ^2 \dfrac{\partial ^3 \psi }{\partial \alpha _k \partial S_i^2} + rS_i \dfrac{\partial ^2 \psi }{\partial \alpha _k \partial S_i} -r\dfrac{\partial \psi }{\partial \alpha _k}\), \(e_{ij}\) is defined in Eq. 16, and \(\psi \) is the trial function formalized as in Eq. 13 for \(k = 1, 2, \ldots m\) such that m is the total number of neurons in the neural network.

One can easily determine that the partial derivatives in Eq. 27 are calculated as follows with respect to Eqs. 17, 18 and 19.

$$\begin{aligned} \dfrac{\partial \psi }{\partial \alpha _k}= & {} S(T-t)\dfrac{\partial Net(S,t;\mathbf {p})}{\partial \alpha _k},\\ \dfrac{\partial ^2 \psi }{\partial \alpha _k \partial t}= & {} -S\dfrac{\partial Net(S,t;\mathbf {p})}{\partial \alpha _k} + S(T-t)\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \alpha _k \partial t},\\ \dfrac{\partial ^2 \psi }{\partial \alpha _k \partial S}= & {} (T-t)\dfrac{\partial Net(S,t;\mathbf {p})}{\partial \alpha _k} + S(T-t)\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \alpha _k \partial S},\\ \dfrac{\partial ^3 \psi }{\partial \alpha _k \partial S^2}= & {} 2(T-t)\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \alpha _k \partial S} + S(T-t)\dfrac{\partial ^3 Net(S,t;\mathbf {p})}{\partial \alpha _k \partial S^2} \end{aligned}$$

where \(\dfrac{\partial Net(S,t;\mathbf {p})}{\partial \alpha _k} = f(z_k)\), \(\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \alpha _k \partial t} = \omega _k f(z_k)(1 - f(z_k)),\) \(\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \alpha _k \partial S} = \eta _k f(z_k)(1 - f(z_k))\) and \(\dfrac{\partial ^3 Net(S,t;\mathbf {p})}{\partial \alpha _k \partial S^2} = \eta _k^2 f(z_k)(1 - f(z_k))(1 - 2f(z_k))\) for \(k=1, 2, \ldots , m.\)

Similarly,

$$\begin{aligned} \dfrac{\partial F}{\partial \omega _k} = \sum _{i=1}^{N_x}\sum _{j=1}^{N_t}e_{ij}\dfrac{\partial e_{ij}}{\partial \omega _k} \end{aligned}$$
(28)

where \(\dfrac{\partial e_{ij}}{\partial \omega _k} = \dfrac{\partial ^2 \psi }{\partial \omega _k \partial t_j} +\dfrac{1}{2}S_i^2\sigma ^2 \dfrac{\partial ^3 \psi }{\partial \omega _k \partial S_i^2} + rS_i \dfrac{\partial ^2 \psi }{\partial \omega _k \partial S_i} -r\dfrac{\partial \psi }{\partial \omega _k}.\)

Here, the partial derivatives \(\dfrac{\partial \psi }{\partial \omega _k},\) \(\dfrac{\partial ^2 \psi }{\partial \omega _k \partial t},\) \(\dfrac{\partial ^2 \psi }{\partial \omega _k \partial S}\) and \(\dfrac{\partial ^3 \psi }{\partial \omega _k \partial S^2}\) are computed with regard to Eqs 17, 18 and 19 as

$$\begin{aligned} \dfrac{\partial \psi }{\partial \omega _k}= & {} S(T-t)\dfrac{\partial Net(S,t;\mathbf {p})}{\partial \omega _k},\\ \dfrac{\partial ^2 \psi }{\partial \alpha _k \partial t}= & {} -S\dfrac{\partial Net(S,t;\mathbf {p})}{\partial \omega _k} + S(T-t)\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \omega _k \partial t},\\ \dfrac{\partial ^2 \psi }{\partial \alpha _k \partial S}= & {} (T-t)\dfrac{\partial Net(S,t;\mathbf {p})}{\partial \omega _k} + S(T-t)\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \omega _k \partial S}, \end{aligned}$$

and

$$\begin{aligned} \dfrac{\partial ^3 \psi }{\partial \omega _k \partial S^2} = 2(T-t)\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \omega _k \partial S} + S(T-t)\dfrac{\partial ^3 Net(S,t;\mathbf {p})}{\partial \omega _k \partial S^2} \end{aligned}$$

where \(\dfrac{\partial Net(S,t;\mathbf {p})}{\partial \omega _k} = \alpha _k t f(z_k)(1 - f(z_k))\), \(\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \omega _k \partial t} = \alpha _k f(z_k)(1 - f(z_k))(1 + w_kt -2w_ktf(z_k)),\) \(\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \omega _k \partial S} = \alpha _k\eta _k t f(z_k)(1 - f(z_k))(1 - 2f(z_k))\) and \(\dfrac{\partial ^3 Net(S,t;\mathbf {p})}{\partial \omega _k \partial S^2} = \alpha _k\eta _k^2 t f(z_k)(1 - f(z_k))(1 - 2f(z_k))\left\{ (1-2f(z_k))^2 - 2(1-f(z_k))\right\} \) for \(k=1, 2, \ldots , m.\)

And as with to the previous partial derivative, \(\dfrac{\partial F}{\partial \eta _k}\) is calculated as

$$\begin{aligned} \dfrac{\partial F}{\partial \eta _k} = \sum _{i=1}^{N_x}\sum _{j=1}^{N_t}e_{ij}\dfrac{\partial e_{ij}}{\partial \eta _k} \end{aligned}$$
(29)

where \(\dfrac{\partial e_{ij}}{\partial \eta _k} = \dfrac{\partial ^2 \psi }{\partial \eta _k \partial t_j} +\dfrac{1}{2}S_i^2\sigma ^2 \dfrac{\partial ^3 \psi }{\partial \eta _k \partial S_i^2} + rS_i \dfrac{\partial ^2 \psi }{\partial \eta _k \partial S_i} -r\dfrac{\partial \psi }{\partial \eta _k}.\) In this case, the partial derivatives are respectively equal to

$$\begin{aligned} \dfrac{\partial \psi }{\partial \eta _k}&= S(T-t)\dfrac{\partial Net(S,t;\mathbf {p})}{\partial \eta _k},\\ \dfrac{\partial ^2 \psi }{\partial \eta _k \partial t}&= -S\dfrac{\partial Net(S,t;\mathbf {p})}{\partial \eta _k} + S(T-t)\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \eta _k \partial t},\\ \dfrac{\partial ^2 \psi }{\partial \eta _k \partial S}&= (T-t)\dfrac{\partial Net(S,t;\mathbf {p})}{\partial \eta _k} + S(T-t)\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \eta _k \partial S}, \end{aligned}$$

and

$$\begin{aligned} \dfrac{\partial ^3 \psi }{\partial \eta _k \partial S^2} = 2(T-t)\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \eta _k \partial S} + S(T-t)\dfrac{\partial ^3 Net(S,t;\mathbf {p})}{\partial \eta _k \partial S^2} \end{aligned}$$

where \(\dfrac{\partial Net(S,t;\;\mathbf {p})}{\partial \eta _k} = \alpha _k S f(z_k)(1 - f(z_k))\), \(\dfrac{\partial ^2 Net(S,t;\;\mathbf {p})}{\partial \eta _k \partial t} = \alpha _k \omega _k S f(z_k)(1 - f(z_k))(1 - 2f(z_k)),\) \(\dfrac{\partial ^2 Net(S,t;\;\mathbf {p})}{\partial \eta _k \partial S} = \alpha _k f(z_k)(1 - f(z_k))(1 +\eta _k S -2\eta _k Sf(z_k))\) and \(\dfrac{\partial ^3 Net(S,t;\;\mathbf {p})}{\partial \eta _k \partial S^2} = \alpha _k\eta _k f(z_k)(1 - f(z_k))\left\{ 2 - 4f(z_k) + \eta _k S - 2\eta _k f(z_k)(1-f(z_k))\right\} \) for \(k=1, 2, \ldots , m.\)

The partial derivative \(\dfrac{\partial F}{\partial \beta _k}\) is computed as

$$\begin{aligned} \dfrac{\partial F}{\partial \beta _k} = \sum _{i=1}^{N_x}\sum _{j=1}^{N_t}e_{ij}\dfrac{\partial e_{ij}}{\partial \beta _k} \end{aligned}$$
(30)

where \(\dfrac{\partial e_{ij}}{\partial \beta _k} = \dfrac{\partial ^2 \psi }{\partial \beta _k \partial t_j} +\dfrac{1}{2}S_i^2\sigma ^2 \dfrac{\partial ^3 \psi }{\partial \beta _k \partial S_i^2} + rS_i \dfrac{\partial ^2 \psi }{\partial \beta _k \partial S_i} -r\dfrac{\partial \psi }{\partial \beta _k}.\) The partial derivatives \(\dfrac{\partial \psi }{\partial \beta _k},\) \(\dfrac{\partial ^2 \psi }{\partial \beta _k \partial t},\) \(\dfrac{\partial ^2 \psi }{\partial \beta _k \partial S}\) and \(\dfrac{\partial ^3 \psi }{\partial \beta _k \partial S^2}\) are set out below.

$$\begin{aligned} \dfrac{\partial \psi }{\partial \beta _k}= & {} S(T-t)\dfrac{\partial Net(S,t;\mathbf {p})}{\partial \beta _k},\\ \dfrac{\partial ^2 \psi }{\partial \beta _k \partial t}= & {} -S\dfrac{\partial Net(S,t;\mathbf {p})}{\partial \beta _k} + S(T-t)\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \beta _k \partial t},\\ \dfrac{\partial ^2 \psi }{\partial \beta _k \partial S}= & {} (T-t)\dfrac{\partial Net(S,t;\mathbf {p})}{\partial \beta _k} + S(T-t)\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \beta _k \partial S},\\ \dfrac{\partial ^3 \psi }{\partial \beta _k \partial S^2}= & {} 2(T-t)\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \beta _k \partial S} + S(T-t)\dfrac{\partial ^3 Net(S,t;\mathbf {p})}{\partial \beta _k \partial S^2} \end{aligned}$$

where \(\dfrac{\partial Net(S,t;\mathbf {p})}{\partial \beta _k} = \alpha _k f(z_k)(1 - f(z_k))\), \(\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \beta _k \partial t} = \alpha _k \omega _k f(z_k)(1 - f(z_k))(1 - 2f(z_k)),\) \(\dfrac{\partial ^2 Net(S,t;\mathbf {p})}{\partial \beta _k \partial S} = \alpha _k \eta _k f(z_k)(1 - f(z_k))(1 -2f(z_k))\) and \(\dfrac{\partial ^3 Net(S,t;\mathbf {p})}{\partial \beta _k \partial S^2} = \alpha _k\eta _k^2 f(z_k)(1 - f(z_k))(1 - 2f(z_k) +2f^2(z_k))\) for \(k=1, 2, \ldots , m.\)

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Eskiizmirliler, S., Günel, K. & Polat, R. On the Solution of the Black–Scholes Equation Using Feed-Forward Neural Networks. Comput Econ (2020). https://doi.org/10.1007/s10614-020-10070-w

Download citation

Keywords

  • Black–Scholes equation
  • Option pricing
  • Neural networks
  • Particle swarm optimization
  • Gradient descent

JEL Classification

  • C45-neural networks and related topics
  • C61-optimization techniques
  • Programming models
  • Dynamic analysis
  • G13-contingent pricing
  • Futures pricing

Mathematics Subject Classification

  • MSC 91G80
  • MSC 35Q91