*Proceedings* **European and American Options Valuation by Unsupervised Learning with Artificial Neural Networks †**

#### **Beatriz Salvador 1,\* , Cornelis W. Oosterlee 2,3 and Remco van der Meer 2,3**


Published: 19 August 2020

**Abstract:** Artificial neural networks (ANNs) have recently also been applied to solve partial differential equations (PDEs). In this work, the classical problem of pricing European and American financial options, based on the corresponding PDE formulations, is studied. Instead of using numerical techniques based on finite element or difference methods, we address the problem using ANNs in the context of unsupervised learning. As a result, the ANN learns the option values for all possible underlying stock values at future time points, based on the minimization of a suitable loss function. For the European option, we solve the linear Black–Scholes equation, whereas for the American option, we solve the linear complementarity problem formulation.

**Keywords:** (non)linear PDEs; Black–Scholes model; artificial neural network; loss function; multi-asset options

#### **1. Introduction**

The interest in machine learning techniques, due to the remarkable successes in different application areas, is growing exponentially. ANNs are learning systems based on a collection of artificial neurons that constitute a connected network. Such systems "learn" to perform tasks, generally without being programmed with task-specific rules. Many different financial problems have also been addressed with machine learning. The financial application on which we focus is the valuation of financial derivatives with PDEs. Generally, we can distinguish between supervised and unsupervised machine learning techniques. The goal of the current work is to solve the financial PDEs by applying unsupervised machine learning techniques. In such a case, only the inputs of the network are known, and based on a suitable loss function that needs to be minimized, the ANN should "converge" to the solution of the PDE problem. We will price European and American options modeled by the Black–Scholes PDE and look for solutions for all future time points and stock values. Thus, linear and nonlinear partial differential equations need to be solved.

#### **2. Artificial Neural Networks Solving PDEs**

We introduce the methodology following [1] to solve linear and nonlinear time-dependent PDEs by ANNs. Then, we write a general PDE problem as follows:

$$\begin{aligned} \mathcal{N}\_I(v(t, x)) &= 0, \quad x \in \Omega, \ t \in [0, T], \\ \mathcal{N}\_B(v(t, x)) &= 0 \quad \text{on } \partial \bar{\Omega}, \\ \mathcal{N}\_0(v(t^\*, x)) &= 0 \quad x \in \bar{\Omega} \text{ and } t^\* = 0 \text{ or } t^\* = T, \end{aligned} \tag{1}$$

where *v*(*t*, *x*) denotes the solution of the PDE, N*I*(·) is a linear or nonlinear time-dependent differential operator, <sup>N</sup>*B*(·) is a boundary operator, <sup>N</sup>0(·) is an initial or final time operator, <sup>Ω</sup> is a subset of <sup>R</sup>*D*, and *∂*Ω denotes the boundary on the domain Ω . The goal is to obtain *v*ˆ(*t*, *x*) by minimizing a suitable loss function *L*(*v*) over the space of *k*-times differentiable functions, where *k* depends on the order of the derivatives in the PDE, i.e.,

$$\arg\min\_{v \in \mathcal{C}^k} L(v) = \vartheta$$

where we denote by *v*ˆ(*t*, *x*) the true solution of the PDE. A general expression for the loss function, defined in terms of the *L<sup>p</sup>* norm, including a weighting, is defined as follows [1,2]:

$$L(\mathbf{v}) = \lambda \int\_{\Omega} |\mathcal{N}\_l(\mathbf{v}(t, \mathbf{x}))|^p \, d\Omega + (1 - \lambda) \int\_{\partial\Omega} \left( |\mathcal{N}\_B(\mathbf{v}(t, \mathbf{x}))|^p + |\mathcal{N}\_0(\mathbf{v}(t, \mathbf{x}))|^p \right) d\gamma,\tag{2}$$

where Ω = Ω × [0, *T*] and *∂*Ω the boundary of Ω. Financial options with early-exercise features give rise to free boundary PDE problems. We will focus on the reformulation of the free boundary problem as a LCP. The generic LCP formulation reads:

$$\max(\mathcal{N}\_0(v(t, \mathbf{x})), \mathcal{N}\_l(v(t, \mathbf{x}))) = 0, \quad \mathbf{x} \in \Omega, \ t \in [0, T],$$

$$\mathcal{N}\_\mathcal{B}(v(t, \mathbf{x})) = 0, \quad \text{on } \partial\tilde{\Omega},$$

