Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
I recently rolled up the new version of the GillespieSSA package, version 0.3-1. The tar ball of the new version is posted on its web page (here). I also submitted it to CRAN so in (due time) it should appear on the official R package list.
The release consists of a number of bug fixes (among others typos in the package URL and demo models). The biggest change for the end user is, however, a now and cleaner way of passing model parameters to the main interface function ssa(). Rather than having to define model parameters in the global environment or hard coding their values into the propensity functions they can now be passed as a formal argument in the form of a named vector directly to ssa(). I owe a thanks to Ben Bolker for suggesting this deuglification solution. An added benefit of this revised feature is that model definitions are actually shorter now. The whole model + running it can now easily be a one liner.
For example defining and running the stochastic version of the classical logistic growth model
library(GillespieSSA) out <- ssa(x0=c(N=500),a=c(”b*{N}”, ”(d+(b-d)*{N}/K)*{N}”),nu=matrix(c(+1,-1),ncol=2),parms=c(b=2, d=1, K=1000),tf=25) |
Here the per capita birth rate is
One way of quickly visualizing the resulting time series is by
ssa.plot(out) |
As expected the results look rather stochastically familiar,
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.