Abstract
An algorithm for computing the linear noise approximation (LNA) of the reaction–diffusion master equation (RDME) is developed and tested. The RDME is often used as a model for biochemical reaction networks. The LNA is derived for a general discretization of the spatial domain of the problem. If M is the number of chemical species in the network and N is the number of nodes in the discretization in space, then the computational work to determine approximations of the mean and the covariances of the probability distributions is proportional to in a straightforward implementation. In our LNA algorithm, the work is proportional to . Since N usually is larger than M, this is a significant reduction. The accuracy of the approximation in the algorithm is estimated analytically and evaluated in numerical experiments.
Keywords: Linear noise approximation, Spatially dependent, Fast algorithm
Introduction
Many biochemical networks are modeled by ordinary or partial differential equations at a macroscopic level of fidelity. Such continuous models may not be sufficiently accurate when the number of molecules involved in the chemical reactions is small. This is often the case in molecular cell biology (Elowitz et al. 2002; McAdams and Arkin 1997; Raj and van Oudenaarden 2008; Tsimring 2014). Chemical reactions are then best described as random events, and the discrete number of molecules is important when the copy numbers are low at a mesoscopic level of modeling. The macroscopic equation for the mean values is often satisfactory when the number of molecules is large. Analytical solutions to the governing macroscopic or mesoscopic equations can be obtained only for special systems. Computational methods are needed for quantitative information about the behavior of the systems.
The master equation (ME) or Kolmogorov forward equation is an equation for the time evolution of the probability density function (PDF) for the copy numbers of different species in systems with an intrinsic noise (Gardiner 2004; Gillespie 1992; van Kampen 2004). The systems are modeled as Markov processes with discrete states defined by the copy numbers of the chemical species in continuous time. The particular ME for spatially homogeneous, well-stirred problems in chemistry is the chemical master equation (CME) where reactions between two molecules occur with a propensity that depends on the copy numbers of the species. The ME is generalized in the reaction–diffusion master equation (RDME) to spatially heterogeneous chemical systems by introducing a discretization of the reaction volume into compartments or voxels (Gillespie et al. 2014; Gillespie and Seitaridou 2013). The state is then given by the copy numbers in each one of the voxels.
The computational work and the storage requirements to solve the RDME grows exponentially in the number of species and the number of voxels making the simulation of biochemical systems with the ME prohibitive except for very small systems. Analytical solutions are known only for limited classes of problems such as those with linear propensities. Instead, sample trajectories of well-stirred systems are generated by Gillespie’s stochastic simulation algorithm (SSA) (Gillespie 1976, 1977). The original algorithm has been improved in many ways, e.g., for efficiency (Cao et al. 2006; Gibson and Bruck 2000; Gillespie 2001) and for systems with slow and fast reactions (Cao et al. 2005; E et al. 2007). The Gillespie algorithm is generalized to problems with spatial variation due to diffusion in Elf and Ehrenberg (2004), Engblom et al. (2009), Isaacson and Peskin (2006), Lampoudi et al. (2009) and implemented in software (Drawert et al. 2012, 2016; Hattne et al. 2005). The computational effort may be quite large to simulate a system with many chemical species, many molecules, and many voxels, since many realizations of the process are required in a Monte Carlo method like SSA due to slow convergence to the mean and other moments of the distribution. An introduction and an overview of Markov models of chemical reactions are found in Goutsias and Jenkinson (2013). Recent reviews of computational methods at different levels of modeling are Engblom et al. (2017), Gillespie et al. (2013), Mahmutovic et al. (2012) and Sokolowski et al. (2017).
There are ways to approximate the solutions to the CME with deterministic equations. The linear noise approximation (LNA) is obtained from the CME by deriving the equations for the moments and then expanding the solution in a large parameter , representing the size of the chemical system (van Kampen 1976, 2004). The means and covariances in LNA are exact for chemical systems with at most first-order reactions where the propensities are constants or linear in the copy numbers. The first and second moments are exact also for other systems with a special structure (Grima 2015). Different modifications have been proposed to improve the accuracy of LNA, see, e.g., Ferm et al. (2008), Grima (2012). Some of the improvements are compared experimentally in examples in Schnoerr et al. (2015). The LNA and similar approximations are used to quickly study biochemical networks in, e.g., Elf and Ehrenberg (2003), Thomas et al. (2013), Ullah and Wolkenhauer (2009) and more recently as a surrogate model to infer parameters in biochemical models from data in Fearnhead et al. (2014), Fröhlich et al. (2016), Ruttor and Opper (2009), Stathopoulos and Girolami (2013). A review of LNA and related methods and their use for inference are found in Schnoerr et al. (2017).
An alternative to the LNA is the EMRE approximation in Grima (2010) extended to spatial problems in Smith et al. (2017). The covariances satisfy the same Lyapunov equation as we derive here. The spatial EMRE algorithm is applied to gene regulation in a cell and to reactions in a aggregation of cells in two space dimensions in Smith et al. (2017). More compartments than one are also found in Challenger et al. (2012). The equations of LNA with spatial variation are derived in Scott et al. (2010) and applied to the modeling of spatial patterns. The equation for the covariances is replaced by an equation for the factorial cumulant. Equations similar to the LNA for spatial problems are used in Butler and Goldenfeld (2009), Anna et al. (2010) to investigate oscillatory systems. Turing patterns are studied in Asllani et al. (2013), Biancalani et al. (2010), McKane et al. (2014), Woolley et al. (2011) with a spatially extended LNA.
Diffusive effects are important for the fidelity of models when the chemical reactions are localized in space in a cell and when the molecular transport is slow compared to the reactions. Some examples where the spatial effects are crucial are found in Fange and Elf (2006), Sturrock et al. (2013), Takahashi et al. (2010). The LNA is a level of modeling suitable for such systems, e.g., to infer parameters for the diffusion and the reactions from measurements, at least in the beginning of the iterative search process for the parameters, thanks to the relative simplicity of LNA.
In this paper, we develop a fast algorithm for computing approximations of the mean and the covariance of the PDF solving the RDME based on the LNA for spatial problems with reactions and diffusion. The equation for the expected values is a system of reaction–diffusion equations, and the equation for the covariances is a time-dependent Lyapunov equation with a source term localized in space. Let M be the number of chemical species and N the number of voxels. The structure of the covariance equations is utilized to compute an approximation of the covariance and to reduce the computational work and the memory requirements from being proportional to in a straightforward implementation to in our algorithm. Since N usually is larger than M, this is a substantial reduction. A bound on the deviation of the true covariance from our approximation is proved in a theorem. The accuracy of the covariance approximation is demonstrated in numerical examples in one, two, and three dimensions (1D, 2D, and 3D).
In the next section, the RDME is given and a splitting of the operator is introduced. The equations of the LNA for spatially heterogeneous chemical systems are derived for general shapes of the voxels in Sect. 3. A continuous approximation of the equation for the covariances is analyzed in Sect. 4. The algorithm is presented in Sect. 5 for computation of the mean and the covariance. Numerical results are found in Sect. 6. Finally, some conclusions are drawn.
The notation in the paper is as follows. The ith element of a vector is denoted by . The jth column of an array with elements is written as , and is the ith row. The derivative of with respect to is denoted by . The time derivative of is written as , and is a shorter notation for . The Euclidean vector norm is denoted by and the subordinate spectral norm for a matrix is . The set of integer numbers is written as , and denotes the nonnegative integer numbers. In the same manner, denotes the real numbers and is the nonnegative real numbers.
The Master Equation
Consider a biochemical system with M chemically active species. The system evolves on a line (1D), in an area (2D), or a volume (3D) which is partitioned into N voxels (or compartments) such that they cover , , and are non-overlapping, . The voxels are defined by a computational mesh constructed for numerical discretization of partial differential equations, see Fig. 1. The size of a voxel is , and the diagonal matrix has the elements in the diagonal. Each voxel has a node in the center with coordinates and the nodes are connected by edges. The molecular copy number of species i in voxel j is a random integer . The state of the system is time dependent and is given by which is an array of nonnegative integers, . The state changes randomly with reactions between the species in a voxel and with diffusive jumps of the molecules between the voxels.
Fig. 1.