$$\mathcal{N}\_0(v(t^\*, \mathbf{x})) = 0, \quad \mathbf{x} \in \tilde{\Omega} \text{ and } t^\* = 0 \text{ or } t^\* = T.$$

Our expression for the loss function, to solve the linear complementarity problem, is as follows:

$$L(\mathbf{v}) = \lambda \int\_{\Omega} |\max(N\_0(t, \mathbf{x}, \mathbf{v}), N\_l(t, \mathbf{x}, \mathbf{v}))|^p \, d\Omega + (1 - \lambda) \int\_{\partial\Omega} \left( |\mathcal{N}\_{\mathbb{B}}(t, \mathbf{x}, \mathbf{v})|^p + |\mathcal{N}\_{\mathbb{B}}(t, \mathbf{x}, \mathbf{v})|^p \right) d\gamma. \tag{3}$$

#### **3. Financial Derivatives Pricing PDEs**

In this section, the option pricing partial differential equation problems are presented. We briefly introduce the European asset model, the American and multi-asset options model being easily extended.

The underlying asset *St* is assumed to pay a constant dividend yield *δ*, and follows the geometric Brownian motion:

$$dS\_t = (\mu - \delta)S\_t dt + \sigma S\_t dW\_t^P \tag{4}$$

where *W<sup>P</sup> <sup>t</sup>* is a Brownian motion. Assuming there are no arbitrage opportunities, the European option value follows from the Black–Scholes equation:

$$\begin{cases} \mathcal{L}(\upsilon) = \partial\_t \upsilon + \mathcal{A}\upsilon - r\upsilon = 0 & \mathcal{S} \in \widetilde{\Omega} \; t \in [0, T) \\ \upsilon(T, S) = H(S) \end{cases} \tag{5}$$

where operator A is the classical Black–Scholes operator, and function *H* denotes the option's payoff. Then, the loss function is defined as:

$$\begin{split} L(\boldsymbol{v}) &= \lambda \int\_{\Omega} |\mathcal{L}(\boldsymbol{v}(t, \mathbf{x}))|^{p} \, d\Omega \\ &+ (1 - \lambda) \int\_{\partial\Omega} \left( |\boldsymbol{v}(t, \mathbf{x}) - \mathcal{G}(t, \mathbf{x})|^{p} + |\boldsymbol{v}(t, \mathbf{x}) - \boldsymbol{H}(\mathbf{x})|^{p} \right) d\gamma, \end{split} \tag{6}$$

where functions *G* and *H* denote the values of the spatial boundary conditions and final condition, respectively. The integral terms in the loss function are approximated by Monte Carlo techniques.

#### **4. ANN Option Pricing Results**

We start with a European put option, with the following parameters' values: *σ* = 0.25, *r* = 0.04, *T* = 1, *K* = 15, *S*<sup>∞</sup> = 4*K*, *δ* = 0.0. In Figure 1, the ANN-based, trained, and the analytical solution are plotted for two time instances. The relative error, with *<sup>λ</sup>* <sup>=</sup> 0.5, is equal to 2.23 <sup>×</sup> <sup>10</sup>−4.

**Figure 1.** European put option for different times instances, *t* = 0, *t* = 0.5, with *λ* = 0.5.

Finally, in order to show the accuracy of the method applied to train the ANN to price American options depending on two asset prices, the relative error is presented in Table 1.


**Table 1.** Error for different multi-asset American options.

**Author Contributions:** Investigation and writing—original draft preparation: B.S., Supervision: C.W.O., validation: R.v.d.M. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by ERCIM fellowship.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**


c 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

### *Proceedings* **Digital Image Quality Prediction System †**

**Nereida Rodriguez-Fernandez 1,2,\* , Iria Santos 1,2 , Alvaro Torrente-Patiño <sup>3</sup> and Adrian Carballal 1,3**


#### Published: 19 August 2020

**Abstract:** "A picture is worth a thousand words." Based on this well-known adage, we can say that images are important in our society, and increasingly so. Currently, the Internet is the main channel of socialization and marketing, where we seek to communicate in the most efficient way possible. People receive a large amount of information daily and that is where the need to attract attention with quality content and good presentation arises. Social networks, for example, are becoming more visual every day. Only on Facebook can you see that the success of a publication increases up to 180% if it is accompanied by an image. That is why it is not surprising that platforms such as Pinterest and Instagram have grown so much, and have positioned themselves thanks to their power to communicate with images. In a world where more and more relationships and transactions are made through computer applications, many decisions are made based on the quality, aesthetic value or impact of digital images. In the present work, a quality prediction system for digital images was developed, trained from the quality perception of a group of humans.

