MyNixOS website logo
Description

Gillespie's Stochastic Simulation Algorithm (SSA).

Provides a simple to use, intuitive, and extensible interface to several stochastic simulation algorithms for generating simulated trajectories of finite population continuous-time model. Currently it implements Gillespie's exact stochastic simulation algorithm (Direct method) and several approximate methods (Explicit tau-leap, Binomial tau-leap, and Optimized tau-leap). The package also contains a library of template models that can be run as demo models and can easily be customized and extended. Currently the following models are included, 'Decaying-Dimerization' reaction set, linear chain system, logistic growth model, 'Lotka' predator-prey model, Rosenzweig-MacArthur predator-prey model, 'Kermack-McKendrick' SIR model, and a 'metapopulation' SIRS model. Pineda-Krch et al. (2008) <doi:10.18637/jss.v025.i12>.

GillespieSSA: Gillespie’s Stochastic Simulation Algorithm (SSA)

GillespieSSA provides a simple to use, intuitive, and extensible interface to several stochastic simulation algorithms for generating simulated trajectories of finite population continuous-time model. Currently it implements Gillespie’s exact stochastic simulation algorithm (Direct method) and several approximate methods (Explicit tau-leap, Binomial tau-leap, and Optimized tau-leap).

The package also contains a library of template models that can be run as demo models and can easily be customized and extended. Currently the following models are included, decaying-dimerization reaction set, linear chain system, logistic growth model, Lotka predator-prey model, Rosenzweig-MacArthur predator-prey model, Kermack-McKendrick SIR model, and a metapopulation SIRS model.

Install

You can install GillespieSSA from CRAN using

install.packages("GillespieSSA")

Or, alternatively, you can install the development version of GillespieSSA from GitHub using

devtools::install_github("rcannood/GillespieSSA", build_vignettes = TRUE)

Examples

The following example models are available:

  • Decaying-Dimerization Reaction Set (Gillespie, 2001): vignette("decaying_dimer", package="GillespieSSA")
  • SIRS metapopulation model (Pineda-Krch, 2008): vignette("epi_chain", package="GillespieSSA")
  • Linear Chain System (Cao et al., 2004): vignette("linear_chain", package="GillespieSSA")
  • Pearl-Verhulst Logistic growth model (Kot, 2001): vignette("logistic_growth", package="GillespieSSA")
  • Lotka predator-prey model (Gillespie, 1977; Kot, 2001): vignette("lotka_predator_prey", package="GillespieSSA")
  • Radioactive decay model (Gillespie, 1977): vignette("radioactive_decay", package="GillespieSSA")
  • Rosenzweig-MacArthur predator-prey model (Pineda-Krch et al., 2007): vignette("rm_predator_prey", package="GillespieSSA")
  • Kermack-McKendrick SIR model (Brown & Rothery, 1993): vignette("sir", package="GillespieSSA")

Latest changes

Check out news(package = "GillespieSSA") or NEWS.md for a full list of changes.

Recent changes in GillespieSSA 0.6.2

  • MINOR CHANGE: Allow using .t as parameter in the propensity functions.

Recent changes in GillespieSSA 0.6.1

This release contains a major rewrite of the internal code, to make sure the code is readable and that the algorithm doesn’t continuously update the local environment.

  • MAJOR CHANGE: Instead of passing "D", "ETL", "OTL", or "BTL" to ssa(), it is expected to pass ssa.d(), ssa.etl(), ssa.otl(), or ssa.btl(). This cleans up parameter setting clutter in the ssa() function.

  • MAJOR CHANGE: Rewrite ssa.*() and ssa.*.diag() as ssa_step.ssa_*() and ssa_step_diag.ssa_*() S3 functions.

  • MAJOR CHANGE: Do not save the current state in the function environment. Instead, simply save it in a local variable.

  • MAJOR CHANGE: Precompile propensity functions instead of evaluating them as R code at each iteration.

  • MAJOR CHANGE: Clean up and merge ssa.run(), ssa.terminate(), ssa.check.args() and ssa.check.method() into ssa().

References

  • Brown D. and Rothery P. 1993. Models in biology: mathematics, statistics, and computing. John Wiley & Sons.
  • Cao Y., Li H., and Petzold L. 2004. Efficient formulation of the stochastic simulation algorithm for chemically reacting systems. J. Chem. Phys. 121:4059-4067. doi:10.1063/1.1778376
  • Cao Y., Gillespie D.T., and Petzold L.R. 2006. Efficient step size selection for the tau-leaping method. J. Chem. Phys. 124:044109. doi:10.1063/1.2159468
  • Cao Y., Gillespie D.T., and Petzold L.R. 2007. Adaptive explicit tau-leap method with automatic tau selection. J. Chem. Phys. 126:224101. doi:10.1063/1.2745299
  • Chatterjee A., Vlachos D.G., and Katsoulakis M.A. 2005. Binomial distribution based tau-leap accelerated stochastic simulation. J. Chem. Phys. 122:024112. doi:10.1063/1.1833357
  • Gillespie D.T. 1977. Exact stochastic simulation of coupled chemical reactions. J. Phys. Chem. 81:2340. doi:10.1021/j100540a008
  • Gillespie D.T. 2001. Approximate accelerated stochastic simulation of chemically reacting systems. J. Chem. Phys. 115:1716-1733. doi:10.1063/1.1378322
  • Gillespie D.T. 2007. Stochastic simulation of chemical kinetics. Annu. Rev. Chem. 58:35 doi:10.1146/annurev.physchem.58.032806.104637
  • Kot M. 2001. Elements of mathematical ecology. Cambridge University Press. doi:10.1017/CBO9780511608520
  • Pineda-Krch M. 2008. Implementing the stochastic simulation algorithm in R. Journal of Statistical Software 25(12): 1-18. doi: 10.18637/jss.v025.i12
  • Pineda-Krch M., Blok H.J., Dieckmann U., and Doebeli M. 2007. A tale of two cycles — distinguishing quasi-cycles and limit cycles in finite predator-prey populations. Oikos 116:53-64. doi:10.1111/j.2006.0030-1299.14940.x.
Metadata

Version

0.6.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows