Chemistry:Tau-leaping

From HandWiki
Revision as of 07:46, 6 March 2023 by QCDvac (talk | contribs) (change)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Short description: Approximate method for the simulation of a stochastic system

In probability theory, tau-leaping, or τ-leaping, is an approximate method for the simulation of a stochastic system.[1] It is based on the Gillespie algorithm, performing all reactions for an interval of length tau before updating the propensity functions.[2] By updating the rates less often this sometimes allows for more efficient simulation and thus the consideration of larger systems.

Many variants of the basic algorithm have been considered.[3][4][5][6][7]

Algorithm

The algorithm is analogous to the Euler method for deterministic systems, but instead of making a fixed change

[math]\displaystyle{ x(t+\tau)=x(t)+\tau x'(t) }[/math]

the change is

[math]\displaystyle{ x(t+\tau)=x(t)+P(\tau x'(t)) }[/math]

where [math]\displaystyle{ P(\tau x'(t)) }[/math] is a Poisson distributed random variable with mean [math]\displaystyle{ \tau x'(t) }[/math].

Given a state [math]\displaystyle{ \mathbf{x}(t)=\{X_i(t)\} }[/math] with events [math]\displaystyle{ E_j }[/math] occurring at rate [math]\displaystyle{ R_j(\mathbf{x}(t)) }[/math] and with state change vectors [math]\displaystyle{ \mathbf{v}_{ij} }[/math] (where [math]\displaystyle{ i }[/math] indexes the state variables, and [math]\displaystyle{ j }[/math] indexes the events), the method is as follows:

  1. Initialise the model with initial conditions [math]\displaystyle{ \mathbf{x}(t_0)=\{X_i(t_0)\} }[/math].
  2. Calculate the event rates [math]\displaystyle{ R_j(\mathbf{x}(t)) }[/math].
  3. Choose a time step [math]\displaystyle{ \tau }[/math]. This may be fixed, or by some algorithm dependent on the various event rates.
  4. For each event [math]\displaystyle{ E_j }[/math] generate [math]\displaystyle{ K_j \sim \text{Poisson}(R_j\tau) }[/math], which is the number of times each event occurs during the time interval [math]\displaystyle{ [t,t+\tau) }[/math].
  5. Update the state by
    [math]\displaystyle{ \mathbf{x}(t+\tau)=\mathbf{x}(t)+\sum_j K_jv_{ij} }[/math]
    where [math]\displaystyle{ v_{ij} }[/math] is the change on state variable [math]\displaystyle{ X_i }[/math] due to event [math]\displaystyle{ E_j }[/math]. At this point it may be necessary to check that no populations have reached unrealistic values (such as a population becoming negative due to the unbounded nature of the Poisson variable [math]\displaystyle{ K_j }[/math]).
  6. Repeat from Step 2 onwards until some desired condition is met (e.g. a particular state variable reaches 0, or time [math]\displaystyle{ t_1 }[/math] is reached).

Algorithm for efficient step size selection

This algorithm is described by Cao et al.[4] The idea is to bound the relative change in each event rate [math]\displaystyle{ R_j }[/math] by a specified tolerance [math]\displaystyle{ \epsilon }[/math] (Cao et al. recommend [math]\displaystyle{ \epsilon=0.03 }[/math], although it may depend on model specifics). This is achieved by bounding the relative change in each state variable [math]\displaystyle{ X_i }[/math] by [math]\displaystyle{ \epsilon/g_i }[/math], where [math]\displaystyle{ g_i }[/math] depends on the rate that changes the most for a given change in [math]\displaystyle{ X_i }[/math]. Typically [math]\displaystyle{ g_i }[/math] is equal the highest order event rate, but this may be more complex in different situations (especially epidemiological models with non-linear event rates).

This algorithm typically requires computing [math]\displaystyle{ 2N }[/math] auxiliary values (where [math]\displaystyle{ N }[/math] is the number of state variables [math]\displaystyle{ X_i }[/math]), and should only require reusing previously calculated values [math]\displaystyle{ R_j(\mathbf{x}) }[/math]. An important factor in this since [math]\displaystyle{ X_i }[/math] is an integer value, then there is a minimum value by which it can change, preventing the relative change in [math]\displaystyle{ R_j }[/math] being bounded by 0, which would result in [math]\displaystyle{ \tau }[/math] also tending to 0.

  1. For each state variable [math]\displaystyle{ X_i }[/math], calculate the auxiliary values
    [math]\displaystyle{ \mu_i(\mathbf{x}) = \sum_j v_{ij} R_j(\mathbf{x}) }[/math]
    [math]\displaystyle{ \sigma_i^2(\mathbf{x}) = \sum_j v_{ij}^2 R_j(\mathbf{x}) }[/math]
  2. For each state variable [math]\displaystyle{ X_i }[/math], determine the highest order event in which it is involved, and obtain [math]\displaystyle{ g_i }[/math]
  3. Calculate time step [math]\displaystyle{ \tau }[/math] as
    [math]\displaystyle{ \tau = \min_i {\left\{ \frac{\max{\{\epsilon X_i / g_i, 1\}}}{|\mu_i(\mathbf{x})|}, \frac{\max{\{\epsilon X_i / g_i, 1\}}^2}{\sigma_i^2(\mathbf{x})} \right\}} }[/math]

This computed [math]\displaystyle{ \tau }[/math] is then used in Step 3 of the [math]\displaystyle{ \tau }[/math] leaping algorithm.

References

  1. Gillespie, D. T. (2001). "Approximate accelerated stochastic simulation of chemically reacting systems". The Journal of Chemical Physics 115 (4): 1716–1733. doi:10.1063/1.1378322. Bibcode2001JChPh.115.1716G. http://users.soe.ucsc.edu/~msmangel/Gillespie01.pdf. 
  2. Erhard, F.; Friedel, C. C.; Zimmer, R. (2010). "FERN – Stochastic Simulation and Evaluation of Reaction Networks". Systems Biology for Signaling Networks. pp. 751. doi:10.1007/978-1-4419-5797-9_30. ISBN 978-1-4419-5796-2. 
  3. Cao, Y.; Gillespie, D. T.; Petzold, L. R. (2005). "Avoiding negative populations in explicit Poisson tau-leaping". The Journal of Chemical Physics 123 (5): 054104. doi:10.1063/1.1992473. PMID 16108628. Bibcode2005JChPh.123e4104C. 
  4. 4.0 4.1 Cao, Y.; Gillespie, D. T.; Petzold, L. R. (2006). "Efficient step size selection for the tau-leaping simulation method". The Journal of Chemical Physics 124 (4): 044109. doi:10.1063/1.2159468. PMID 16460151. Bibcode2006JChPh.124d4109C. http://www.cs.ucsb.edu/~cse/Files/NewTau052.pdf. 
  5. Anderson, David F. (2008-02-07). "Incorporating postleap checks in tau-leaping". The Journal of Chemical Physics 128 (5): 054103. doi:10.1063/1.2819665. ISSN 0021-9606. PMID 18266441. Bibcode2008JChPh.128e4103A. 
  6. Chatterjee, Abhijit; Vlachos, Dionisios G.; Katsoulakis, Markos A. (2005-01-08). "Binomial distribution based τ-leap accelerated stochastic simulation". The Journal of Chemical Physics 122 (2): 024112. doi:10.1063/1.1833357. ISSN 0021-9606. PMID 15638577. Bibcode2005JChPh.122b4112C. 
  7. Moraes, Alvaro; Tempone, Raul; Vilanova, Pedro (2014-04-24). "Hybrid Chernoff Tau-Leap". Multiscale Modeling & Simulation 12 (2): 581–615. doi:10.1137/130925657. ISSN 1540-3467.