Meshes with edges (solid), nodes j, k, and l, and voxel (dashed). The nodes j and k are connected by edge . a An unstructured mesh, b a structured Cartesian mesh
The CME is a Kolmogorov forward equation for the PDF for a system to be in the state at time t (Gardiner 2004; van Kampen 2004). The state changes at discrete time points after a chemical reaction in a voxel. If is the state before the reaction and is the state immediately after the reaction r, then the change in state in can be written as
| 1 |
The reaction occurs with the propensity , i.e., with probability in a short time interval . The state change vector tells how the state is updated after a reaction. Most entries of are zero and only for those species involved in the reaction. In a system with R different reactions, the CME for is
| 2 |
defining the master operator .
Diffusion of the molecules is modeled as jumps between voxels with a common boundary. Suppose that and share a point in 1D, an edge in 2D, or a facet in 3D. Then, a molecule of species i in jumps to with propensity
| 3 |
The probability for a molecule to jump is given by the jump coefficient . The state change vector has two nonzero components: . The diffusion master equation (DME) in a chemical system without reactions is
| 4 |
defining the diffusion operator . The RDME for the PDF of the state of a system with reactions and diffusion is then
| 5 |
The jump coefficients are determined by the geometry of and the voxels and the diffusion coefficient . If is a rectangle in 2D or a rectangular hexahedron in 3D and the voxels are squares or cubes, then the mesh partitioning is Cartesian as in Fig. 1b. When and share a boundary and the size of an edge in the mesh is , we have . If , then . For a general shape of , the voxels are defined by an unstructured mesh consisting of triangles (2D) as in Fig. 1a or tetrahedra (3D) in Engblom et al. (2009). If there is an edge between node j in and node k in , then .
The diffusion equation for with Neumann boundary conditions in d dimensions is
| 6 |
where is the boundary of and is the normal of . The equation is discretized in space by a finite element method in Engblom et al. (2009) to derive . Let be the concentration of in such that . Then, for one species i satisfies after discretization
| 7 |
where is the set of nodes connected to node j by an edge. It is shown in Engblom et al. (2009) that
| 8 |
With a mesh of good quality, for , see Meinecke et al. (2016). The relation between the jump coefficients in (3) and the diffusion coefficients in (7) is
| 9 |
To simplify the notation, the assumption here is that the diffusion speed is equal for all species. Otherwise, and in (9) would be scaled by to account for the different diffusion coefficients of the different species i.
A numerical solution of (5) is seldom computationally feasible due to the high dimension of . Suppose that the lattice for has L points in each coordinate direction, i.e., . Then, the lattice size for is . A simplification is possible by first splitting the operator into two parts (Hellander et al. 2014; MacNamara and Strang 2016; Strang 1968). Suppose that the solution is known at . A timestep is chosen, and then, the reaction part (2) is integrated from to followed by integration of the diffusion part (4) in
| 10 |
The splitting error in p at is of in (10). Second-order accuracy is obtained by evaluating the reaction equation at half the step at , then solving the diffusion Eq. (4) for a full step, and finally taking half a step with (2) (Strang 1968)
| 11 |
The solution has been advanced from to . The error in is of .
In (2), the reactions occur independently in every voxel without being influenced by the species in the other voxels. Introduce the ansatz
| 12 |
into (2) to arrive at
| 13 |
Hence, for and given, N separate solutions of the CME can be computed
| 14 |
and then combined in (12) in the first step of (10) (or the first and third steps in (11)). The solution is computed N times on a lattice of size . This is smaller than the lattice for the full problem but may still be prohibitively large for numerical solution.
In the same manner, the species diffuse independently of each other in the second step in (10) and (11). Insert
| 15 |
into (4) and rearrange the terms as in (13) to arrive at M separate equations for the diffusion of the species when and is known
| 16 |
Since the propensity is linear in in (16), there exist analytical solutions to the subproblems with multinomial and Poisson distributions for p, see Jahnke and Huisinga (2007), but in practice they are not so useful due to the size of the lattice.
Linear Noise Approximation
The biochemical systems are assumed to have a scaling with a size parameter as in van Kampen (2004), Kurtz (1970), Kurtz (1971) where . In chemical applications, can denote a volume or a typical copy number of the species. Then, the copy numbers are rescaled by , , and the propensities can be written as
| 17 |
Equations for approximation of the PDF of a system are derived below. The computational complexity of their solution is polynomial in M and N instead of exponential as in (5), (14), and (16).
The Mean Value Equation
Let be the expected value of the copy number of species i in voxel j with a PDF satisfying the master Eq. (2). Multiply (2) by and sum over . Then, satisfies the equation (Ferm et al. 2008; van Kampen 2004)
| 18 |
Suppose that every is linear in . Then,
and Eq. (18) are exact for the mean values. If is nonlinear in , then an approximation is
With this approximation, we obtain the reaction rate equations
| 19 |
The mean value equations scaled by the size parameter are
| 20 |
The mean concentration satisfies
| 21 |
The Linear Noise Approximation
The scaled state variable in voxel k is split into a deterministic part and a random part by van Kampen in van Kampen (1976, 2004) for the chemical reactions. The random term is assumed to be proportional to . The relation between the copy numbers , the scaled copy numbers , the fluctuations , and the fluctuations in the concentrations in is
| 22 |
This expansion is inserted into master Eq. (2) with the propensities in (17)
| 23 |
Replace p in (23) by in
| 24 |
and expand the right-hand side of (23) in a Taylor series around . Terms proportional to vanish since satisfies (20). If is the solution to
| 25 |
then terms of cancel out. Terms of and smaller are ignored in the expansion. This is the linear noise approximation (LNA) for the scaled copy numbers subject to chemical reactions in .
The solution to (25) is the PDF of a normal distribution
| 26 |
see Ferm et al. (2008), van Kampen (2004) and (Risken 1996, p. 156). The dimension of is M in the CMEs (14) for all N voxels. The matrix for the covariance between the species i and j in is the solution of
| 27 |
Since is normally distributed with mean and covariance , , it follows from (22) that and the concentration also have normal distributions
| 28 |
The covariance of in (28) is denoted by . Then, the differential equation satisfied by follows from (27)
| 29 |
There are M nonlinear ODEs to solve in (20) for in every voxel . The covariance matrix is symmetric, and we have to solve linear ODEs in (27) and (29). The structure of this equation is the same also for other approximations of the CME, e.g., EMRE in Smith et al. (2017). The accuracy of mean value Eq. (20) is improved in Ferm et al. (2008) by adding a term which is linear in the covariance.
The Diffusion Equation
The notation is simplified if we assume here that there is only one species, , but many voxels, . If , then the diffusion of the other species is treated separately in the same manner, see (16). In diffusion master Eq. (16), the propensity to jump from voxel k to j is linear in with and . The linearity implies that there are explicit expressions for the mean value equations, in (27), and in (25).
The equations for the scaled mean values are obtained from (8), (9), and (20)
| 30 |
The diffusion equation for the mean concentration is derived from (21)
| 31 |
cf. (7).
The equation for the covariance (27) between voxels i and j depends on and in (25). The derivative in (27) and (29) is by (8) and (9)
| 32 |
since for the jump from k to i and for all jumps from i to every j connected to node i by an edge . Let be the set of all edges in the mesh. The state change vector on edge for a jump from i to j is with the nonzero components and . The contribution to in (27) from jumps in two directions: and . Hence, for all edges
| 33 |
The nonzero elements of are and . Therefore, the elements of the symmetric are
| 34 |
The random component of the concentrations is normally distributed . The equation for is derived from (27)
| 35 |
The coefficients in (35) multiplying are
| 36 |
In (35), is scaled by
| 37 |
Then, the scaled -term in (37) can be written in a symmetric form
| 38 |
The covariance equation corresponding to (29) for diffusion is by (35), (36), and (38)
| 39 |
The copy numbers and are normally distributed as in (28). The covariance of the concentrations in space of a species k, , is and .
In the stationary equation, in (39) and it is a Lyapunov equation. A stationary solution of (31) is and of (39) is
| 40 |
where is the Kronecker delta. If the initial data are symmetric, then the solution to (39) is symmetric for all . At the stationary solution of (40)
where is a diagonal matrix with in the diagonal. Thus, the stationary distribution of the copy numbers in the voxels for species k follows from (28)
| 41 |
The stationary copy numbers in different voxels are uncorrelated, have a multivariate normal distribution and are therefore independent, and are approximately Poisson distributed since with equal mean and variance. If , then the time-dependent solutions to (39) will be proportional to and the mean and the covariance of are both proportional to . The distributions of the solution to the DME in (4) are discussed in Engblom et al. (2017) based on the theory for linear propensities in Jahnke and Huisinga (2007). Their distributions are either multinomial, Poisson, or a combination. The stationary distribution is multinomial according to Anderson et al. (2010) and approximately Poissonian (Engblom et al. 2017).
The components of the solution of (31) are the node values of the finite element approximation of solving diffusion Eq. (6) for one species. Let be the covariance between the solutions at the coordinates . Then, in (39) can be interpreted as the value of at the nodes at and . The coefficient in in (39) is negative when , and positive when . When is nonzero, the difference is small. On a regular mesh with a typical length of an edge equal to , the positive weight depends approximately only on and varies smoothly with a typical size V. On such a mesh, and is approximated here by a continuous function with
| 42 |
and the solution to (6). The scalings and are chosen such that and . When then and when we have
Then, the continuous equation corresponding to discrete Eq. (39) is
| 43 |
If exact initial conditions of the distribution of molecules are known, then .
Let be the stationary solution to the diffusion equation. Then, one can show that an approximate stationary solution to (43) is
| 44 |
As , this solution approaches where is the Dirac measure. The solution in (40) to discrete Eq. (39) is similar to (44).
Analysis of the Covariance Equation
A property of the continuous approximation of the covariance in (43) is derived in this section. We show that decays exponentially when grows, indicating that the discrete variance in (39) is small when .
Consider (43) in free space and for with initial data . The concentration is nonnegative and is assumed to be bounded by for all and . Introduce a change of variables
| 45 |
The diffusion equation in (43) is in the new variables
| 46 |
Here is nonnegative and bounded by . The factor in the source term vanishes quickly when increases.
With the fundamental solution of the diffusion equation in 2d dimensions (Evans 2010; Stakgold 2000), the solution of (46) can be written as a sum of two integrals depending on the initial data and the source term
| 47 |
where
| 48 |
and
| 49 |
The integral with the source term is bounded by
| 50 |
The spatial integral over in (50) is
| 51 |
The integral of the product over in (50) is
| 52 |
With and , we have
| 53 |
Using (53), (52), and (51), a bound on in (50) is
| 54 |
Assume that the initial data are localized close to such that for some . A bound on the integral in (47) due to the initial data is then
| 55 |
Hence, a bound on the covariance solution in (47) is obtained by (54) and (55).
The assumptions and conclusions are summarized in a theorem:
Theorem 1
Assume that and that the initial data satisfy
The relations between the and coordinates are . Then, the solution of (46) with defined by (42) for is bounded by
| 56 |
where
| 57 |
The function depends on the dimension d and is 0 at . The first term in (56) is proportional to since . The solution in (56) decays exponentially in for a fixed t in all dimensions and is small when . For a given , the first term in (56) increases slowly with t in 1 and 2 dimensions and is bounded by when . The second term in (56) decreases when for and for all when .
Our bounded domain for and has a boundary that is not taken into account in (56). The bound on is a good estimate when the main part of the solution is away from the boundary, e.g., when t is not too large and is nonzero only in the middle of .
Since (43) is a continuous approximation of (39) we expect the discrete variance to behave in a similar way and be negligible when the nodes i and j are not neighbors and not directly connected by an edge in the mesh. This property will be exploited in the algorithm in the next section.
Algorithm
The algorithm to compute the solution to the LNA for both reactions and diffusion is based on the operator splitting in Sect. 2, the derivations in Sects. 3.2 and 3.3, and Theorem 1 in Sect. 4.
The mean value equation in (21) is added to the diffusion equation in (31) to obtain the reaction–diffusion equation for the concentration of species i in voxel k with MN components
| 58 |
The covariance between the concentrations of the species i and j in voxels k and l is written as and has components. The equation satisfied by the covariance is obtained from (29) and (39)
| 59 |
The reaction source term vanishes if the concentrations are from different voxels, since there is no reaction between molecules in separate voxels. The diffusion source term is zero if the species are different since a diffusion event occurs when the same species changes location between adjacent voxels by a jump.
The equations for the mean and the covariance (58) and (59) are solved by splitting the operator on the right-hand side and advancing the solution one timestep from to as in (10) with and as initial data, cf. (10). The algorithm is
Algorithm 1
60 61 62 63 64 65
The discretization error in and will be of . The ODEs in steps 1, 2 and 3 update u and in a voxel (steps 1, 2) and between two adjacent voxels (step 3) due to the reactions as in step 1 of (10) and (14). In the ODEs in steps 4, 5 and 6, u and change due to diffusion between voxels without any influence of the other species as in step 2 of (10) and (16). A more accurate splitting than in Algorithm 1 with an error of is possible in the same manner as in (11).
It follows from Theorem 1 that if decays rapidly when the nodes and are separated then this property is preserved in where in (56) in step 2 and without the source term in step 3. Using the same arguments in steps 5 and 6, we find that if decays rapidly when increases, then after one timestep also decays rapidly in .
Supported by the analysis in Sect. 4, we assume that is negligible when node l and node k are not neighbors, , and we let in a sparse approximation of . Then, only elements of when and need to be stored and updated in by Algorithm 1. The sparsity (or nonzero) pattern of for each pair i, j is the same as that of and in (8) since and are nonzero only on the diagonal and if nodes the k and l are neighbors connected by an edge in the mesh and . Moreover, is symmetric in both i and j and k and l. With M different species and N voxels, in general has different elements but has only nonzero elements that are necessary to store taking the symmetry into account. The coefficient depends on the dimension and the structure of the mesh. In a Cartesian mesh, or 4(3D) and in an unstructured mesh in 1D but depends on the particular mesh in 2D and 3D. The mean value vectors and have the dimension MN.
In order to estimate the computational work in the steps of the algorithm, we assume that depends on a limited number of independent of M. Then, there are also a limited number of derivatives different from zero and independent of M. Thus, the work to compute the right-hand side (RHS) in step 1 in (60) is independent of M and N and it is computed once for every species i and voxel k, i.e., MN times. Since there are a limited number of nonzeros in , the sums and in step 2 in (61) are computed independently of M and N. Hence, the work is proportional to for the covariances between the species in every voxel. In step 3 in (62), covariances are computed for every combination of voxels k and l where is nonzero. This is the case when k and l are neighbors and each k has a limited number of neighbors. This number is independent of N. Therefore, the work to compute the full RHS in step 3 is of . The number of in the RHS in step 4 in (63) is independent of N according to the previous paragraph. The work to determine all derivatives of is then proportional to MN. For to be nonzero in step 5 in (64), voxels k and l are neighbors, . Furthermore, the products in the sums are nonzero only if . The work to calculate the sums is independent of N, and the RHS is computed times. In the same manner, the RHS in step 6 in (65) is computed times. The conclusion is that the work to determine the RHS in the ODEs for and in the algorithm has linear complexity in N and is proportional to .
Since there are additional administrative costs in Algorithm 1, the straightforward algorithm ignoring the sparsity of will be faster when for some small which is problem dependent. However, for Algorithm 1 will be the winner and its advantage is greater, the greater the N is.
If the diffusion coefficient is different for different species i, then and in steps 4, 5 and 6 would depend on i but the algorithm and its properties remain the same.
In summary, the algorithm in words is for one timestep from to :
Solve the ODE in (60) numerically for the mean values with initial data to obtain
Solve the ODE in (61) numerically for the covariances between the species in the same voxel k with from step 1 and initial data to determine
Solve the ODE in (62) numerically for the covariances between the species in different voxels k and l satisfying with from step 1 and initial data to determine
Solve the ODE in (63) numerically for the mean values with initial data from (60) to obtain and
Solve the ODE in (64) numerically for the covariances between voxels k and l satisfying for the same species i with from step 4 and initial data from steps 2 and 3 to determine
Solve the ODE in (65) numerically for the covariances between voxels k and l satisfying for different species i and j with from step 4 and initial data from steps 2 and 3 to determine
In the first three steps, the mean values and the covariances change due to the reactions and in the last three steps due to the diffusion.
Theorem 1 and numerical experiments in Sect. 6.1 indicate that the accuracy in increases when the dimension grows. By storing and updating only the sparse approximation in steps 3, 5 and 6 in Algorithm 1, considerable savings are possible in computing time and computer memory when N is large, e.g., in 3D.
Example
Consider the reversible reaction for association and dissociation of the species A, B, and C
| 66 |
with copy numbers in voxel j and propensities and state change vectors
| 67 |
The macroscopic reaction coefficients are and . Then, Eq. (21) for the concentrations in step 1 of the above algorithm in is
| 68 |
Order the means and the covariances such that
| 69 |
The Jacobian of the propensities with in (31) and the source term in step 2 in are
| 70 |
since . Introduce and using the identity matrix of size N, , and in (70)
| 71 |
where denotes the Kronecker product. Then, the equation in steps 2 and 3 in matrix form is
| 72 |
Define the matrices and by
| 73 |
The submatrix is the approximation of the Laplacian in (31) and (39). If the diffusion varies between the species, then in (73) would be replaced by on the diagonal. The sparsity or nonzero pattern in is the same as in . The diffusion equation for the mean values in step 4 in Algorithm 1 is as in (31)
| 74 |
The matrix form of steps 5 and 6 in Algorithm 1 is (cf. (38) and (39))
| 75 |
In 1D, is a tridiagonal matrix and if is constant then
Numerical Results
The algorithm is tested for computing the mean and the approximation of the covariance in the LNA of systems with diffusion in 1D, 2D, and 3D and a system in 2D with the reversible reaction (66).
Diffusion
A Cartesian grid in d dimensions is generated with a constant step size and a diffusion coefficient . The number of dimensions is and the domain is the unit cube . The number of grid points is in each dimension yielding components in . A straightforward implementation of Algorithm 1 in steps 5 and 6 will generate elements in . By updating only those elements of that correspond to nonzeros in and , the number of nonzero elements in the approximation will be of .
The initial data are sampled from a uniform distribution and . The ODEs in (74) and (75) are solved numerically for by the forward Euler method for simplicity. Then, the RHS in each step of Algorithm 1 is evaluated once requiring a computational work proportional to in every timestep from to . Better numerical accuracy is achieved by splitting the computations according to Strang (1968) as in (11) and by using a higher-order method. Better numerical stability is obtained by an implicit method.
1D
The covariance is computed in 1D on a grid with and using the full without zeros, the sparse with the same nonzero pattern as , i.e., the diagonal, the subdiagonal, and the superdiagonal are nonzero in a tridiagonal matrix as proposed in Sect. 6.1, and the sparse where another two diagonals below and above the diagonal are nonzero in a pentadiagonal matrix. One row of the three matrices is shown in Fig. 2. The approximations and agree fairly well with in particular for larger t in Fig. 2.
Fig. 2.

