Neural networks-based backward scheme for fully nonlinear PDEs

Huyen Pham, Xavier Warin, Maximilien Germain

Introduction

This paper is devoted to the resolution in high dimension of fully nonlinear parabolic partial differential equations (PDEs) of the form

The numerical resolution of this class of PDEs is far more difficult than the one of classical semi-linear PDEs where the nonlinear function ff does not depend on γ\gamma. In fact, rather few methods are available to solve fully nonlinear equations even in moderate dimension.

First based on the work of [Che+07], an effective scheme developed in [FTW11] using some regression techniques has been shown to be convergent under some ellipticity conditions later removed by [Tan13]. Due to the use of basis functions, this scheme does not permit to solve PDE in dimension greater than 5.

A scheme based on nesting Monte Carlo has been recently proposed in [War18]. It seems to be effective in very high dimension for maturities TT not too long and linearities not too important.

A numerical algorithm to solve fully nonlinear equations has been proposed by [BEJ19] based on the second order backward stochastic differential equations (2BSDE) representation of [Che+07] and global deep neural networks minimizing a terminal objective function, but no test on real fully nonlinear case is given. This extends the idea introduced in the pioneering papers [EHJ17, HJE18], which were the first serious works for using machine learning methods to solve high dimensional PDEs.

The Deep Galerkin method proposed in [SS18] based on some machine learning techniques and using some automatic differentiation of the solution seems to be effective on some cases. It has been tested in [AA+18] for example on the Merton problem.

In this article, we introduce a numerical method based on machine learning techniques and backward in time iterations, which extends the proposed schemes in [VSS18] for linear problems, and in the recent work [HPW20] for semi-linear PDEs. The approach in these works consists in estimating simultaneously the solution and its gradient by multi-layer neural networks by minimizing a sequence of loss functions defined in backward induction. A basic idea to extend this method to the fully nonlinear case would rely on the representation proposed in [Che+07]: at each time step tnt_{n} of an Euler scheme, the Hessian Dx2uD_{x}^{2}u at tnt_{n} is approximated by a neural network minimizing some local L2L_{2} criterion associated to a BSDE involving DxuD_{x}u at date tn+1t_{n+1} and Dx2uD_{x}^{2}u. Then, the pair (u,Dxu)(u,D_{x}u) at date tnt_{n} is approximated/learned with a second minimization similarly as in the method described by [HPW20]. The first minimization can be implemented with different variations but numerical results show that the global scheme does not scale well with the dimension. Instability on the Dx2uD_{x}^{2}u calculation rapidly propagates during the backward resolution. Besides, the methodology appears to be costly when using two optimizations at each time step. An alternative approach that we develop here, is to combine the ideas of [HPW20] and the splitting method in [Bec+19] in order to derive a new deep learning scheme that requires only one local optimization during the backward resolution for learning the pair (u,Dxu)(u,D_{x}u) and approximating Dx2uD_{x}^{2}u by automatic differentiation of the gradient computed at the previous step.

The outline of the paper is organized as follows. In Section 2, we briefly recall the mathematical description of the classical feedforward approximation, and then derive the proposed neural networks-based backward scheme. We test our method in Section 3 on various examples. First we illustrate our results with a PDE involving a non-linearity of type uDx2uuD_{x}^{2}u. Then, we consider a stochastic linear quadratic problem with controlled volatility where an analytic solution is available, and we test the performance and accuracy of our algorithm up to dimension 2020. Next, we apply our algorithm to a Monge-Ampère equation, and finally, we provide numerical tests for the solution to fully nonlinear Hamilton-Jacobi-Bellman equation, with non-linearities of the form ∣Dxu∣2/Dx2u|D_{x}u|^{2}/D_{x}^{2}u, arising in portfolio selection problem with stochastic volatilities.

The proposed deep backward scheme

2 Forward-backward representation

Let us introduce a forward diffusion process

By Itô’s formula applied to u(t,Xt)u(t,X_{t}), and since uu is solution to (1.1), we see that (Y,Z,Γ)(Y,Z,\Gamma) satisfies the backward equation:

