0

Does anyone know the syntax for Gillespie SSA in R? The codes i found were these:

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

I need help with this or new simple layout for the SSA

  • What is `a`? What does your state shift matrix `v` contain? What are some sensible numbers for `n`, `r`, `h` and `x(0)`? Which bit are you stuck on? What have you tried so far? – Richie Cotton Feb 17 '14 at 11:51
  • I found these codes from web which I do not remember as i got these a few days back. i need the exact syntax for the SSA. You may not consider the codes i have given above. – user3301661 Feb 17 '14 at 15:25
  • In order for people to answer your question, you need to provide more detail with your problem. Are you having trouble with converting that pseudocode into R syntax? (In which case, tell us what those variables, like `a` and `v` mean.) Or are you having trouble finding an existing function that calculates the SSA. (Hint: go to http://www.rseek.org, search for "Gillespie stochastic simulation algorithm", look at the first result under functions.) – Richie Cotton Feb 17 '14 at 16:15

0 Answers0