Comparison of the covariance for diffusion in 1D with on the abscissa at different time points and different approximations: without sparse approximation (blue), with two extra diagonals in (red), and with four extra diagonals in (yellow). The time is (left), (middle), and (right)
The PDF of the multivariate normal distribution is
| 76 |
The covariance matrix is factorized by where is orthogonal and has the positive eigenvalues of on the diagonal. The expression in (76) in the exponential defines surfaces of ellipsoids in with equal probability, and the eigenvalues of are the lengths of the principal axes of the ellipsoids. Another way of comparing and its approximations is then to compare the eigenvalues to see the difference between the lengths of these axes.
The eigenvalues of and are displayed in Fig. 3. They also agree well except for the one or two smallest ones in the figure. Using five diagonals and four neighbors in improves the approximation somewhat compared to . Including more than the nearest neighbors in 2D and 3D with an unstructured mesh is possible but makes the algorithm more complicated.
Fig. 3.

Comparison of the N eigenvalues of the covariance for diffusion in 1D at different time points and different approximations: without sparse approximation (solid blue), with two extra diagonals in (dashed red), and with four extra diagonals in (dash-dotted yellow). The time is (left), (middle), and (right). The curves for and at are indistinguishable with the precision in the figure
2D and 3D
In 2D, is computed with the full matrix and with the approximation that has the same sparsity pattern as on a grid with and . One row of corresponds to one coordinate and its covariance with the 2D . The variance is high at , and the covariance is very low when . This is depicted in the left panel of Fig. 4 where and are fixed and varies in . The differences in covariance between and are very small and not visible in the figure. Since is symmetric, the result is similar in other directions in and for other . The steady-state solution (40) with and is here 200.
Fig. 4.

