1 Introduction

A typical family of differential/integral equations studied in healtcare or in finance is the following one:

$$\begin{aligned} V_t=V_0+\int _0^t \alpha (s,V_s)\textrm{d}s+\int _0^t \sigma (s,V_s)\textrm{d}W_s, \end{aligned}$$
(1)

where \(\textbf{V}=(V_t:0\le t\le T)\) is a d-dimensional quantity, which for example could represent the values of assets in a portfolio and W is a Brownian motion (briefly introduced in the next section).

The above type of equations are an important tool in mathematical finance.

Equation in (1) is the integral version of the equation

$$\begin{aligned} \frac{\textrm{d} V_t}{\textrm{d} t}=\alpha (t, V_t)+\sigma (t,V_t)\frac{\textrm{d} W}{\textrm{d} t}. \end{aligned}$$
(2)

Indeed by operating the integral operator \(f(t)\mapsto \int _0^t f(s)\textrm{d}s\) on the left of (2), we obtain

$$\begin{aligned} \int _0^t\frac{\textrm{d} V_s}{\textrm{d} s}\textrm{d} s=\int _0^t \textrm{d} V_s=V_t-V_0. \end{aligned}$$

By operating the integral operator to the right-hand side of (2), we obtain

$$\begin{aligned} \int _0^t \left( \alpha (s, V_s)+\sigma (s,V_s)\frac{\textrm{d} W}{\textrm{d} s}\right) \textrm{d}s=\int _0^t b(s, V_s)\textrm{d}s+\int _0^t\sigma (s,V_s)\textrm{d} W. \end{aligned}$$

Therefore, we obtain

$$\begin{aligned} V_t-V_0=\int _0^t \alpha (s, VS_s)\textrm{d}s+\int _0^t\sigma (s,VS_s)\textrm{d} W, \end{aligned}$$

that is Eq. (1).

Now we multiply both hand sides of (2) by \(\textrm{d}t\) to obtain the differential equation

$$\begin{aligned} \textrm{d}V_t=\alpha (t,V_t)\textrm{d}t+\sigma (t,V_t)\textrm{d}W. \end{aligned}$$

1.1 Brownian Motions

There are several ways to define what is a Brownian motion. We present the one contained in (Gobet 2022, Definition 4.1.1 at page 120)

Definition 1.1

(Brownian Motion in Dimension 1) A Brownian motion in dimension 1 is a continuous-time stochastic process \(\{W_t; t\ge 0\}\) with a continuous path, such that

  • \(W_0=0\);

  • the time increment \(W_t-W_s\) \((0\le s<t)\) has the Gaussian distribution with zero mean and variance \((t-s)\);

  • for any \(0=t_0<t_1<\ldots <t_n\), the increments \(\{W_{t_{i+1}}-W_{t_i}\mid 0\le i\le n-1\}\) are independent.

A discretization of a Brownian motion is a random walk, or in other words a Brownian motion is the continuous version of a random walk.

One denotes a Brownian motion with the letter W because the mathematical theory of Brownian motions was formalized and studied by Wiener in the middle of the twentieth century. The name “Brownian” comes from the botanist Robert Brown, who used this model of motion (without formalizing it) for describing the movement of a particle (pollen) in water.

Nowadays, Brownian motion is used in finance (e.g., for evaluating assets, portfolio, gains, wealth...) and healtcare, see for example, Donnet and Samson (2013) or Ferrante et al. (2005) in the case of pharmacokinetic/pharmacodynamic models (aka PK/PC models).

Brownian motion has the advantage to be a good tool for modeling in finance by using mathematical models, and so via equations.

The mathematical disadvantage is that a Brownian motion, considered as a function of the time t is continuous but not always derivable. But, this disadvantage turns into an advantage, because it may cover a large set of examples in real-world problems.

Thus, the integral \(\int _a^b f(t) {\textrm{d}W}\) in the case of a Brownian motion W has no meaning in the traditional sense as Riemann–Stieltjes Integral. The notion of Ito’s integral gives a definition for the integral \(\int _a^b f(t) {\textrm{d}W}\) in the case of a Brownian motion W.

1.2 Ito’s Integral and Solutions of Geometric Brownian Motions (GBM)

