有人知道R中Gillespie SSA的语法吗?我发现的代码是:
input n=#iterations,r=#reactions,h=step size (dt)
input x(0) =initial conditions,v=state shift matrix
t←0
for i= 1 to n
for j= 1 to r
p←uniform random number in [0,1]
If
p < a(x)h then x(t+h)←x(t)+vj
end
t←t+h
end
我需要帮助SSA的这个或新的简单布局