The covariances for diffusion computed with the full matrix and its sparse approximation in 2D (left) and 3D (right). The coordinate chosen in the middle of the domain and with one degree of freedom in on the abscissa at with (left) and with (right). The difference between and is not discernible in the figures
One section of the 3D covariances and is shown in the right panel of Fig. 4. As in 2D, , , and in are fixed and is plotted as a function of . The step size in the grid is and . After a short time, the covariances of and agree very well as in 2D. The stationary solution in (40) with the data here is 864.
The scaled difference between the covariances and is defined by
| 77 |
The dominant elements in are the variances on the diagonal. With small elements in compared to 1, the difference between the covariances in and is small relative to the variances in . In Fig. 5, for the 2D example is shown at two time points. The values of are low in blue color in most parts of the matrix. The peaks in the left panel are at 0.035 in isolated points. In the right panel, .
Fig. 5.

Scaled difference of the covariance matrices and in (77) when for diffusion in 2D at (left) and (right)
The eigenvalues of and in 2D and 3D are compared in Fig. 6. The sparse approximation captures all the eigenvalues except for one or two of the smallest ones.
Fig. 6.

Comparison of the N eigenvalues of the covariance matrices and for diffusion in 2D at (left) and 3D at (right) and different approximations: with sparse approximation (dashed red) and without (solid blue)
The covariance of the fluctuations in concentration between different parts of the domain is well approximated by the sparse , especially in 2D and 3D in Figs. 4 and 6. This is expected from Theorem 1 in Sect. 4 where the decay of is slower in 1D than in 2D and 3D when is growing.
Reactions and Diffusion in 2D
The time evolution of the chemical reaction (66) on the Cartesian mesh in 2D in Sect. 6.1.2 is computed with the LNA as in the example in Sect. 5.1. The parameters are , and the diffusion is low with . The dimension of is , and the initial values in are uniformly distributed between 0 and 1 and .
The eigenvalues of the covariances with the full matrix and with the sparse matrix are compared at different t in Fig. 7. An approximate stationary solution is determined at . The convergence of the three subvectors and in (69) corresponding to the concentrations of A, B, and C is displayed in the lower right panel in the figure. The difference between and is measured in for the species. In the resolution of the figure, it is not possible to distinguish between the differences in convergence between the species. The balance equation is satisfied with a relative error less than 0.008 by the mean values and of the components in . At , and are constant in space.
Fig. 7.