In this section, we show the definition of Ito’s integral and some of its applications. Everything is considered in dimension 1; thus, every function considered is a function of the time t and assumes values in \(\mathbb {R}\) (real numbers). The extension of the case where the outputs of our functions are d-dimensional vectors in \(\mathbb {R}^d\) is straightforward.

Definition 1.2

(Ito’s Integral) Let f be a continuous function with respect to time t on an interval [ab]. Assume that W is a Brownian motion. Then we define the Ito’s integral of f with respect to W as

$$\begin{aligned} \int _a^bf(t)\textrm{d}W=\lim _{n\rightarrow \infty } \sum _{i=0}^{n-1}f(t_{i})(W_{t_{i+1}}-W_{t_{i}}), \end{aligned}$$

where \(t_0=a<t_1<\ldots<t_{n-1}<t_n=b\) represent the endpoints of a subdivision of the interval [ab] in n subintervals.

One can see that the limit converges in probability.

The condition f continuous can be weakened. Since we are considering t belonging to intervals, we are considering the \(\sigma \)-algebra of borelian on \(\mathbb {R}\) (i.e., the Borel algebra, which is generated by open sets in \(\mathbb {R}\)). In Definition 1.2, it is enough to ask that f is Borel-measurable (preimages of Borel sets are Borel sets). Continuous functions are Borel-measurable, but there are Borel-measurable functions that are not continuous. For example, piecewise functions are Borel-measurable. A more “exotic” example is the indicator function \(\chi _\mathbb {Q}\) (which is 1 in the rational numbers \(\mathbb {Q}\) and zero otherwise), it is a Borel-measurable function even if it is highly non-continuous.

One can find the definition of Ito’s integral in (Shreve 2004, Sect. 4.3, precisely on page 134). In Shreve (2004) the assumption on f is that the function f is an adapted stochastic process, that can be essentially translated into being a Borel-measurable function over time. Alternatively, one can read (Gobet 2022, Sect. 4.2, pages 132–135).

Roughly speaking, Ito’s integral is defined as a Riemann Integral, where we substitute a “linear deterministic variable x” with a stochastic one. So, in other words, we can say that an Ito’s integral is a limit of a sequence of stochastic Riemann’s sums (or in case a stochastic Legesque Integral). But note that, in the definition of Ito’s integral, one always take a “left” stochastic Riemann’s sum.

In Eq. (1), the integral \(\int _0^t \alpha (s,V_s) \textrm{d}s\) is a deterministic one (i.e., no random variable appears), thus this is Riemann’s integral (or Lebesgue’s one). The integral \(\int _0^t \sigma (s,V_s) \textrm{d}W_s\) is an Ito’s one.

For a given realization (or simulation) of the Brownian motion \(W_t\), it is possible to determine an approximation for \(V_t\). But sometimes, an exact value for the deterministic integral or an exact value of the Ito’s integral are not determinable. It is always possible to give an approximated value for the integrals.

For some special cases, it is possible to find exact solutions of the equation in (1), for example, in the case of a Brownian motion, where \(\alpha \) and \(\sigma \) are constant. If so, the function \(V_t\) is (1) is called geometric Brownian motion.

As a straightforward application of Ito’s formula (see for example, (Shreve 2004, Theorem 4.4.1, p. 138), or (Gobet 2022, Theorem 4.2.5 p. 137) for a more general formulation) proves that

$$\begin{aligned} V_t=V_0\cdot e^{\left( \alpha -\frac{\sigma ^2}{2}\right) t+\sigma \cdot W_t} \end{aligned}$$

is the solution of the Eq. (1) in the case \(V_t\) is a geometric Brownian motion.

1.3 Existence of Solutions of Stochastic Differential Equations

Under certain hypotheses, Eq. (1) admits a solution, which is unique. This was proven by Pardoux and Peng in Pardoux and Peng (1990).

Theorem 1.1

