IDEAS home Printed from https://ideas.repec.org/a/jss/jstsof/v025i12.html
   My bibliography  Save this article

GillespieSSA: Implementing the Gillespie Stochastic Simulation Algorithm in R

Author

Listed:
  • Pineda-Krch, Mario

Abstract

The deterministic dynamics of populations in continuous time are traditionally described using coupled, first-order ordinary differential equations. While this approach is accurate for large systems, it is often inadequate for small systems where key species may be present in small numbers or where key reactions occur at a low rate. The Gillespie stochastic simulation algorithm (SSA) is a procedure for generating time-evolution trajectories of finite populations in continuous time and has become the standard algorithm for these types of stochastic models. This article presents a simple-to-use and flexible framework for implementing the SSA using the high-level statistical computing language R and the package GillespieSSA. Using three ecological models as examples (logistic growth, Rosenzweig-MacArthur predator-prey model, and Kermack-McKendrick SIRS metapopulation model), this paper shows how a deterministic model can be formulated as a finite-population stochastic model within the framework of SSA theory and how it can be implemented in R. Simulations of the stochastic models are performed using four different SSA Monte Carlo methods: one exact method (Gillespie's direct method); and three approximate methods (explicit, binomial, and optimized tau-leap methods). Comparison of simulation results confirms that while the time-evolution trajectories obtained from the different SSA methods are indistinguishable, the approximate methods are up to four orders of magnitude faster than the exact methods.

Suggested Citation

  • Pineda-Krch, Mario, 2008. "GillespieSSA: Implementing the Gillespie Stochastic Simulation Algorithm in R," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 25(i12).
  • Handle: RePEc:jss:jstsof:v:025:i12
    DOI: http://hdl.handle.net/10.18637/jss.v025.i12
    as

    Download full text from publisher

    File URL: https://www.jstatsoft.org/index.php/jss/article/view/v025i12/v25i12.pdf
    Download Restriction: no

    File URL: https://www.jstatsoft.org/index.php/jss/article/downloadSuppFile/v025i12/GillespieSSA_0.5-3.tar.gz
    Download Restriction: no

    File URL: https://www.jstatsoft.org/index.php/jss/article/downloadSuppFile/v025i12/v25i12.R
    Download Restriction: no

    File URL: https://libkey.io/http://hdl.handle.net/10.18637/jss.v025.i12?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Kamara, Abdul A. & Wang, Xiangjun & Mouanguissa, Lagès Nadège, 2020. "Analytical solution for post-death transmission model of Ebola epidemics," Applied Mathematics and Computation, Elsevier, vol. 367(C).
    2. Timo R Maarleveld & Brett G Olivier & Frank J Bruggeman, 2013. "StochPy: A Comprehensive, User-Friendly Tool for Simulating Stochastic Biological Processes," PLOS ONE, Public Library of Science, vol. 8(11), pages 1-10, November.
    3. repec:jss:jstsof:33:i03 is not listed on IDEAS
    4. zu Dohna, Heinrich & Pineda-Krch, Mario, 2010. "Fitting parameters of stochastic birth–death models to metapopulation data," Theoretical Population Biology, Elsevier, vol. 78(2), pages 71-76.
    5. Laperrière, Vincent & Brugger, Katharina & Rubel, Franz, 2016. "Cross-scale modeling of a vector-borne disease, from the individual to the metapopulation: The seasonal dynamics of sylvatic plague in Kazakhstan," Ecological Modelling, Elsevier, vol. 342(C), pages 34-48.
    6. Soetaert, Karline & Petzoldt, Thomas, 2010. "Inverse Modelling, Sensitivity and Monte Carlo Analysis in R Using Package FME," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 33(i03).

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:jss:jstsof:v:025:i12. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F. Baum (email available below). General contact details of provider: http://www.jstatsoft.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.