2

In Section 2 of this answer, the stochastic Lotka-Volterra predator-prey dynamics is demonstrated. I have difficulties to reproduce these results. At the end of the mentioned answer, a code is provided, but when I run it, it gives me errors. Any help is appreciated to reproduce these plots by this particular approach.

David
  • 51
  • 2
  • Can you be more specific about the errors you get? – Chris K Aug 30 '22 at 13:32
  • @ChrisK For example, in the syntax of the code there are extra brackets and so forth. – David Aug 30 '22 at 13:34
  • @ChrisK I'm also trying to compare the results of this approach with when one uses ItoProcess built-in function and uses stochastic differential equations. I have not obtained also meaningful results for my second approach. But, I think, I should post this for another question. – David Aug 30 '22 at 13:55
  • I just copied the code from the linked answer and it worked as expected. – Chris K Aug 30 '22 at 13:58
  • @ChrisK I don't know what I'm missing here. Could you post it as an aswer? – David Aug 30 '22 at 13:59
  • Start a fresh Mathematica kernel, copy/paste/run the GillespieSSA code, then copy/paste/run the Lotka-Volterra predator-prey dynamics code. – Chris K Aug 30 '22 at 14:17
  • @ChrisK I'm working on Wolfram Cloud Basic. Could be due to this? But I will open it in a new browser. – David Aug 30 '22 at 14:21
  • 1
    I just tried it on the Cloud. When pasting the GillespieSSA code, it mistakenly breaks it into different cells. This is likely the cause of your brackets problem. As a work-around, I started a new cell by typing 1, then pasted over it from within the cell. Then it works. – Chris K Aug 30 '22 at 14:31
  • @ChrisK Thanks a lot! It works. Just a final question: I'm trying to reproduce this plot by ItoProcess buil-in function and stochastic differential equation. In principle, should I obtain the same result? – David Aug 30 '22 at 14:37
  • @ChrisK Another stupid question: the Lotka-Volterra predator-prey reactions in the linked answered result in different differential equations as those quoted in the Wikipedia page of Lotka–Volterra equations? – David Aug 30 '22 at 15:01
  • No the results will differ, this is simulating a discrete-state continuous-time Markov process, while ItoProcess solves a continuous-state stochastic differential equation. I suppose there are many different parameterizations of the LV model. BTW, I suggest the text "Stochastic Population Processes: Analysis, Approximations, Simulations" by Eric Renshaw. Good luck! – Chris K Aug 30 '22 at 15:05

0 Answers0