(Pardoux and Peng 1990) Let W be a Brownian motion and \(\alpha , \sigma \) the functions of Eq. (1). Let \(T>0\) be a given real number. Suppose that \(\alpha , \sigma \) are continuous functions and there exist a constant \(C_{\alpha ,\sigma }\) (depending of \(\alpha \) and \(\sigma \)) such that, for all \(t\in [0, T]\) and xy, we have

  • \(|\alpha (t,x)-\alpha (t,y)|+|\sigma (t,x)-\sigma (t,y)|\le C_{\alpha ,\sigma }|x-y|\);

  • \(\sup _{0\le t\le T}\left( |\alpha (t,0)|+|\sigma (t,0)|\right) \le C_{\alpha ,\sigma }\).

Then, for each \(V_0\in \mathbb {R}\), there exists a unique solution of Eq. (1).

Unfortunately, the above theorem does not give a method for determining the solution for the Eq. (1). In some cases, for example, for geometric Brownian motion, the solution is explicitly determinable. But in general, there is no general approach for solving all equations of the shape as in (1). Only in a few cases, we are able to apply an algorithm or formula for solving exactly a stochastic differential equation.

The conditions contained in the above theorem are “uniform Lipschitz conditions”. This is not so surprising. For deterministic equations and so ordinary differential equations, the Picard–Lindelöff Theorem requires Lipschitz condition as well (recall that the Picard–Lindelöff Theorem gives sufficient conditions for the existence and uniqueness of ordinary first-degree differential equations). Actually, the proof in the stochastic case of SDEs looks like the analogous of the ODEs case, where there is a somewhat fixed point theorem. In the Picard–Lindelöff Theorem, the Banach–Caccipoli’s fixed point theorem is used.

In Theorem 1.1, they use a fixed point theorem. The proof could inspire a way to find a method for finding a numerical approximation of the solution, which is not so efficient. For more details about the proof of Theorem 1.1, see for example, Pardoux and Peng (1990) or Ma and Zhang (2002).

2 Numerical Methods for SDEs

Theorem 1.1 only provides the assumptions that Eq. (1), equipped by the initial value \(V(0)=V_0\), for the existence and uniqueness of its solution. However, this result is only qualitative and does not provide any methodological tool to compute such a solution. It is also worth highlighting that analytical solutions to SDEs can only be provided for a limited amount of simple cases; the most realistic ones, due to their complex structure, can only be numerically solved. The design and the analysis of reliable, efficient, and accurate numerical methods for SDEs have attracted the literature of the last couple of decades. A very brief—and far from being exhaustive—list of references contains Bouchard and Touzi (2004), Gobet et al. (2005), Arnold (1974), Buckwar and D’Ambrosio (2021), Buckwar et al. (2005), Buckwar et al. (2010), Burrage and Burrage (2012), Burrage and Burrage (2014), Burrage and Tian (2004), Chen et al. (2020), D’Ambrosio and Giovacchino (2021a), D’Ambrosio and Giovacchino (2021b), D’Ambrosio and Scalone (2021b), Fang and Giles (2020), Vom Scheidt (1989), Gardiner (2004), Higham (2001), Higham (2000), Higham (2021), Higham and Kloeden (2005), Hutzenthaler and Jentzen (2015), Hutzenthaler et al. (2011), Kloeden (2002), Kloeden and Platen (1992), Ma et al. (2012), Mao (2007), Melbø and Higham (2004), Saito and Mitsui (1996), Milstein (1994), Milstein et al. (2002), Misawa (2000), Neuenkirch et al. (2019), Rössler (2010), Rössler (2009), Rössler (2006), Ruemelin (1982), Abdulle et al. (2014), Chartier et al. (2014), Abdulle et al. (2013), Abdulle et al. (2012), Cohen and Vilmart (2022), Chen et al. (2016), Cohen and Dujardin (2014), Cohen (2012), de la Cruz (2020), de la Cruz et al. (2019), de la Cruz et al. (2017), Jimenez and de la Cruz Cancino (2012), de la Cruz et al. (2010) and references therein. In the remainder of the treatise, we aim to provide a few examples of such methods taken from the most famous ones. Anyway, before listing specific methods, let us recover two fundamental notions in stochastic numerics, that provide a measure for the accuracy of the corresponding scheme: the concepts of strong and weak convergence.

Given the uniform partition

$$\begin{aligned} \mathscr {I}_h = \{t_n=nh, \quad n=0,1,\dots ,N= T/h\} \end{aligned}$$
(3)

