Gillespie algorithm

From testwiki
Jump to navigation Jump to search

Template:Short description

In probability theory and computational science, the Gillespie algorithm, also known as the stochastic simulation algorithm (SSA), is a method for generating statistically exact sample trajectories of certain continuous-time Markov jump processes. It is especially associated with the simulation of coupled chemical reaction systems. Daniel Gillespie presented the method in 1976 and developed it further in 1977.[1][2]

The method is widely used in computational systems biology, particularly when the numbers of reacting molecules are small enough that stochastic fluctuations are important.[3] Gillespie-type algorithms are also used in network epidemiology to simulate stochastic epidemic spreading on complex networks, including continuous-time SI, SIS, and SIR processes.[4]

Mathematically, the algorithm is a form of dynamic Monte Carlo method and is closely related to kinetic Monte Carlo methods.

History

The mathematical foundations of the Gillespie algorithm lie in the theory of stochastic jump processes. In 1931, Andrey Kolmogorov developed differential equations describing the time evolution of Markov processes, now known as the Kolmogorov equations.[5]

William Feller subsequently studied purely discontinuous Markov processes and established conditions under which the Kolmogorov equations yield proper transition probabilities.[6] Joseph L. Doob extended the mathematical theory of Markov processes during the 1940s.[7][8]

Early computer simulations of related stochastic processes predated Gillespie's work. David George Kendall simulated a simple birth-and-death process using the Manchester Mark 1 computer in 1950,[9] and Maurice S. Bartlett applied stochastic-process methods to epidemic modelling.[10]

Gillespie's 1976 and 1977 papers derived an exact simulation procedure for systems of coupled chemical reactions using probabilistic arguments based on the physical interpretation of molecular reaction events.[1][2]

Method

Mathematical formulation

Consider a system whose state at time t is described by a vector 𝒙. Each possible event or reaction j has a propensity function aj(𝒙). For chemical systems, the propensity represents the instantaneous rate at which a particular reaction can occur when the system is in state 𝒙.[3]

Define the total propensity

a0(𝒙)=βˆ‘jaj(𝒙).

Provided that the process is Markovian, the waiting time Ο„ until the next event is exponentially distributed with rate a0(𝒙). The joint probability density that the next event occurs after a waiting time Ο„ and is reaction j is

p(Ο„,jβˆ£π’™,t)=aj(𝒙)exp⁡[βˆ’a0(𝒙)Ο„].

Thus, the simulation requires two random choices: the time of the next event and which event occurs.

Using two independent pseudorandom numbers r1 and r2, uniformly distributed on (0,1), the waiting time can be generated as

Ο„=1a0(𝒙)ln⁡(1r1).

The next reaction j is the smallest integer satisfying

βˆ‘j′=1jaj′(𝒙)>r2a0(𝒙).

Direct method

The direct form of the Gillespie algorithm can be written as follows:[2][3]

  1. Initialize the time t=t0 and state 𝒙=𝒙0.
  2. Evaluate each propensity aj(𝒙) and their total a0(𝒙).
  3. Generate the waiting time Ο„ and select the next reaction j.
  4. Advance the time according to t←t+Ο„.
  5. Update the state according to 𝒙←𝒙+𝝂j, where 𝝂j is the state-change vector associated with reaction j.
  6. Record the state if required and repeat until the chosen stopping condition is reached.

Each realization produced in this way is a sample trajectory of the corresponding stochastic process.

Comparison with deterministic models

Traditional deterministic descriptions of chemical kinetics generally use systems of coupled ordinary differential equations for continuous concentrations. Such models are often effective when populations are large and stochastic fluctuations are relatively small.

When some molecular species occur in low copy numbers, however, fluctuations associated with individual reaction events may become significant. The Gillespie algorithm represents molecules and reaction events discretely and therefore provides a way of simulating these intrinsic stochastic fluctuations.[3]

For the standard chemical interpretation of the algorithm, the reaction system is normally assumed to be sufficiently well mixed that spatial correlations can be neglected and that the propensity of each reaction depends only on the current state.

Computational variants

The original direct method may become computationally expensive when a model contains a large number of reaction channels. Consequently, numerous exact and approximate variants have been developed.

The next reaction method of Gibson and Bruck uses data structures such as dependency graphs and priority queues to reduce the computational effort needed to determine subsequent reaction events.[11]

Approximate methods such as tau-leaping advance the system through multiple reaction events over a finite time interval rather than simulating every individual event, potentially providing substantial computational savings.[12] Hybrid methods can likewise combine stochastic descriptions of low-copy-number species with deterministic approximations for abundant species.

For weakly coupled reaction networks, exact algorithms with computational cost independent of the total number of reaction channels under appropriate conditions have been developed.[13]

Extensions have also been proposed for systems in which events are delayed or otherwise depart from the assumptions of a simple Markov reaction process.[14][15][16]

Partial-propensity methods

Partial-propensity formulations reduce the computational work needed to evaluate and select reaction channels by exploiting the structure of their propensity functions.[17][18]

Related approaches based on reaction factoring and dependency structures have also been proposed for large biochemical systems.[19]

Partial-propensity techniques have additionally been extended to reaction networks containing delays.[20]

Applications

Chemical and biochemical reaction networks

The Gillespie algorithm was originally developed for coupled chemical reaction systems and remains widely used to investigate stochastic chemical and biochemical dynamics.[2][3] Applications include systems in which fluctuations caused by small numbers of molecules may influence the system's behaviour, such as gene-expression and regulatory networks.

Epidemic processes on networks

Epidemic models can also be represented as continuous-time stochastic event systems. For a network-based epidemic model, events may include transmission across an edge between susceptible and infected nodes and recovery of an infected node.

Gillespie-based simulation can therefore be used to generate continuous-time realizations of epidemic models on complex contact networks. Kuryliak, Emmerich, and Dosyn applied efficient Gillespie implementations to SI, SIS, and SIR dynamics on heterogeneous networks and studied how network structure and interventions influence epidemic peak size and timing.[4]

Example

Reversible binding of A and B to form AB dimers

A simple chemical system illustrates the direct method. Consider molecules of two types, Template:Math and Template:Math, which reversibly bind to form Template:Math dimers:[3]

A+Bβ†½βˆ’βˆ’β‡€AB

There are two possible reactions. An Template:Math molecule and a Template:Math molecule can combine to produce an Template:Math dimer, or an existing dimer can dissociate.

Let the rate constant for dimer formation be kD and the rate constant for dissociation be kB. If the system contains nA molecules of Template:Math, nB molecules of Template:Math, and nAB dimers, the two propensities are

a1=kDnAnB

and

a2=kBnAB.

The total reaction propensity is therefore

a0=kDnAnB+kBnAB.

The waiting time until the next reaction is sampled from an exponential distribution with mean 1/a0. Once the waiting time has been generated, the probability that the next event is dimer formation is

P(A+B→AB)=kDnAnBa0,

while the probability of dissociation is

P(AB→A+B)=kBnABa0.

If dimer formation occurs, nA and nB each decrease by one and nAB increases by one. If dissociation occurs, the opposite update is made. Repeatedly sampling the waiting time and reaction type generates one stochastic trajectory of the system.

See also

References

Template:Reflist

Further reading