User:Carl Boettiger/Notebook/Stochastic Population Dynamics/2010/02/15
|Stochastic Population Dynamics||Main project page|
Previous entry Next entry
Implementing warning signals metrics
The code now contains implementation of the basic warning signals metrics computed over a given window size into the past.
These are implemented through the fixed interval sampler function. Recall that the Gillespie simulation API permits two kinds of events, random events occurring with exponential time distribution and events occurring at fixed (scheduled) times, which can be used for discretizations of deterministic continuous time dynamics (i.e. Forward/Backward Euler, Runge-Kutta), as well as scheduled events such as sampling. Just as each random event can have its own rate, fixed events can occur at different frequencies.
A sample run provided below. Note that the simulation terminates when it hits extinction, even though this zero point is not necessarily sampled on the fixed interval. Created using the parameter values and settings as found in the commit to the svn repository revision 14. The environmental degradation starts at t=5000, marked by the red line.
A python script in the code repository produces this plot. The script in the original form used to create the plot can also always be found in revision 14; meanwhile the plotting script can continue to evolve for later exploration. (Definitely one of the great strengths of version management!)