**Keywords:** machine learning; genetic algorithm; quality; image; prediction; dataset

#### **1. Introduction**

In recent years, significant efforts were applied to the development of successful models and algorithms that can automatically and accurately predict the perceptual quality of two-dimensional (2D) and three-dimensional (3D) digital images and videos. This estimate comes from studies with at least a century of experience, or more if we take into account those developed by Platon and Aristotle, usually from Humanities departments: Psychology, Sociology, Philosophy, Fine Arts, etc. [1]. Different research groups sought to create computer systems capable of learning the aesthetic and quality perception of a group of humans as part of a generative system for uses such as the selection and arrangement of images within a set, even though it is complex to translate this into computer problems. Visual quality refers to the quantification of the perceptual degradation of a visual stimulus due to the presence or absence of distortions. Most of the applications that were developed were designed to treat synthetically distorted images [2]. In this case, unlike other image quality assessment algorithms that use synthetically distorted images [3,4], it was decided to use images with absence of distortion [5,6]. Despite the fact that the data collected contained quality and aesthetic results, on this occasion only the quality data were used as they constituted more objective results [7].

#### **2. Materials and Methods**

After analyzing the degree of generalization of some datasets used in automatic image prediction, it was concluded that it was not enough to consider them as a reference in the training of automatic image prediction and classification systems. Taking this into account, a new set of images from the web portal DPChallenge.com was developed in search of greater statistical consistency [7].

The proposed dataset was built following the steps outlined in previous works [8]: obtaining the images on the web portal, filtering those images, organizing them according to their evaluation on the portal and selecting sets with an equal number of images. Subsequently, the quality of the images was evaluated by a group of humans through the Amazon Mechanical Turk platform. This group of humans was made up of 525 inhabitants of the USA (39% men and 61% women), aged between 18 and 70. A representation of the images from this dataset is shown in Figure 1.

**Figure 1.** Images of different scoring ranges belonging to the dataset used in this work, evaluated by humans according to their quality. (**a**) Image with an average score of 2.7 out of a maximum of 10. (**b**) Image with an average score of 5.7 out of a maximum of 10. (**c**) Image with an average score of 9.28 out of a maximum of 10.

With this data, a system was created to predict the quality of digital images with the search engine Correlation by Genetic Search (CGS) [9,10].

#### **3. Results**

The results obtained during the experimental phase correspond to 50 runs of a 5-fold cross-validation with a training model where 80% of the set is dedicated to training and the remaining 20% to testing. As input data, 1024 features of VGG19 were used. The average number of features used in the 50 runs is 114, which has also reached an average Pearson correlation of 0.77 and an average error of 0.15. Figure 2 shows the distribution of features, Pearson correlation and error of the 50 runs. The absence of a large number of outliers stands out, which provides consistency and validity to the data obtained. In the three cases, the data that is recognized as outlier belongs to the same run. In the case of the error, its greater variability can be observed, with a maximum error of 0.16 and a minimum error of 0.09. In the case of the features and the Pearson correlation, a much more uniform and concentrated representation is observed, with a very small variability that leads to deduce that the model proposes coherent results in the 50 runs.

#### *Proceedings* **2020**, *54*, 15

**Figure 2.** Results obtained in the experiments carried out with CGS. (**a**) Features used in each of the 50 runs. (**b**) Pearson correlation of the validation set in each run. (**c**) Average error obtained in each run.

#### **4. Conclusions**

This paper focuses on the creation of a digital image quality prediction system from a set of human-evaluated images. The task was tested with a hybrid method for the creation of multiple regression models based on the maximization of the correlation, the CGS method. Thus, an average Pearson correlation of 0.77 in 50 runs with 5-fold cross-validation was achieved, with a consistent distribution and low variability, which provides better results than other state-of-the-art works such as Nadal et al. [11] or Marin and Leder [12].

**Acknowledgments:** CITIC, as a Research Centre of the Galician University System, is financed by the Regional Ministry of Education, University and Vocational Training of the Xunta de Galicia through the European Regional Development Fund (ERDF) with 80%, Operational Programme ERDF Galicia 2014-2020 and the remaining 20% by the General Secretariat of Universities (Ref. ED431G 2019/01). This work has also been supported by the General Directorate of Culture, Education and University Management of Xunta de Galicia (Ref. ED431D 201716), and Competitive Reference Groups (Ref. ED431C 201849)

#### **References**


c 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

#### *Proceedings*