This BSDE does not uniquely characterize a triple (Y,Z,Γ(Y,Z,\Gamma) contrarily to the semilinear case (without a non-linearity with respect to Γ\Gamma) in which proper assumptions on the equation coefficients provide existence and uniqueness for a solution couple (Y,Z)(Y,Z). In the present case at least two options can be used to estimate the Γ\Gamma component:

Rely on the 2BSDE representation from [Che+07] which extends the probabilistic representation of [PP90] for semilinear equations to the fully nonlinear case. It is the approach used by [BEJ19] with a global large minimization problem, as in [HJE18].

Compute the second order derivative by automatic differentiation. This is the point of view we adopt in this paper together with a local approach solving several small optimization problems. In this way, we provide an extension of [HPW20] to cover a broader range of nonlinear PDEs.

3 Algorithm

We now provide a numerical approximation of the forward backward system (2.3)-(2.5), and consequently of the solution uu (as well as its gradient DxuD_{x}u) to the PDE (1.1).

We start from a time grid π\pi == {ti,i=0,…,N}\{t_{i},i=0,\ldots,N\} of [0,T][0,T], with t0t_{0} == << t1t_{1} << …\ldots << tNt_{N} == TT, and time steps Δti\Delta t_{i} :=:= ti+1−tit_{i+1}-t_{i}, ii == 0,…,N−10,\ldots,N-1. The time discretization of the forward process XX on π\pi is then equal (typically when μ\mu and σ\sigma are constants) or approximated by an Euler scheme:

where we set ΔWti\Delta W_{t_{i}} :=:= Wti+1−WtiW_{t_{i+1}}-W_{t_{i}} (by misuse of notation, we keep the same notation XX for the continuous time diffusion process and its Euler scheme). The backward SDE (2.5) is approximated by the time discretized scheme

where T{\cal T} is a truncation operator such that T(X){\cal T}(X) is bounded for example by a quantile of the diffusion process and DZ^i+1D\hat{\cal Z}_{i+1} stands for the automatic differentiation of Z^i+1\hat{\cal Z}_{i+1}. The idea behind the truncation is the following. During one step resolution, the estimation of the gradient is less accurate at the edge of the explored domain where samples are rarely generated. Differentiating the gradient gives a very oscillating Hessian at the edge of the domain. At the following time step resolution, these oscillations propagate to the gradient and the solution even if the domain where the oscillations occur is rarely attained. In order to avoid these oscillations, a truncation is achieved, permits to avoid that the oscillations of the neural network fit in zone where the simulations propagate scarcely to areas of importance. This truncation may be necessary to get convergence on some rather difficult cases. Of course this truncation is only valid if the real Hessian does not varies too much.

The intuition for the relevance of this scheme to the approximation of the PDE (1.1) is the following. From (2.4) and (2.6), the solution uu to (1.1) should approximately satisfy

Suppose that at time ti+1t_{i+1}, U^i+1\hat{\cal U}_{i+1} is an estimation of u(ti+1,.)u(t_{i+1},.). Recalling the expression of FF in (2.7), the quadratic loss function at time tit_{i} is then approximately equal to

Therefore, by minimizing over θ\theta this quadratic loss function, via stochastic gradient descent (SGD) based on simulations of (Xti,Xti+1,ΔWti)(X_{t_{i}},X_{t_{i+1}},\Delta W_{t_{i}}) (called training data in the machine learning language), one expects the neural networks Ui{\cal U}_{i} and Zi{\cal Z}_{i} to learn/approximate better and better the functions u(ti,.)u(t_{i},.) and Dxu(ti,)D_{x}u(t_{i},) in view of the universal approximation theorem for neural networks. The rigorous convergence of this algorithm is postponed to a future work.

To sum up, the global algorithm is given in Algo 1 in the case where gg is Lipschitz and the derivative can be analytically calculated almost everywhere. If the derivative of gg is not available, it can be calculated by automatic differentiation of the neural network approximation of gg.

Several alternatives can be implemented for the computation of the second order derivative. A natural candidate would consist in choosing to approximate the solution uu at time tit_{i} by a neural network Ui{\cal U}_{i} and estimate Γi\Gamma_{i} as the iterated automatic differentiation Dx2UiD_{x}^{2}{\cal U}_{i}. However, it is shown in [HPW20] that choosing only a single neural network for uu and using its automatic derivative to estimate the ZZ component degrades the error in comparison to the choice of two neural networks U,Z{\cal U},{\cal Z}. A similar behavior has been observed during our tests for this second order case and the most efficient choice was to compute the derivative of the Z{\cal Z} network. This derivative can also be estimated at the current time step tit_{i} instead of ti+1t_{i+1}. However this method leads to an additional cost for the neural networks training by complicating the computation of the automatic gradients performed by Tensorflow during the backpropagation. It also leads numerically to worse results on the control estimation, as empirically observed in Table 5 and described in the related paragraph ”Comparison with an implicit version of the scheme”. For this reason, we decided to apply a splitting method and evaluate the Hessian at time ti+1t_{i+1}. For this reason, we decided to apply a splitting method and evaluate the Hessian at time ti+1t_{i+1}. □\Box

The diffusion process XX is used for the training simulations in the stochastic gradient descent method for finding the minimizer of the quadratic loss function in (2.10), where the expectation is replaced by empirical average for numerical implementation. The choice of the drift and diffusion parameters are explained in Section 3.1. □\Box

Numerical results

We first construct an example with different non-linearities in the Hessian term and the solution. We graphically show that the solution is very well calculated in dimension d=1d=1 and then move to higher dimensions. We then use an example derived from a stochastic optimization problem with an analytic solution and show that we are able to accurately calculate the solution. Next, we consider the numerical resolution of the Monge-Ampère equation, and finally, give some tests for a fully nonlinear Hamilton-Jacobi-Bellman equation arising from portfolio optimization with stochastic volatilities.

We describe in this paragraph how we choose the various hyperparameters of the algorithm and explain the learning strategy.

∙\bullet Parameters of the training simulations: the choice of the drift coefficient is typically related to the underlying probabilistic problem associated to the PDE (for example a stochastic control problem), and should drive the training process to regions of interest, e.g.., that are visited with large probability by the optimal state process in stochastic control. In practice, we can take a drift function μ(.)\mu(.) equal to the drift associated to some a priori control. This choice of control could be an optimal control for a related problem for which we know the solution, or could be the control obtained by the first iteration of the algorithm. The choice of the diffusion coefficient σ\sigma is also important: large σ\sigma induces a better exploration of the state space, but as we will see in most of examples below, it gives a scheme slowly converging to the solution with respect to the time discretization and it generates a higher variance on the results. Moreover, for the applications in stochastic control, we might explore some region that are visited with very small probabilities by the optimal state process, hence representing few interest. On the other hand, small σ\sigma means a weak exploration, and we might lack information and precision on some region of the state space: the solution calculated at each time step is far more sensitive to very local errors induced by the neural network approximation and tends to generate a bias. Therefore a trade off has to be found between rather high variance with slow convergence in time and fast convergence in time with a potential bias. We also refer to [NR20] for a discussion on the role of the diffusion coefficient.

In practice and for the numerical examples in the next section, we test the scheme for different σ\sigma and by varying the number of time steps, and if it converges to the same solution, one can consider that we have obtained the correct solution. We also show the impact of the choice of the diffusion coefficient σ\sigma.

∙\bullet Parameters of truncation: Given the training simulations XX, we choose a truncation operator Tp{\cal T}_{p} indexed by a parameter pp close to 11, so that Tp(Xt){\cal T}_{p}(X_{t}) corresponds to a truncation of XtX_{t} at a given quantile ϕp\phi_{p}. In the numerical tests, we shall vary pp between 0.950.95 and 0.9990.999.

∙\bullet Parameters of the optimization algorithm over neural networks: In the whole numerical part, we use a classical Feedforward network using layers with mm neurons each and a tanh⁡\tanh activation function, the output layer uses an identity activation function. At each time step the resolution of equation (2.10) is achieved using a mini-batch with 10001000 training trajectories. The training and learning rate adaptation procedure is the following:

Every 40 inner gradient descent iterations, the loss is checked on 1000010000 validation trajectories.

This optimization sequence is repeated with 200200 outer iterations for the first optimization step at date tN=Tt_{N}=T and only 100100 outer iterations at the dates tit_{i} with i<Ni<N.

An average of the loss calculated on 1010 successive outer iterations is performed. If the decrease of the average loss every 1010 outer iterations is less than 5%5\% then the learning rate is divided by 22.

The optimization is performed using the Adam gradient descent algorithm, see [KB14]. Notice that the adaptation of the learning rate is not common with the Adam method but in our case it appears to be crucial to have a steady diminution of the loss of the objective function. The procedure is also described in [CWNMW19] and the chosen parameters are similar to this article. At the initial optimization step at time tN=Tt_{N}=T, the learning rate is taken equal to 1E−21E-2 and at the following optimization steps, we start with a learning rate equal to 1E−31E-3.

During time resolution, it is far more effective to initialize the solution of equations (2.10) with the solution (U,Z)({\cal U},{\cal Z}) at the next time step. Indeed the previously computed values at time step ti+1t_{i+1} are good approximations of the processes at time step tit_{i} if the PDE solution and its gradient are continuous. All experiments are achieved using Tensorflow [Aba+15]. In the sequel, the PDE solutions on curves are calculated as the average of 10 runs. We provide the standard deviation associated to these results. We also show the influence of the number of neurons on the accuracy of the results.

and g(x)g(x) == \tanh{\big{(}\frac{\sum_{i=1}^{d}x_{i}}{\sqrt{d}}\big{)}}, so that an analytical solution is available:

The coefficients of the forward process used to solve the equation are (here Id{\bf I}_{d} is the identity d×dd\times d-matrix)

and here the truncation operator is chosen equal to

where ϕp\phi_{p} == N−1(p)\mathcal{N}^{-1}(p), with N\mathcal{N} is the CDF of a unit centered Gaussian random variable.

In the numerical results, we take p=0.999p=0.999 and mm == 2020 neurons. We first begin in dimension d=1d=1, and show in Figure 1 how uu, DxuD_{x}u and Dx2uD_{x}^{2}u are well approximated by the resolution method.

On Figure 2, we check the convergence, for different values of σ^\hat{\sigma} of both the solution uu and its derivative at point xx and date . Standard deviation of the function value is very low and the standard deviation of the derivative still being low.

As the dimension increases, we have to increase the value of σ^\hat{\sigma} of the forward process. In dimension 3, the value σ^=0.5\hat{\sigma}=0.5 gives high standard deviation in the result obtained as shown on Figure 3, while in dimension 10, see Figure 4, we see that the value σ^=1\hat{\sigma}=1 is too low to give good results. We also clearly notice that in 10D, a smaller time step should be used but in our test cases we decided to consider a maximum number of time steps equal to 160.

On this simple test case, the dimension is not a problem and very good results are obtained in dimension 20 or above with only 20 neurons and 2 layers.

3 A linear quadratic stochastic test case.

The Bellman equation associated to this stochastic control problem is:

which can be rewritten as a fully nonlinear equation in the form (1.1) with

An explicit solution to this PDE is given by

where K(t)K(t) is non negative d×dd\times d symmetric matrix function solution to the Riccati equation:

We take T=1T=1. The coefficients of the forward process used to solve the equation are

In our numerical example we take the following parameters for the optimization problem:

and we want to estimate the solution at x=1Idx=1{\rm I}_{d}.

In this example, the truncation operator (indexed by pp between and 11 and close to 11) is as follows:

where ϕp\phi_{p} == N−1(p)\mathcal{N}^{-1}(p), A^\hat{A} is a vector so that A^i=Aii\hat{A}_{i}=A_{ii}, i=1,...,di=1,...,d, 1^\hat{1} is a unit vector, and the square root is taken componentwise.

On Figure 5 we give the solution of the PDE with d=1d=1 using σ^=1.5\hat{\sigma}=1.5 obtained for two dates: at t=0.5t=0.5 and at tt close to zero. We observe that we have a very good estimation of the function value and a correct one of the Γ\Gamma value at date t=0.5t=0.5. The precision remains good for Γ\Gamma close to t=0t=0 and very good for uu and DxuD_{x}u.

On Figure 6, we give the results obtained in dimension d=1d=1 by varying σ^\hat{\sigma}. For a value of σ^=2\hat{\sigma}=2, the standard deviation of the result becomes far higher than with σ^=0.5\hat{\sigma}=0.5 or 1.1.

On Figure 7, for d=3d=3, we take a quite low truncation factor p=0.95p=0.95 and observe that the number of neurons to take has to be rather high. We have also checked that taking a number of hidden layers equal to 3 does not improve the results.

On Figure 8, for d=3d=3, we give the same graphs for a higher truncation factor. As we take a higher truncation factor, the results are improved by taking a higher number of neurons (100100 in the figure below).

On Figure 9, we observe in dimension 7 the influence of the number of neurons on the result for a high truncation factor p=0.999p=0.999. We clearly have a bias for a number of neurons equal to 5050. This bias disappears when the number of neurons increases to 100100.

On Figure 10, for d=7d=7, we check that influence of the truncation factor appears to be slow for higher dimensions.

Finally, we give results in dimension 10, 15 and 20 for p=0.999p=0.999 on Figures 11, 12. We observe that the number a neurons with 2 hidden layers has to increase with the dimension but also that the increase is rather slow in contrast with the case of one hidden layer as theoretically shown in [Pin99]. For σ^=5\hat{\sigma}=5 we had to take 300 neurons to get very accurate results.

4 Monge-Ampère equation

Let us consider the parabolic Monge-Ampère equation

where det(Dx2u){\rm det}(D_{x}^{2}u) is the determinant of the Hessian matrix Dx2uD_{x}^{2}u. It is in the form (1.1) with

We test our algorithm by choosing a C2C^{2} function gg, then compute GG == det(Dx2g){\rm det}(D_{x}^{2}g), and set hh :=:= G−1G-1. Then, by construction, the function

is solution to the Monge-Ampère equation (3.1). We choose g(x)=cos⁡(∑i=1dxi/d)g(x)=\cos(\sum_{i=1}^{d}x_{i}/\sqrt{d}), and we shall train with the forward process XX == x0+Wx_{0}+W, where WW is a dd-dimensional Brownian motion. On this example, we use neural networks with 3 hidden layers, d+10d+10 neurons per layer, and we do not need to apply any truncation to the forward process XX. Actually, we observe that adding a truncation worsens the results. For choosing the truncation level, we first test the method with no truncation before decreasing the quantile parameter pp. In the Monge-Ampère case the best results are obtained without any truncation. It may be caused by the oscillation of the Hessian.

The following table gives the results in dimension dd == 55, 1515, and for TT == 11.

5 Portfolio selection

We consider a portfolio selection problem formulated as follows. There are nn risky assets of uncorrelated price process PP == (P1,…,Pn)(P^{1},\ldots,P^{n}) with dynamics

where WW == (W1,…,Wn)(W^{1},\ldots,W^{n}) is a nn-dimensional Brownian motion, bb == (b1,…,bn)(b^{1},\ldots,b^{n}) is the rate of return of the assets, λ\lambda == (λ1,…,λn)(\lambda^{1},\ldots,\lambda^{n}) is the risk premium of the assets, σ\sigma is a positive function (e.g. σ(v)\sigma(v) == eve^{v} corresponding to the Scott model), and VV == (V1,…,Vn)(V^{1},\ldots,V^{n}) is the volatility factor modeled by an Ornstein-Uhlenbeck (O.U.) process

with κi,θi,νi\kappa_{i},\theta_{i},\nu_{i} >> , and BB == (B1,…,Bn)(B^{1},\ldots,B^{n}) a nn-dimensional Brownian motion, s.t. d<Wi,Bj>d<W^{i},B^{j}> == δijρijdt\delta_{ij}\rho_{ij}dt, with ρi\rho_{i} :=:= ρii\rho_{ii} ∈\in (−1,1)(-1,1). An agent can invest at any time an amount αt\alpha_{t} == (αt1,…,αtn)(\alpha_{t}^{1},\ldots,\alpha_{t}^{n}) in the stocks, which generates a wealth process X{\cal X} == Xα{\cal X}^{\alpha} governed by

The objective of the agent is to maximize her expected utility from terminal wealth:

with a Sharpe ratio R(v)R(v) :=:= ∣λ(v)∣2|\lambda(v)|^{2}, for vv == (v1,…,vn)(v_{1},\ldots,v_{n}) ∈\in (0,∞)n(0,\infty)^{n}. The optimal portfolio strategy is then given in feedback form by αt∗\alpha_{t}^{*} == a^(t,Xt∗,Vt)\hat{a}(t,{\cal X}_{t}^{*},V_{t}), where a^\hat{a} == (a^1,…,a^n)(\hat{a}_{1},\ldots,\hat{a}_{n}) is given by

for ii == 1,…,n1,\ldots,n. This Bellman equation is in the form (1.1) with

The truncation operator indexed by a parameter pp is chosen equal to

where ϕp\phi_{p} == N−1(p)\mathcal{N}^{-1}(p), N\mathcal{N} is the CDF of a unit centered Gaussian random variable. We use neural networks with 2 hidden layers and d+10d+10 neurons per layer. We shall test this example when the utility function UU is of exponential form: U(x)U(x) == −exp⁡(−ηx)-\exp(-\eta x), with η\eta >> , and under different cases for which closed-form solutions are available:

Merton problem. This corresponds to a degenerate case where the factor VV, hence the volatility σ\sigma and the risk premium λ\lambda are constant, so that the generator of Bellman equation reduces to

One risky asset: nn == 11. A quasi-explicit solution is provided in [Zar01]:

where V^st,v\hat{V}_{s}^{t,v} is the solution to the modified O.U. model

We test our algorithm with λ(v)\lambda(v) == λv\lambda v, λ\lambda >> , for which we have an explicit solution:

where (ϕ,ψ,χ)(\phi,\psi,\chi) are solutions of the Riccati system of ODEs:

with κˉ\bar{\kappa} == κ+ρνλ\kappa+\rho\nu\lambda, and explicitly given by (see e.g. Appendix in [SZ99])

with κ^\hat{\kappa} == κ2+2ρνλκ+γ2λ2\sqrt{\kappa^{2}+2\rho\nu\lambda\kappa+\gamma^{2}\lambda^{2}}. We train with the forward process

No leverage effect, i.e., ρi\rho_{i} == , ii == 1,…,n1,\ldots,n. In this case, there is a quasi-explicit solution given by

where Vt,vV^{t,v} is the solution to (3.5), starting from vv at time tt. We test our algorithm with λi(v)\lambda_{i}(v) == λivi\lambda_{i}v_{i}, λi\lambda_{i} >> , ii == 1,…,n1,\ldots,n, vv == (v1,…,vn)(v_{1},\ldots,v_{n}), for which we have an explicit solution given by

with κ^i\hat{\kappa}_{i} == κi2+νi2λi2\sqrt{\kappa_{i}^{2}+\nu_{i}^{2}\lambda_{i}^{2}}. We train with the forward process

Merton Problem. We take η=0.5\eta=0.5, λ=0.6\lambda=0.6, TT == 11, N=120N=120, and σ(v)=ev\sigma(v)=e^{v}. We plot the neural networks approximation of u,Dxu,Dx2u,αu,D_{x}u,D^{2}_{x}u,\alpha (in blue) together with their analytic values (in orange). For comparison with Figures 6 and 7, we report the error on the gradient and the initial control. In practice, after empirical tests, we choose p=0.98p=0.98 for the truncation.

One asset (nn == 11) in Scott volatility model. We take η=0.5\eta=0.5, λ=1.5\lambda=1.5, θ=0.4\theta=0.4, ν=0.4\nu=0.4, κ=1\kappa=1, ρ=−0.7\rho=-0.7. For all tests we choose TT == 11, N=120N=120, and σ(v)=ev\sigma(v)=e^{v}. In practice, after empirical tests, we choose p=0.98p=0.98 for the truncation.

No Leverage in Scott model. In the case with one asset (nn == 11), we take η=0.5\eta=0.5, λ=1.5\lambda=1.5, θ=0.4\theta=0.4, ν=0.2\nu=0.2, κ=1\kappa=1. For all tests we choose TT == 11, N=120N=120, and σ(v)=ev\sigma(v)=e^{v}. In practice, after empirical tests, we choose p=0.95p=0.95 for the truncation.

In the case with four assets (nn == 44, d=5d=5), we take η=0.5\eta=0.5, λ=(1.51.12.0.8)\lambda=\begin{pmatrix}1.5&1.1&2.&0.8\end{pmatrix}, θ=(0.10.20.30.4)\theta=\begin{pmatrix}0.1&0.2&0.3&0.4\end{pmatrix}, ν=(0.20.150.250.31)\nu=\begin{pmatrix}0.2&0.15&0.25&0.31\end{pmatrix}, κ=(1.0.81.11.3)\kappa=\begin{pmatrix}1.&0.8&1.1&1.3\end{pmatrix}.

In the case with seven assets (nn == 77, d=8d=8) we take η=0.5\eta=0.5, λ=(1.51.12.0.80.51.70.9)\lambda=\begin{pmatrix}1.5&1.1&2.&0.8&0.5&1.7&0.9\end{pmatrix}, θ=(0.10.20.30.40.250.150.18)\theta=\begin{pmatrix}0.1&0.2&0.3&0.4&0.25&0.15&0.18\end{pmatrix}, ν=(0.20.150.250.310.40.350.22)\nu=\begin{pmatrix}0.2&0.15&0.25&0.31&0.4&0.35&0.22\end{pmatrix}, κ=(1.0.81.11.30.950.991.02)\kappa=\begin{pmatrix}1.&0.8&1.1&1.3&0.95&0.99&1.02\end{pmatrix}.

In the case with nine assets (nn == 99, d=10d=10), we take η=0.5\eta=0.5, λ=(1.51.12.0.80.51.70.91.0.9)\lambda=\begin{pmatrix}1.5&1.1&2.&0.8&0.5&1.7&0.9&1.&0.9\end{pmatrix}, θ=(0.10.20.30.40.250.150.180.080.91)\theta=\begin{pmatrix}0.1&0.2&0.3&0.4&0.25&0.15&0.18&0.08&0.91\end{pmatrix}, ν=(0.20.150.250.310.40.350.220.40.15)\nu=\begin{pmatrix}0.2&0.15&0.25&0.31&0.4&0.35&0.22&0.4&0.15\end{pmatrix}, κ=(1.0.81.11.30.950.991.021.061.6)\kappa=\begin{pmatrix}1.&0.8&1.1&1.3&0.95&0.99&1.02&1.06&1.6\end{pmatrix}.

Hamilton-Jacobi-Bellman equation from portfolio optimization is a typical example of full-nonlinearity in the second order derivative, and the above results show that our algorithm performs quite well up to dimension dd == 88, but gives a high variance in dimension dd == 1010.

Comparison with an implicit version of the scheme. As explained in Remark 2.2, an alternative option for the estimation of the Hessian is to approximate it by the automatic differentiation of the current neural network for the ZZ component. It corresponds to the replacement of DZ^i+1(T(Xti+1))D\hat{\cal Z}_{i+1}({\cal T}(X_{t_{i+1}})) by DZi(T(Xti));θ)D{\cal Z}_{i}({\cal T}(X_{t_{i}}));\theta) in (2.10). An additional change has to be made to the method for it to work. At the last optimization step (for time step t0=0t_{0}=0), we notice empirically that the variable Γ0\Gamma_{0} is not able to properly learn the initial Hessian value at all. Therefore for this last step we use variables Y0,Z0Y_{0},Z_{0} and an explicit estimation of the second order derivative given by DZ^1(T(Xt1))D\hat{\cal Z}_{1}({\cal T}(X_{t_{1}})). We see in Table 5 that the results for the Merton problem are very similar to the ones from Table 2 for the splitting scheme but with a worse estimation of the Hessian and optimal control (the error is multiplied by around 1.5). When we tested this implicit scheme on the Monge Ampere problem we also faced computational problems during the optimization step of Tensorflow. The numerical computation of the gradient of the objective function for the backpropagation step, more precisely for the determinant part, often gives rise to matrix invertibility errors which stops the algorithm execution. For these two reasons, we focused our study on the explicit scheme.

