GillespieSSA-package {GillespieSSA}R Documentation

Gillespie Stochastic Simulation Algorithm package

Description

Package description and overview of basic SSA theory

Details

GillespieSSA is a versatile and extensible framework for stochastic simulation in R and provides a simple interface to a number of Monte Carlo implementations of the stochastic simulation algorithm (SSA). The methods currently implemented are: the Direct method (D), Explicit tau-leaping (ETL), Binomial tau-leaping (BTL), and Optimized tau-leaping (OTL). The package also provides a library of ecological, epidemiological, and evolutionary continuous-time (demo) models that can easily be customized and extended. Currently the following models are included, Decaying-Dimerization Reaction Set, Linear Chain System, single-species logistic growth model, Lotka predator-prey model, Rosenzweig-MacArthur predator-prey model, Kermack-McKendrick SIR model, and a metapopulation SIRS model.

The stochastic simulation algorithm

The stochastic simulation algorithm (SSA) is a procedure for constructing simulated trajectories of finite populations in continuous time. If X_i(t) is the number of individuals in population i (i=1,...,N) at time t the SSA estimates the state vector X(t) = (X_1(t),...,X_N(t)), given that the system initially (at time t_0) was in state X(t_0)=x_0. Reactions, single instantaneous events changing at least one of the populations (e.g. birth, death, movement, collision, predation, infection, etc), cause the state of the system to change over time. The SSA procedure samples the time tau to the next reaction R_j (j=1,...,M) and updates the system state X(t) accordingly. Each reaction R_j is characterized mathematically by two quantities; its state-change vector nu_j = (nu_1j,...,nu_Nj), where nu_ij is the change in the number of individuals in population i caused by one reaction of type j and its propensity function a_j(x), where a_j(x)dt is the probability that a particular reaction j will occur in the next infinitesimal time interval [t,t+dt].

SSA implementations

There are numerous exact Monte Carlo procedures implementing the SSA. Perhaps the simplest is the Direct method of Gillespie (1977. The Direct method is an exact continuous-time numerical realization of the corresponding stochastic time-evolution equation. Because the Direct method simulates one reaction at a time it is often, however, computationally too slow for practical applications.

Approximate implementations of the SSA sacrifices exactness for large improvements in computational efficiency. The most common technique used is tau-leaping where reaction-bundles are attempted in coarse-grained time increments tau. Speed-ups of several orders of magnitude compared to the Direct method are common. Tau-leaping must be used with care, however, as it is not as foolproof as the Direct method.

Example models

Individual demo models can be run by issuing demo(<model name>), alternativelly all of the demo models can be run using demo(GillespieSSA). The following example models are available:

Decaying-Dimerization Reaction Set (Gillespie, 2001)
file.show(system.file("demo/decayingDimer.R", package = "GillespieSSA"))
Linear Chain System (Cao et al., 2004)
file.show(system.file("demo/linearChain.R", package = "GillespieSSA"))
Logistic growth model (Kot, 2001)
file.show(system.file("demo/logisticGrowth.R", package = "GillespieSSA"))
Lotka predator-prey model (Gillespie, 1977; Kot, 2001)
file.show(system.file("demo/lotka.R", package = "GillespieSSA"))
Kermack-McKendrick SIR model (Brown & Rothery, 1993)
file.show(system.file("demo/sir.R", package = "GillespieSSA"))
Logistic growth (Pearl-Verhulst model) (Kot, 2001, Pineda-Krch, [submitted JSS manuscript])
Rosenzweig-MacArthur predator-prey model (Pineda-Krch et al., 2007, Pineda-Krch, [submitted JSS manuscript])
file.show(system.file("demo/rma.R", package = "GillespieSSA"))
Metapopulation SIRS model (Pineda-Krch, [submitted JSS manuscript])
file.show(system.file("demo/epiChain.R", package = "GillespieSSA"))

Note, the last three models are part of a manuscript to be published in the Journal of Statistical Software (preprint avaliable on request).

How to cite this package

  author = Mario Pineda-Krch
  title  = GillespieSSA: a stochastic simulation package for R
  year   = 2007
  url    = http://pineda-krch.com/gillespiessa

License

This package is distributed under the terms of the GNU General Public License (GPL) version 3 (or newer). Copyright 2007 Mario Pineda-Krch.

This file is part of the R package GillespieSSA.

GillespieSSA is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

GillespieSSA is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Note that GillespieSSA is under active development. Although the package may be considered stable functionality and the structure of the package interface may change in future versions.

Ackowledgements

Author(s)

Mario Pineda-Krch (http://pineda-krch.com)

References

See Also

ssa, ssa.d, ssa.etl, ssa.btl, ssa.otl, ssa.plot


[Package GillespieSSA version 0.5-3 Index]