Adaptive Time-Stepping Using Control Theory for the Chemical Langevin Equation

Stochastic modeling of biochemical systems has been the subject of intense research in recent years due to the large number of important applications of these systems. A critical stochastic model of well-stirred biochemical systems in the regime of relatively large molecular numbers, far from the thermodynamic limit, is the chemical Langevin equation. This model is represented as a system of stochastic differential equations, with multiplicative and noncommutative noise. Often biochemical systems in applications evolve on multiple time-scales; examples include slow transcription and fast dimerization reactions. The existence of multiple time-scales leads to mathematical stiffness, which is a major challenge for the numerical simulation. Consequently, there is a demand for efficient and accurate numerical methods to approximate the solution of these models. In this paper, we design an adaptive time-stepping method, based on control theory, for the numerical solution of the chemical Langevin equation. The underlying approximation method is the Milstein scheme. The adaptive strategy is tested on several models of interest and is shown to have improved efficiency and accuracy compared with the existing variable and constant-step methods.


Introduction
Stochastic modelling is essential for studying key biological processes, such as signaling chemical pathways in a cell, when some molecular species are in low numbers. The random fluctuations due to low amounts of certain biochemically reacting species have been observed experimentally [1][2][3]. Mathematically, the behaviour of such biochemical systems is accurately described in terms of Markov processes. For systems which may be assumed to be well-stirred, the dynamics of the system is governed by the chemical master equation [4]. While exact simulation algorithms for the chemical master equation exist in the literature [5,6] they are typically quite intensive computationally, and therefore approximate simulation strategies were proposed [7][8][9][10]. However, the level of detail provided by the chemical master equation is often not necessary. In particular, when all reacting species are present in relatively large numbers, an approximate model, the chemical Langevin equation [11], is more computationally attractive to simulate that the chemical master equation.
The chemical Langevin equation (CLE) is a stochastic differential equation (SDE) of dimension equal to the number of reacting biochemical species in the system. It has noncommutative multiplicative noise. Moreover, the biochemical systems arising in applications usually evolve on several time scales, meaning their models are mathematically stiff. Stiffness is a serious challenge for the numerical solution of deterministic models, and even more so of stochastic ones. Indeed, in the regions where the problem is stiff, the explicit numerical integrators are forced to drastically reduce the time-step to satisfy the accuracy criteria. This leads to a highly inefficient simulation when fixed step size algorithms are employed. By contrast, adaptive timestepping strategies reduce the step size in the regions where stiffness is present such that the error is maintained below the required tolerance, but relax the time-step as soon as the integration exists these regions. This significantly reduces the computational cost of the simulation, while preserving the desired accuracy of the numerical solution. In the literature, the numerical solution of the chemical Langevin equation is generally computed using the Milstein scheme [12,13]. The Milstein scheme is a strong order one numerical method [14]. Gaines and Lyons [15] proved that numerical techniques of at least strong order of accuracy one are required to guarantee that the numerical solution computed with adaptive time-stepping strategies converges to the exact solution for noncommutative SDE and in particular for the CLE.
Techniques for adapting the time-step for the weak solution of stochastic differential equations were proposed by Szepessy et al. [16]. For the strong numerical solution of stochastic differential equations with multidimensional Wiener processes, most of the existing adaptive time-stepping strategies were designed for systems with commutative noise (see [17][18][19]). Gaines and Lyons [15] developed an adaptive scheme for the strong solution of SDE, but the scheme is quite restrictive. It is based on a Brownian tree structure and the only variations in the step size allowed are doubling or halving. We note that the chemical Langevin equation belongs to the class of noncommutative SDEs, which are more challenging to solve numerically. A variable timestepping method for the chemical Langevin equation using the Brownian tree structure of Gaines and Lyons [15] was introduced by Sotiropoulos and Kaznessis [20] and showed to be expensive. Ilie and Teslya [21] developed an adaptive technique for the mean-square numerical solution of the chemical Langevin equation with small noise. This paper proposes a variable time-stepping strategy for the strong numerical solution of the chemical Langevin equation, based on proportional integral-(PI-) control. Similar to the existing adaptive methods [13,20,21], we employ the Milstein scheme to advance the integration. The technique uses estimates of the local error, based on the work by Sotiropoulos and Kaznessis [20]. This variable time-stepping method may be applied to any biochemical system which can be modelled with the chemical Langevin equation, having an arbitrary magnitude of the random fluctuations. To the best of our knowledge, this is the first PI-controller for noncommutative stochastic differential equations. This approach extends to a class of noncommutative Itô SDE, the chemical Langevin equation model, and the work on PI-controllers for ODE by Söderlind [22,23] and for commutative Stratonovich SDE by Burrage et al. [17]. In addition, the PI-control of the step size outperforms the integral-(I-) control considered by the previous works for the chemical Langevin equation [13,21]. Finally, our strategy allows rejection of the time-step when the error is above the tolerance, while guaranteeing that the statistics of the numerical solution is not biased.
An outline of the paper is given below. Section 2 presents a stochastic continuous model of well-stirred biochemical kinetics, the chemical Langevin equation. Section 3 gives a brief description of the strong numerical solution of Itô stochastic differential equations. In Section 4, we design an adaptive numerical technique for the chemical Langevin equation. The advantages of the proposed variable step size method over the existing methods are illustrated on several models of biochemical systems of interest in applications, in Section 5. The conclusions are given in Section 6.