Comparison of the MN eigenvalues of the covariance matrices and for the reaction (66) and diffusion in 2D at (upper left), (upper middle), (upper right), (lower left), (lower middle) and different approximations: with sparse approximation (solid blue) and without (dashed red). The convergence of the solution to the steady state for the species A, B, and C as a function of t (lower right)
The convergence plot in Fig. 7 shows that the variation in the solution is larger for small t and decreases with t. The covariances and agree well for large eigenvalues for small t and they agree well for all eigenvalues when t grows. The off-diagonal submatrices in (69) are comparable in size to the diagonal submatrices when t is small but as t grows will dominate and be closer and closer to diagonal matrices. There is a jump in the spectrum for larger t, e.g., at . This is explained by the difference in the size of the stationary values and where and . The approximation in the covariance equation behaves in the same way with reactions as in Sect. 6.1.2 without the reactions.
Conclusions
The master equation is a model for biochemical reactions and diffusion but the numerical solution of it is impossible except for simple, well-stirred systems with special properties. An alternative for large systems with spatial variation is to use the linear noise approximation (LNA). We have derived the equations for the LNA for diffusion and chemical reactions on general meshes. The reactions involve M species, and the mesh consists of N voxels. The covariance of the concentrations is approximated by a sparse representation in an algorithm such that the computational complexity is reduced from in a straightforward implementation to here. Also the memory to store the solution is reduced in the same way. The approximation is supported by analytical expressions showing that the higher the dimension is, the better the approximation is. Consequently, the quality of the approximation and the savings in work and storage are more prominent in 3D when N is large. The accuracy of the approximation is evaluated by comparing the elements and the eigenvalues of the full covariance matrix and its sparse approximation in numerical examples with only diffusion in 1D, 2D, and 3D and an example in 2D with a reversible reaction and slow diffusion.
References
- Anderson DF, Craciun G, Kurtz TG. Product-form stationary distributions for deficiency zero chemical reaction networks. Bull Math Biol. 2010;72:1947–1970. doi: 10.1007/s11538-010-9517-4. [DOI] [PubMed] [Google Scholar]
- Asllani M, Biancalani T, Fanelli D, McKane AJ. The linear noise approximation for reaction–diffusion systems on networks. Eur Phys J B. 2013;86:476. doi: 10.1140/epjb/e2013-40570-8. [DOI] [Google Scholar]
- Biancalani T, Fanelli D, Patti FD. Stochastic Turing patterns in the Brusselator model. Phys Rev E. 2010;86:046215. doi: 10.1103/PhysRevE.81.046215. [DOI] [PubMed] [Google Scholar]
- Butler T, Goldenfeld N. Robust ecological pattern formation induced by demographic noise. Phys Rev E. 2009;80:030902(R). doi: 10.1103/PhysRevE.80.030902. [DOI] [PubMed] [Google Scholar]
- Cao Y, Gillespie D, Petzold L. Multiscale stochastic simulation algorithm with stochastic partial equilibrium assumption for chemically reacting systems. J Comput Phys. 2005;206:395–411. doi: 10.1016/j.jcp.2004.12.014. [DOI] [Google Scholar]
- Cao Y, Gillespie D, Petzold L. Efficient step size selection for the tau-leaping simulation method. J Chem Phys. 2006;124:044109. doi: 10.1063/1.2159468. [DOI] [PubMed] [Google Scholar]
- Challenger JD, McKane AJ, Pahle J. Multi-compartment linear noise approximation. J Stat Mech. 2012;2012(11):P11010. doi: 10.1088/1742-5468/2012/11/P11010. [DOI] [Google Scholar]
- de Anna P, Di Patti F, Fanelli D, McKane AJ, Dauxios T. Spatial model of autocatalytic reactions. Phys Rev E. 2010;81:056110. doi: 10.1103/PhysRevE.81.056110. [DOI] [PubMed] [Google Scholar]
- Drawert B, Engblom S, Hellander A. URDME: a modular framework for stochastic simulation of reaction-transport processes in complex geometries. BMC Syst Biol. 2012;6:76. doi: 10.1186/1752-0509-6-76. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Drawert B, Hellander A, Bales B, Banerjee D, Bellesia G, Daigle B, Douglas G, Gu M, Gupta A, Hellander S, Horuk C, Narayanasamy G, Nath D, Wu S, Lötstedt P, Krintz C, Petzold L. Stochastic simulation service: bridging the gap between the computational expert and the biologist. PLoS Comput Biol. 2016;12:e1005220. doi: 10.1371/journal.pcbi.1005220. [DOI] [PMC free article] [PubMed] [Google Scholar]
- E W, Liu D, Vanden-Eijnden E. Nested stochastic simulation algorithm for chemical kinetic systems with disparate rates. J Comput Phys. 2007;221:158–180. doi: 10.1016/j.jcp.2006.06.019. [DOI] [PubMed] [Google Scholar]
- Elf J, Ehrenberg M. Fast evaluation of fluctuations in biochemical networks with the linear noise approximation. Genome Res. 2003;13:2475–2484. doi: 10.1101/gr.1196503. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Elf J, Ehrenberg M. Spontaneous separation of bi-stable biochemical systems into spatial domains of opposite phases. Syst Biol. 2004;1:230–236. doi: 10.1049/sb:20045021. [DOI] [PubMed] [Google Scholar]
- Elowitz MB, Levine AJ, Siggia ED, Swain PS. Stochastic gene expression in a single cell. Science. 2002;297:1183–1186. doi: 10.1126/science.1070919. [DOI] [PubMed] [Google Scholar]
- Engblom S, Ferm L, Hellander A, Lötstedt P. Simulation of stochastic reaction–diffusion processes on unstructured meshes. SIAM J Sci Comput. 2009;31:1774–1797. doi: 10.1137/080721388. [DOI] [Google Scholar]
- Engblom S, Hellander A, Lötstedt P. Multiscale simulation of stochastic reaction–diffusion networks. In: Holcman D, editor. Stochastic dynamical systems, multiscale modeling, asymptotics and numerical methods for computational cellular biology. Cham: Springer; 2017. pp. 55–79. [Google Scholar]
- Engblom S, Lötstedt P, Meinecke L (2017)Mesoscopic modeling of random walk and reactions in crowded media. In: Technical report, Department of Information Technology, Uppsala University, Uppsala. arXiv:1707.05998
- Evans LC. Partial differential equations, Graduate studies in mathematics. 2. Providence, RI: American Mathematical Society; 2010. [Google Scholar]
- Fange D, Elf J. Noise-induced min phenotypes in E. coli. PLoS Comput Biol. 2006;2:637–648. doi: 10.1371/journal.pcbi.0020080. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Fearnhead P, Giagos V, Sherlock C. Inference for reaction networks using the linear noise approximation. Biometrics. 2014;70:457–466. doi: 10.1111/biom.12152. [DOI] [PubMed] [Google Scholar]
- Ferm L, Lötstedt P, Hellander A. A hierarchy of approximations of the master equation scaled by a size parameter. J Sci Comput. 2008;34:127–151. doi: 10.1007/s10915-007-9179-z. [DOI] [Google Scholar]
- Fröhlich F, Thomas P, Kazeroonian A, Thies FJ, Grima R, Hasenauer J. Inference for stochastic chemical kinetics using moment equations and systems size expansion. PLoS Comput Biol. 2016;12:e1005030. doi: 10.1371/journal.pcbi.1005030. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Gardiner CW. Handbook of stochastic methods, Springer series in synergetics. 3. Berlin: Springer; 2004. [Google Scholar]
- Gibson MA, Bruck J. Efficient exact stochastic simulation of chemical systems with many species and many channels. J Phys Chem. 2000;104(9):1876–1889. doi: 10.1021/jp993732q. [DOI] [Google Scholar]
- Gillespie DT. A general method for numerically simulating the stochastic time evolution of coupled chemical reactions. J Comput Phys. 1976;22(4):403–434. doi: 10.1016/0021-9991(76)90041-3. [DOI] [Google Scholar]
- Gillespie DT. Exact stochastic simulation of coupled chemical reactions. J Phys Chem. 1977;81:2340–2361. doi: 10.1021/j100540a008. [DOI] [Google Scholar]
- Gillespie DT. A rigorous derivation of the chemical master equation. Phys A. 1992;188:404–425. doi: 10.1016/0378-4371(92)90283-V. [DOI] [Google Scholar]
- Gillespie DT. Approximate accelerated stochastic simulation of chemically reacting systems. J Chem Phys. 2001;115(4):1716–1733. doi: 10.1063/1.1378322. [DOI] [Google Scholar]
- Gillespie DT, Seitaridou E. Simple Brownian diffusion. Oxford: Oxford University Press; 2013. [Google Scholar]
- Gillespie DT, Hellander A, Petzold LR. Perspective: stochastic algorithms for chemical kinetics. J Chem Phys. 2013;138:170901. doi: 10.1063/1.4801941. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Gillespie DT, Petzold LR, Seitaridou E. Validity conditions for stochastic chemical kinetics in diffusion-limited systems. J Chem Phys. 2014;140:054111. doi: 10.1063/1.4863990. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Goutsias J, Jenkinson G. Markovian dynamics on complex reaction networks. Phys Rep. 2013;529:199–264. doi: 10.1016/j.physrep.2013.03.004. [DOI] [Google Scholar]
- Grima R. An effective rate equation approach to reaction kinetics in small volumes: theory and application to biochemical reactions in nonequilibrium steady-state conditions. J Chem Phys. 2010;133:035101. doi: 10.1063/1.3454685. [DOI] [PubMed] [Google Scholar]
- Grima R. A study of the moment-closure approximations for stochastic chemical kinetics. J Chem Phys. 2012;136:154105. doi: 10.1063/1.3702848. [DOI] [PubMed] [Google Scholar]
- Grima R. Linear-noise approximation and the chemical master equation agree up to second-order moments for a class of chemical systems. Phys Rev E. 2015;92:042124. doi: 10.1103/PhysRevE.92.042124. [DOI] [PubMed] [Google Scholar]
- Hattne J, Fange D, Elf J. Stochastic reaction-diffusion simulation with MesoRD. Bioinformatics. 2005;21:2923–2924. doi: 10.1093/bioinformatics/bti431. [DOI] [PubMed] [Google Scholar]
- Hellander A, Lawson MJ, Drawert B, Petzold L. Local error estimates for adaptive simulation of the reaction–diffusion master equation via operator splitting. J Comput Phys. 2014;266:89–100. doi: 10.1016/j.jcp.2014.02.004. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Isaacson SA, Peskin CS. Incorporating diffusion in complex geometries into stochastic chemical kinetics simulations. SIAM J Sci Comput. 2006;28:47–74. doi: 10.1137/040605060. [DOI] [Google Scholar]
- Jahnke T, Huisinga W. Solving the chemical master equation for monomolecular reaction systems analytically. J Math Biol. 2007;54:1–26. doi: 10.1007/s00285-006-0034-x. [DOI] [PubMed] [Google Scholar]
- Kurtz TG. Solutions of ordinary differential equations as limits of pure jump Markov processes. J Appl Prob. 1970;7:49–58. doi: 10.2307/3212147. [DOI] [Google Scholar]
- Kurtz TG. Limit theorems for sequences of jump Markov processes approximating ordinary differential processes. J Appl Prob. 1971;8:344–356. doi: 10.2307/3211904. [DOI] [Google Scholar]
- Lampoudi S, Gillespie D, Petzold L. The multinomial simulation algorithm for discrete stochastic simulation of reaction–diffusion systems. J Chem Phys. 2009;130:094104. doi: 10.1063/1.3074302. [DOI] [PMC free article] [PubMed] [Google Scholar]
- MacNamara S, Strang G. Operator splitting. In: Glowinski R, Osher S, Yin W, editors. Splitting methods in communication, imaging, science, and engineering. Cham: Springer; 2016. pp. 95–114. [Google Scholar]
- Mahmutovic A, Fange D, Berg OG, Elf J. Lost in presumption: stochastic reactions in spatial models. Nat Meth. 2012;9(12):1–4. doi: 10.1038/nmeth.2253. [DOI] [PubMed] [Google Scholar]
- McAdams HH, Arkin A. Stochastic mechanisms in gene expression. Proc Natl Acad Sci USA. 1997;94:814–819. doi: 10.1073/pnas.94.3.814. [DOI] [PMC free article] [PubMed] [Google Scholar]
- McKane AJ, Biancalani T, Rogers T. Stochastic pattern formation and spontaneous polarisation: the linear noise approximation and beyond. Bull Math Biol. 2014;76:895–921. doi: 10.1007/s11538-013-9827-4. [DOI] [PubMed] [Google Scholar]
- Meinecke L, Engblom S, Hellander A, Lötstedt P. Analysis and design of jump coefficients in discrete stochastic diffusion models. SIAM J Sci Comput. 2016;38:A55–A83. doi: 10.1137/15M101110X. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Raj A, van Oudenaarden A. Nature, nurture, or chance: stochastic gene expression and its consequences. Cell. 2008;135(2):216–226. doi: 10.1016/j.cell.2008.09.050. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Risken H. The Fokker–Planck equation. Berlin: Springer; 1996. [Google Scholar]
- Ruttor A, Opper M. Efficient statistical inference for stochastic reaction processes. Phys Rev Lett. 2009;103:230601. doi: 10.1103/PhysRevLett.103.230601. [DOI] [PubMed] [Google Scholar]
- Schnoerr D, Sanguinetti G, Grima R. Comparison of different moment-closure approximations for stochastic chemical kinetics. J Chem Phys. 2015;143:185101. doi: 10.1063/1.4934990. [DOI] [PubMed] [Google Scholar]
- Schnoerr D, Sanguinetti G, Grima R. Approximation and inference methods for stochastic biochemical kinetics—a tutorial review. J Phys A Math Theor. 2017;50:093001. doi: 10.1088/1751-8121/aa54d9. [DOI] [Google Scholar]
- Scott M, Poulin FJ, Tang H. Approximating intrinsic noise in continuous multispecies models. Proc R Soc A. 2010;467:718–737. doi: 10.1098/rspa.2010.0275. [DOI] [Google Scholar]
- Smith S, Cianci C, Grima R. Analytical approximations for spatial stochastic gene expression in single cells and tissues. J R Soc Interface. 2017;13:20151051. doi: 10.1098/rsif.2015.1051. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Sokolowski TR, ten Wolde PR (2017)Spatial-stochastic simulation of reaction–diffusion systems. Technical report arXiv:1705.08669v1
- Stakgold I. Boundary value problems of mathematical physics. Philadelphia: SIAM; 2000. [Google Scholar]
- Stathopoulos V, Girolami MA. Markov chain Monte Carlo inference for Markov jump processes via the linear noise approximation. Philos Trans R Soc A. 2013;371:20110541. doi: 10.1098/rsta.2011.0541. [DOI] [PubMed] [Google Scholar]
- Strang G. On the construction and comparison of difference schemes. SIAM J Numer Anal. 1968;5:506–517. doi: 10.1137/0705041. [DOI] [Google Scholar]
- Sturrock M, Hellander A, Matzavinos A, Chaplain MA. Spatial stochastic modelling of the Hes1 gene regulatory network: intrinsic noise can explain heterogeneity in embryonic stem cell differentiation. J R Soc Interface. 2013;10:20120988. doi: 10.1098/rsif.2012.0988. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Takahashi K, Tănase-Nicola S, ten Wolde PR. Spatio-temporal correlations can drastically change the response of a MAPK pathway. Proc Natl Acad Sci USA. 2010;107(6):2473–2478. doi: 10.1073/pnas.0906885107. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Thomas P, Straube AV, Timmer J, Fleck C, Grima R. Signatures of nonlinearity in single cell noise-induced oscillations. J Theor Biol. 2013;335:222–234. doi: 10.1016/j.jtbi.2013.06.021. [DOI] [PubMed] [Google Scholar]
- Tsimring LS. Noise in biology. Rep Prog Phys. 2014;77:026601. doi: 10.1088/0034-4885/77/2/026601. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Ullah M, Wolkenhauer O. Investigating the two-moment characterisation of subcellular biochemical networks. J Theor Biol. 2009;260:340–352. doi: 10.1016/j.jtbi.2009.05.022. [DOI] [PubMed] [Google Scholar]
- van Kampen NG. The expansion of the master equation. Adv Chem Phys. 1976;34:245–309. [Google Scholar]
- van Kampen NG. Stochastic processes in physics and chemistry. 5. Amsterdam: Elsevier; 2004. [Google Scholar]
- Woolley TE, Baker RE, Gaffney EA, Maini PK. Stochastic reaction and diffusion on growing domains: understanding the breakdown of robust pattern formation. Phys Rev E. 2011;84:046216. doi: 10.1103/PhysRevE.84.046216. [DOI] [PubMed] [Google Scholar]