of the interval \(I = [0, T]\); let us denote by \(V_n\) the numerical solution to (1) in the point \(t_n\), computed by a given numerical scheme. The main question is the following: how far is the numerical solution from the exact one? Does the gap between them collapse as N goes to infinity? The following definition (see Kloeden and Platen 1992; Higham 2001, 2021 and references therein) helps clarify this scenario.

Definition 2.1

Given a numerical method computing \(X_n\approx X(t_n)\), with \(t_n\in \mathscr {I}_h\), we say that the method

  • is strongly convergent with strong order p if there exist three positive constants C, p and \(h^*\) such that

    $$\begin{aligned} \sup _{t_n\in \ \mathscr {I}_h}\mathbb {E}\bigg [ \big | X_n-X(t_n)\big | \bigg ] \le Ch^p, \end{aligned}$$
    (4)

    for any \(h\le h^*\). The strong order p is the biggest number such that (4) holds true;

  • chosen a functional space S and given \(\Phi \in S\), we say that the methods are weakly convergent with weak order q if there exist three positive constants D, q, and \(\widetilde{h}\) such that

    $$\begin{aligned} \sup _{ t_n \in \ \mathscr {I}_h} \bigg | \mathbb {E}\big [\Phi \left( X_n\right) \big ]-\mathbb {E}\big [ \Phi \left( X(t_n)\right) \big ]\bigg |\le Dh^q, \end{aligned}$$
    (5)

    for any \(h\le \widetilde{h}\). The weak order q is the biggest number such that (5) holds true.

Usually, S is the space of algebraic polynomials of degree q. In other terms, Definition 2.1 gives two possible measures for the accuracy of a stochastic numerical method: the expected error (strong convergence) and the gap between the expectations of the numerical and the exact solutions (weak convergence). One can prove that strong convergence implies weak convergence, while the vice versa is generally not true.

2.1 Euler–Maruyama Method