Assume
biochemical species 1 , . . . , participate in reaction channels 1 , . . . , . The biochemical system, held at constant temperature, is homogeneous. The system state at time ≥ 0 is denoted by X( ) = [ 1 ( ), . . . , ( )] , where ( ) represents the number of molecules at time , for any = 1, . . . , . Mathematically, the system state is modelled as a Markov process. When one reaction fires, the state of the system is updated using a vector^called the state-change vector corresponding to the reaction . This is andimensional vector with entries ] , denoting the variation in the molecular species caused by one reaction . Then, = {] } 1≤ ≤ ,1≤ ≤ is the stoichiometric matrix of the biochemical system. To each reaction it corresponds a propensity (x) defined as follows: for an infinitesimal time increment , (x) is the probability that, given the state x at time , one reaction happens during [ , + ).
For a unimolecular reaction the propensity function is (X) = , while for a bimolecular reaction the propensity is of the form (X) = when ̸ = and (X) = ( − 1)/2 when = . The system state may be represented as where are independent unit rate Poisson processes [24]. Assume that the leap condition is satisfied: there exists a time step ℎ small enough such that for each 1 ≤ ≤ . Under this assumption, the representation (3) may be approximated by Equation (5), due to Gillespie, is known as the tau-leaping formula [8]. A further reduction is possible if, in addition, ℎ may be chosen large enough such that each reaction fires many times in the interval [ , + ℎ]. More precisely, ℎ exists such that (X ( )) ℎ ≫ 1 for any 1 ≤ ≤ . A step size ℎ exists for which conditions (4) and (6) are simultaneously satisfied when all molecular species are present in large amounts in the biochemical system. In this case, the Poisson variables in (5) may be approximated by normal random variables with the same mean and variance, since (6) holds. Consequently, the tau-leaping formula (5) yields where (0, 1) are normal random variables with mean 0 and variance 1. Regarding the step-size ℎ as an infinitesimal in (7) leads to the following equation: where ( ) 1≤ ≤ are independent Wiener processes. Equation (8) is called the chemical Langevin equation (CLE) [11]. It is a noncommutative Itô SDE with multiplicative noise. Note that the dynamical state of the system X( ) is represented in (8) as a continuous Markov process.

Numerical Methods for SDE
Consider a general system of Itô stochastic differential equations driven by an -dimensional Wiener process, = ( 1 , 2 , . . . , ), in the form In the differential equation (9), X denotes an -dimensional stochastic process and ( , X( )) and ( , X( )) aredimensional drift and diffusion coefficients, respectively. The initial condition is The SDE is assumed to have noncommutative noise, as is the case of the chemical Langevin equation model. If the differential operator is defined as then the SDE is called noncommutative if for some 1 , 2 = 1, . . . , , with 1 ̸ = 2 , It is called a commutative SDE otherwise (see [14, p. 348]). Below, we discuss briefly the strong numerical solution of SDE, with a focus on a numerical method of strong order of accuracy one. The strong numerical solution of an SDE is computed when approximations of the exact solution of individual paths are of interest. By contrast, when the approximation of the moments of the exact solution are desired, weak numerical approximations are employed.
The numerical approximation on [0, ] of the exact solution X( ) of (9), after steps with step-size ℎ = / , is denoted by X . This approximation is said to have strong order of convergence > 0 if there exists a constant > 0, independent of ℎ and > 0, such that the following inequality holds for any ℎ ∈ (0, ): where ‖ ⋅ ‖ is some norm of a vector of dimension and (⋅) is the expectation of a random variable. Numerical methods of strong order of accuracy 1 for a noncommutative SDE require, on each subinterval on each interval [ , + ℎ], the simulation of the Wiener increments and of either the double Itô integrals [19], or the Levy areas.
Approximations of the double Itô integrals , for 1 ≤ , ≤ , using the truncation after terms of their Karhunen-Loève or Fourier series expansion [14, p. 198-203] (see also [19]), are computed as For 1 ≤ , ≤ , and 1 ≤ ≤ , are independent normally distributed random variables with mean 0 and variance 1. Here the following notation is used: An accurate simulation of the double Itô integrals requires a minimum value = 5 (see also [19]). Now, let us introduce a numerical method of strong order of accuracy 1, typically used in the literature to simulate the CLE, namely, the Milstein scheme [14]. The Milstein method on the time interval [ , + ℎ] computes

