在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:sdwfrost/Gillespie.jl开源软件地址:https://github.com/sdwfrost/Gillespie.jl开源编程语言:Jupyter Notebook 99.9%开源软件介绍:Gillespie.jlStatement of needThis is an implementation of Gillespie's direct method as well as uniformization/Jensen's method for performing stochastic simulations, which are widely used in many fields, including systems biology and epidemiology. It borrows the basic interface (although none of the code) from the R library InstallationThe stable release of using Pkg
Pkg.add("Gillespie") The development version from this repository can be installed as follows. Pkg.add("https://github.com/sdwfrost/Gillespie.jl") Example usageAn example of a susceptible-infected-recovered (SIR) epidemiological model is as follows. using Gillespie
using Gadfly
using Random
function F(x,parms)
(S,I,R) = x
(beta,gamma) = parms
infection = beta*S*I
recovery = gamma*I
[infection,recovery]
end
x0 = [999,1,0]
nu = [[-1 1 0];[0 -1 1]]
parms = [0.1/1000.0,0.01]
tf = 250.0
Random.seed!(1234)
result = ssa(x0,F,nu,parms,tf)
data = ssa_data(result)
plot_theme = Theme(
panel_fill=colorant"white",
default_color=colorant"black"
)
p=plot(data,
layer(x=:time,y=:x1,Geom.step,Theme(default_color=colorant"red")),
layer(x=:time,y=:x2,Geom.step,Theme(default_color=colorant"orange")),
layer(x=:time,y=:x3,Geom.step,Theme(default_color=colorant"blue")),
Guide.xlabel("Time"),
Guide.ylabel("Number"),
Guide.title("SSA simulation"),
Guide.manual_color_key("Subpopulation",["S","I","R"],["red","orange","blue"]),
plot_theme
) Julia versions of the examples used in Jensen's method or uniformizationThe development version of The true jump methodThe development version of BenchmarksThe speed of an SIR model in
1000 simulations were performed, and the time per simulation computed (lower is better). Benchmarks were run on a Mac Pro (Late 2013), with 3 Ghz 8-core Intel Xeon E3, 64GB 1866 Mhz RAM, running OSX v 10.11.3 (El Capitan), using Julia v0.4.5 and R v.3.3. Jupyter notebooks for Julia and R with the code and benchmarks are available as gists. A plain Julia file is also provided in the benchmarks subdirectory for ease of benchmarking locally.
(smaller is better) Julia performance for Future work
CitationIf you use
A Bibtex entry can be found here. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论