The simplest numerical method for deterministic differential equations \(y'(t)=f(t,y(t))\) (i.e., the famous Euler method) is obtained by means of truncated Taylor series arguments as follows. First of all, let us compute

$$\begin{aligned} \begin{aligned} y(t_{n+1})&=y(t_n+h)=y(t_n)+hy'(t_n)+\mathscr {O}(h^2)\\&=y(t_n)+hf(t_n,y(t_n))+\mathscr {O}(h^2). \end{aligned} \end{aligned}$$

Neglecting the term \(\mathscr {O}(h^2)\) and reading the corresponding approximate equality among exact values as an exact equality among approximate values yields

$$\begin{aligned} y_{n+1}=y_n+hf(t_n,y_n), \quad n=0,1,\ldots ,N. \end{aligned}$$
(6)

Last equality provides the nonlinear difference equation defining the Euler method. Clearly, solving such a nonlinear difference equation is not simpler than solving the original ODE and, indeed, it is used to start a step-by-step procedure for the pointwise computation of the numerical solution.

This approach does not directly apply to SDEs, due to the nowhere differentiability of the involved stochastic processes. However, Taylor expansions generalize in the so-called Ito–Taylor expansions, thanks to the Ito formula. Indeed, specifying (1) to a subinterval \([t_n,t_{n+1})\) of the discretization \(\mathscr {I}_h\) leads to

$$\begin{aligned} V(t_{n+1})=V(t_n)+\int _{t_n}^{t_{n+1}} \alpha (s,V(s))\textrm{d}s+\int _{t_n}^{t_{n+1}} \sigma (s,V(s))\textrm{d}W(s). \end{aligned}$$

Computing \(\alpha (s,V(s))\) and \(\sigma (s,V(s))\) by the Ito formula and considering only the very first term, i.e., \(\alpha (s,V(s))\approx \alpha (t_n,V(t_n))\) and \(\beta (s,V(s))\approx \alpha (t_{n+1},V(t_{n+1}))\), yields

$$\begin{aligned} V(t_{n+1})\approx V(t_n)+h \alpha (t_n,V(t_n))+\sigma (t_n,V(t_n))\Delta W_n, \end{aligned}$$

with \(\Delta W_n=W(t_{n+1})-W(t_n)\) (it is worth recalling that, by definition of the Wiener process, \(\Delta W_n\) is a normal random variable with 0 mean and variance h). Recasting this approximate equality among exact values as an exact equality among approximate values get

$$\begin{aligned} V_{n+1}=V_n+\alpha (t_n,V_n)h+\sigma (t_n,V_n)\Delta W_n. \end{aligned}$$
(7)

Equation (7) gives the so-called Euler–Maruyama method for SDEs. Clearly, if the diffusion coefficient \(\sigma \) is identically zero (i.e., the problem is deterministic), then the Euler–Maruyama method (7) recovers the deterministic Euler method (6).

One can prove that the strong order of the Euler–Maruyama method is \(p=1/2\), while its weak order is \(q=1\). For a formal proof of the strong and weak convergence of the Euler–Maruyama method, the interested reader can refer to Higham (2021) and references therein.

2.2 \(\vartheta \)–Maruyama Methods

The Euler method can be merged into a larger family of methods, well-known as \(\vartheta \) –Maruyama methods (see, for instance, Buckwar and Sickenberger 2011; D’Ambrosio and Giovacchino 2021a; D’Ambrosio and Scalone 2021a; Higham 2000, 2021 and references therein). The starting point to develop \(\vartheta \)-Maruyama methods is similar to that for Euler–Maruyama method, i.e.,

$$\begin{aligned} V(t_{n+1})=V(t_n)+\int _{t_n}^{t_{n+1}} \alpha (s,V(s))\textrm{d}s+\int _{t_n}^{t_{n+1}} \sigma (s,V(s))\textrm{d}W(s), \end{aligned}$$

but the deterministic integral is approximated by the following quadrature formula:

$$\begin{aligned} \int _{t_n}^{t_{n+1}} f(t,X(t))\text {d}t = \big [ (1-\vartheta )f(t_n, X(t_n))+\vartheta f(t_{n+1},X(t_{n+1}))\big ]\Delta t. \end{aligned}$$

Then, the corresponding approximate solution to (1) is given by

$$\begin{aligned} V_{n+1}=V_n+(1-\vartheta )h\alpha (t_n,V_n)+\vartheta h\alpha (t_{n+1},V_{n+1})+\sigma (t_n, X_n)\Delta W_n, \end{aligned}$$
(8)

\(n=0,1,\ldots ,N-1\). Equation (8) collects the family of \(\vartheta \)–Maruyama methods. Relevant cases are given for \(\vartheta =0\), leading to Euler–Maruyama method, for \(\vartheta =1/2\), leading to the stochastic trapezoidal method and \(\vartheta =1\), leading to the stochastic implicit Euler method. It has been proved (see Higham 2021 and reference therein) that all \(\vartheta \)–Maruyama methods have a strong order 1/2 and weak order 1, as it happens for Euler–Maruyama method. However, even if the accuracy is the same, selecting proper values of \(\vartheta \) may provide very good stability improvements (Buckwar and Sickenberger 2011; Higham 2000; D’Ambrosio and Giovacchino 2021a).

2.3 Stochastic Runge–Kutta Methods

The relevant class of Runge–Kutta methods has its own stochastic counterpart in the family of stochastic Runge–Kutta methods (SRK; see, for instance, Buckwar et al. 2010; Burrage and Burrage 2012, 2014; Burrage and Tian 2004; D’Ambrosio and Giovacchino 2021b; Ma et al. 2012; Rössler 2010, 2009, 2006 and references therein). In this section, we look at SRK methods for (1) as the stochastic perturbation of deterministic Runge–Kutta methods as follows:

$$\begin{aligned} V_{n+1}=V_n+h\displaystyle \sum _{i=1}^{s}b_i \alpha (t_n+c_ih, \widehat{V}_i)+\Delta W_n \displaystyle \sum _{i=1}^{s}d_i \sigma (t_i+c_i\Delta t,\widehat{V}_i), \end{aligned}$$
(9)

with

$$\begin{aligned} \widehat{V}_{i} = V_n+h\displaystyle \sum _{j=1}^{s}a_{ij}\alpha (t_n+c_jh, \widehat{V}_j) + \Delta W_n \displaystyle \sum _{j=1}^{s}\gamma _{ij} \sigma (t_i+c_j\Delta t,\widehat{V}_j), \quad i=1,2,\ldots ,s. \end{aligned}$$
(10)

The number s appearing above is the number of internal stages and an s-stage SRK method in the form (9)–(10) is uniquely identified by its coefficients \(b_i\), \(d_i\), \(a_{ij}\), and \(\gamma _{ij}\), \(i,j=1,2,\ldots ,s\), that can be collected in the following Butcher tableau:

$$\begin{aligned} \begin{array}{c|cccc|cccc} c_1 &{} a_{11} &{} a_{12} &{} \ldots &{}a_{1s} &{} \gamma _{11} &{} \gamma _{12} &{} \ldots &{}\gamma _{1s}\\ c_2 &{} a_{21} &{} a_{22} &{} \ldots &{}a_{2s}&{} \gamma _{21} &{} \gamma _{22} &{} \ldots &{}\gamma _{2s}\\ \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{}\vdots \\ c_s &{} a_{s1} &{} a_{s2} &{} \ldots &{}a_{ss} &{} \gamma _{s1} &{} \gamma _{s2} &{} \ldots &{}\gamma _{ss} \\ [-0.5cm] &{}&{}&{}&{}&{}&{}&{}&{}\\ \hline &{} b_{1} &{} b_{2} &{} \ldots &{}b_{s} &{} d_{1} &{} d_{2} &{} \ldots &{}d_{s} \end{array}. \end{aligned}$$
(11)

The internal stages \( \widehat{V}_{i}\), \(i=1,2,\ldots ,s,\) provide approximations to \(V(t_n+c_ih)\) and the way they relate to each other makes the corresponding methods implicit or explicit. Explicit methods, i.e., with \(a_{ij} = \gamma _{ij} = 0\) for \(j \ge i\), have been developed in Vom Scheidt (1989); Ruemelin (1982) and provided the condition for the mean-square convergence

$$\begin{aligned} \displaystyle \sum _{i=1}^{s}b_i = \displaystyle \sum _{i=1}^{s}d_i =1. \end{aligned}$$

Further results, including the development and analysis of implicit methods, have been investigated in Buckwar et al. (2010), Burrage and Burrage (2012), Burrage and Tian (2004), D’Ambrosio and Giovacchino (2021b), Rössler (2010), Rössler (2009), Rössler (2006) and references therein. A two-step generalization of stochastic Runge–Kutta methods has been introduced and analyzed in D’Ambrosio and Scalone (2021b).

3 A Numerical Evidence on PK/PD Models

Let us now provide a brief selection of numerical experiments showing the effectiveness of the aforementioned approaches. The test is focused on the application of \(\vartheta \) methods (8) to the following pharmacokinetic/pharmacodynamic (PK/PD) models, given by the stochastic Gompertz PD model of the bacterial count under the effect of an antibiotic Ferrante et al. (2005)

$$\begin{aligned} \text {d}N_t=(r-b\log (N_t)-kC_t)N_t\text {d}t+\gamma N_t \text {d}W_t, \end{aligned}$$
(12)

where r is the intrinsic growth rate, b is the growth deceleration rate, k is the bacterial effect of the drug, and \(\gamma \) is a constant parameter. This equation is coupled with a deterministic constraint on the antibiotic concentration \(C_t\), given by

$$\begin{aligned} C_t=\frac{Dk_a}{V(k_a-k_e)}\left( \text {e}^{-k_e t}-\text {e}^{-k_a t}\right) , \end{aligned}$$
(13)

where D is the dose of antibiotic, V the volume of distribution, \(k_a\) and \(k_e\) are the absorption and elimination constants, respectively. The profile of the numerical solution of the overall PK/PD model (12)–(13) is depicted in Fig. 1. Such a graph is obtained by applying the \(\vartheta \) method (8) with \(\vartheta =1/2\) and shows the usual functional Gompertzian growth, in coherence with the behavior expected from the model.

Fig. 1
figure 1

Numerical solution of the PK/PD model (12)–(13), computed by the \(\vartheta \) method (8) with \(\vartheta =1/2\), with \(D=1\), \(k_a=0.1\), \(k_e=0.2\), \(V=10\), \(r=0.1\), \(b=0.2\), \(k=0.1\), \(\gamma =1\)