Variable Step-Size Control in the Simulation of the Chemical Langevin Equation
An adaptive time-stepping technique for the strong (pathwise) numerical solution of the chemical Langevin equation is proposed below. The underlying numerical technique is the Milstein scheme. Since the Milstein method is of strong order of accuracy one, numerical solutions employing it on variable time-step meshes converge to the exact solution of the chemical Langevin equation, as the step size converges to zero [15]. Recall that the CLE is a noncommutative SDE; hence the adaptive schemes developed in [17,19] for commutative SDE do not apply. While the Brownian tree approach to adaptivity due to Gaines and Lyons [15] may be utilized, it has been shown to be quite expensive by Sotiropoulos and Kaznessis [20]. For the proposed method, the sequence of time steps depends on the particular trajectory and is obtained using proportional-integral-(PI-) control [22].
Step rejections are allowed when the error is above the prescribed tolerance. When a step is rejected, we apply a strategy that guarantees that the correct Brownian path is followed [13,19]. This strategy ensures that the numerical solution is not biased.

Milstein Scheme for the Chemical Langevin Equation.
We will apply below a numerical technique, due to Milstein, to the stochastic model of well-stirred biochemical kinetics considered above. Remark that the chemical Langevin equation (8) is an Itô SDE of the form (9), with the drift coefficient of the form (20) and the diffusion coefficients Substituting the drift (20) and diffusion coefficients (21) for any = 1, . . . , .
In this paper we adhere to the usual practice of controlling the local error. The accuracy criterion is the local error on each Brownian path that, over each step, should be below the user-prescribed tolerance. Hence, the numerical integration may generate different time-step sequences on different paths. To apply the above error criterion, accurate estimates of the (pathwise) local error need to be computed. Let (X , ℎ , Δ ) be the estimation of the local error for the time interval [ , +1 ], on some Brownian trajectory. The local error may be approximated by the sum of a drift part and a diffusion part. The drift term of the local error is estimated by for a drift (X) given by (20). According to Sotiropoulos and Kaznessis [20], one can estimate the diffusion part of the pathwise local error produced by the Milstein scheme as with and being the Jacobian of . Here Δ ,(3) denotes a column vector with the th entry being (Δ ) 3 .

4.2.
Adaptive PI-Control for CLE. The local error committed by the discretization method, the Milstein scheme (22), for the CLE is required to be smaller than a prescribed tolerance, , at each step and on each Brownian path; that is, Before describing the proposed adaptive time-stepping strategy, let us discuss the important problem of step rejection in the numerical integration of an SDE, when the desired accuracy is not achieved. For SDE, a step rejection must be performed such that the statistics of the approximate solution is not biased. More precisely, when the numerical solution is advanced on a particular Brownian path and a step is rejected as it failed to satisfy the accuracy requirement, the subsequent steps must be chosen such that the same Brownian path is maintained. In this work, this is achieved using a Brownian bridge [18]. If the step ℎ is tried and rejected on the current interval, [ , + ℎ], its corresponding Wiener increments, were sampled. Denote the sampled value Δ ℎ = ℎ . Then, a smaller time-step is tried, < ℎ, and the corresponding Wiener increments on the subintervals [ , + ] and [ + , +ℎ] are created Δ = ( + ) − ( ) , Journal of Applied Mathematics 5 To ensure that the integration preserves the already created Brownian path, a Brownian bridge is employed: Here denotes a new normally distributed random variable with mean 0 and variance 1.
One step-size change method is the integral-(I-) controller for predicting the future step, ℎ +1 , based on the current step ℎ and the current local error (X , ℎ , Δ ). The I-controller is for some constant K. The safety factor ≤ 1 is introduced to reduce the number of rejected steps. The values considered in our simulations are = 0.8 and K = 2. Nonetheless, some step rejects may occur since the local error depends on the particular Brownian path; hence the principal error function has random values.
To reduce the number of step rejections, we propose a proportional integral-(PI-) controller for varying the step size in the numerical CLE solving. Based on control theory, these PI-controllers present several advantages over the classical I-controllers, including improved efficiency and computational stability of the numerical solution. For more details on the control theory approach to adaptive timestepping, we refer the reader to [22].
The PI-controller is given by For a further reduction of number of step rejections, the adaptive algorithm employs a more conservative approach to controlling the time-step: which is similar to an adaptive procedure for the numerical solution of ODE [25]. Note that the factors max > 1 and min < 1 ensure that the next step does not increase or decrease too much, so that fewer steps are rejected. A similar conservative technique is applied to the I-controller (30).
The characteristic equation of the PI-controller (31) is Here is the order of the local error, ( , ℎ , Δ ) = ℎ , where is the principal error function. For the PI-controller to be stable, the roots of its characteristic polynomial should be located inside the unit circle [22]. The parameters , referred to as the integral gain, and , known as the proportional gain, are chosen to obtain the desired properties of the controller.
Numerical testing on many problems showed that the following parameter values of the PI-controller give excellent results for mildly stiff models of biochemical systems: ( , ) = (0.1, 0.2). Remark that the controller is stable, since its roots are within the unit circle. The PI-controllers for ODE, which were designed to produce smooth sequences of time-steps, do not perform well on SDE, where the goals are to increase the accuracy and reduce the number of rejected steps.