Comparison with the 2BSDE scheme of [BEJ19]. We conclude this paper with a comparison of our algorithm with the global scheme of [BEJ19], called Deep 2BDSE. The tests below concern the Merton problem (3.10) but similar behavior happens on the other examples with stochastic volatilities. This scheme was implemented in the original paper only for small number of time steps (e.g. NN == 3030). Thus we tested this algorithm on two discretizations, respectively with NN == 2020 and NN == 120120 time steps, as shown in Figure 15, for T=1T=1 where we plotted the learning curve of the Deep BSDE method. These curves correspond to the values taken by the loss function during the gradient descent iterations. For this algorithm the loss function to minimize in the training of neural networks is defined as the mean L2L^{2} error between the generated YNY_{N} value and the true terminal condition g(XN)g(X_{N}). We observe that for this choice of maturity T=1T=1 the loss function oscillates during the training process and does not vanish. As a consequence the Deep 2BSDE does not converge in this case. Even when decreasing the learning rate, we noticed that we cannot obtain the convergence of the scheme.

However, the Deep 2BSDE method does converge for small maturities TT, as illustrated in Table 6 with T=0.1T=0.1 and different values for the number of time steps NN. Nevertheless, even if the value function is well approximated, the estimation of the gradient and control did not converge (the corresponding variance is very large), in comparison with our scheme whereas the gradient is very well approximated and the control is quite precise. We also have a much smaller variance in the results. Table 7 shows the results obtained by our method with T=0.1T=0.1 in order to compare it with the performance of [BEJ19]. It illustrates the limitations of the global approach and justifies our introduction of a local method.

References