Numerical Experiments
We test the adaptive time-stepping technique, based on control theory, developed above for solving numerically the CLE on three interesting models of biochemical systems. The performance of the PI-controllers is compared to that of the I-controller and of the existing constant-step methods. The comparison is done as follows: for each of the PI-or I-controller the algorithm is run with a certain tolerance and the number of attempted (i.e., of accepted and rejected) steps is stored. Then the fixed step size method is applied with the largest number of attempted steps, between the Iand PI-adaptive schemes, and its local error is measured. In our experiments, we choose the following values for the parameters: min = 0.5 and max = 2.
In order to validate the accuracy of our variable step size strategy for the numerical solution of the CLE, we compare the histogram generated with our scheme for the CLE with that computed with the exact algorithm for the chemical master equation due to Gillespie [5,6]. Although chemical Langevin equation approximates the chemical master equation (CME) model, and thus some error in modelling exists, we obtain a very good agreement between the histograms using Gillespie's algorithm for the CME and our adaptive strategy for the CLE. This shows the excellent accuracy of the proposed method.
has as columns the state-change vectors of the reactions above. The system parameters are as follows: 1 = 100, 2 = 10 4 , 3 = 10 −4 , 4 = 10 −2 , 5 = 10, and 6 = 10 3 for the reaction rate constants, and (0) = [100, 1000, 100] for the initial conditions. The interval of integration is [0, 2 × 10 −2 ]. We simulated 10, 000 trajectories with the integral (I), the proposed proportional integral-(PI-) adaptive and the fixed step size algorithms of the CLE for the sequence of tolerances 1, 10 −1 , and 10 −2 . The total number of attempted, accepted, and rejected steps as well as the corresponding errors is stored in Table 1. Also, we present the error generated with the fixed time-step method with the same total number of steps as the most expensive between I-and the PI-strategies, for the same tolerance. Remark that the PI-controller takes fewer attempted steps compared with the I-controller, for the same , being thus more efficient. The ratio of rejected to attempted steps for the PI-adaptive scheme ranges from 5% to 8% and it decreases as the tolerance decreases. For the I-adaptive technique the same ratio of rejected to attempted steps is much larger, between 20% and 30% for the tolerances tried. The fixed step size method produces a local error of up to 100 times larger than the adaptive methods, for the same computational cost.
To verify the accuracy of the proposed PI-controller for adapting the time-step when simulating the CLE, we compare the histograms at time = 2×10 −2 obtained with the Milstein PI-adaptive scheme and the Gillespie algorithms, respectively. The histograms, plotted in Figure 1, show an excellent agreement between our method and the exact algorithm; consequently our scheme is very accurate.

Schlögl
Model. The Schlögl model [26] is well-known for its bistable behavior. While for the reaction rate equation model the trajectories converge to one of the two stable states, for the chemical Langevin equation, the trajectories may switch between the two stable states due to the noise in the system.
The Schlögl model consists of the following reactions: The reaction rate constants take the values 1 = 3 × 10 −7 , ] .
The reaction propensities may be computed as The numbers of molecules of the species and have constant values, = 10 5 and = 2×10 5 . The initial condition for the molecular number of the species is (0) = 250.
The system is integrated on the time-interval [0, 40]. The simulations of our PI-adaptive, the existing I-adaptive, and the constant-step schemes used for the CLE and of the SSA are done for 10,000 trajectories. The total number of attempted, accepted, and rejected steps and the measured error for the proposed PI-adaptive and the I-adaptive algorithms, as well as the error committed by the constant-step scheme, are depicted in Table 2 error of up to 19 smaller than that of the fixed-step-size method. Furthermore, the ratio of the number of rejected steps to the total number of steps tried for our PI-controlled time-step method is very small, between 3% and 5%, while for the I-adaptive scheme ranges from 11% to 23%. In Figure 2 we show the evolution in time of the error scaled by the tolerance, on a sample path, for the tolerance 10 −3 for both our variable time-step and the existing fixedstep schemes. Moreover, we examined the accuracy of the numerical solution obtained with our adaptive method in Figure 3. We compared the probability distribution at time = 40 for the species computed with the PI-adaptive method for the CLE with = 10 −2 and = 10 −3 and with the SSA. The histograms agree very accurately.

Decay-Dimerization
Model. The final system used to investigate the behaviour of our variable step-size algorithm is the decay-dimerization model [8]. This model consists of three molecular species involved in four reactions: The propensity functions corresponding to these reactions are with the reaction rate parameter values 1 = 1, 2 = 0.002, 3 = 0.5, and 4 = 0.04. The solution of this biochemical reaction model is subject to the initial conditions 1 (0) = 2 (0) = 10 4  . (42) To analyze the efficiency of the proposed method, we simulated our PI-adaptive, the I-adaptive, and the existing constant-step algorithms on 10,000 paths. Table 3 reports the numerical results: the number of attempted, accepted, and rejected steps of each of the variable step-size strategies, for tolerances = 10 −1 , 10 −2 , and 10 −3 , respectively. In addition, Table 3 records the local errors for each of the above schemes,  for a given tolerance. Moreover, it shows the local error obtained using the fixed time-step method with the same total number of attempted time-steps as the most expensive technique, the integral-(I-) controller one (being thus of similar computational cost with it). Observe that the Icontroller attempts more steps than our PI-controller, for the same tolerance; therefore it is more expensive. Likewise, the I-adaptive technique has a ratio of rejected to attempted steps between 6% and 14%, while the same step rejection ratio for our PI-adaptive scheme is below 3% and is decreasing with the decrease of tolerance. It is important to remark that the existing fixed step-size method yields a local error which is up to 780 times larger than the proposed variable time-stepping method. Consequently, our variable step-size algorithm is  The decay-dimerization model: the histograms at = 5 for the species 1 , 2 , and 3 obtained with the SSA (green) and the PI-adaptive method for the CLE with tolerances = 10 −2 (blue) and = 10 −3 (red). The simulation uses 10,000 paths. much more accurate than the constant time-step method, for a similar computational cost.
To assess the accuracy of the proposed variable step size method, we perform simulations for 10,000 trajectories with the PI-adaptive Milstein method for the CLE with tolerances 10 −2 and 10 −3 and with Gillespie's algorithm. The histograms generated with these algorithms at time = 5 for each of the species are plotted in Figure 4. Again, the accuracy of our variable step size strategy is excellent.

Conclusion
Variable step size control is critical for efficient approximation of the solution of stochastic differential equations and in particular for models which exhibit stiffness. The objective is to minimize the computational effort of the simulation, while maintaining the desired accuracy of the numerical solution. When the numerical integration enters a region of stiffness, an adaptive algorithm lowers the step size to satisfy the accuracy requirement. However, outside these regions of stiffness the algorithm relaxes the step size, thus gaining in efficiency.
This paper developed a variable time-stepping strategy, based on control theory, for the strong numerical solution of a stochastic continuous model of biochemical kinetics. More precisely, we designed the first PI-controller for adapting the step size for a class of stochastic differential equations with noncommutative multiplicative noise, known as the chemical Langevin equation. The underlying numerical technique is a higher order of accuracy method due to Milstein. The controller, which uses low cost estimates of the local error generated by Milstein scheme, is recommended for models of biochemical systems which are mildly stiff. Unlike other variable time-stepping strategies [20] which alter the step only by halving or doubling, our technique allows for a flexible variation of the time-step. Furthermore, when a step is rejected as it does not satisfy the error criteria, the method guarantees that the statistics of the numerical solution are not biased.
Numerical experiments show that the proposed PIcontroller for adapting the step size is significantly more accurate than the existing constant-step algorithms, for the same computational cost. Additionally, it has improved computational stability. Compared to the variable timestepping method using integral control, our PI-adaptive strategy reduces greatly the number of step rejections, having a reduced computational effort for the same prescribed tolerance.
Our future work will investigate how to efficiently control the time-step in the weak numerical solution of the chemical Langevin equation.