ExitTimes

ExitTimes 1 is a solver developed for computing the time it takes for a specified event to occur. For example, you may want to compute the time it takes for the infectious population to reach zero. This method will usually be faster than Gillespie (SSA). The method attempts to group the propensities into sets, approximate their values, and sample the final time from multiple gamma distributions. See 1 for a detailed derivation.

Parameter

Data type

Default

Description

solver

string

NA

ExitTimes, ET, and ExitTime are all valid names to run this solver.

epsilon

float

0.2

Determines the error of the approximation; accepts values between 0 and 1. A value of close to 0 is equivalent to a Gillespie (SSA) simulation and a value close to 1 is the most aggressive speedup (and largest error). We do not recommend changing this value.

verbose

bool

false

If true, extra information is printed to the command line, which can be useful for debugging or testing the solver.

Example

The .cfg file example below is followed by a portion of an an .emodl file to show how exit time events are specified.

{
    "duration" : 30,
    "runs"     : 20000,
    "solver"   : "ET",
    "et" : {
	      "verbose" : false,
	      "epsilon" : 0.2
    } 
}
; sir model with exit condition

(import (rnrs) (emodl cmslib))

(start-model "sir-exit")

(locale site-a)
(set-locale site-a)

(species S 95)
(species I 5)
(species R 0)

(observe Susceptible S)
(observe Infected I)
(observe Recovered R)


(param beta 0.015)
(param gamma 1.0)

(reaction S->I (S) (I) (* beta S I))
(reaction I->R (I) (R) (* gamma I))

(bool exitTimeEvent (== R 85) )


(end-model)
1(1,2)

Basil Bayati, “A Method to Calculate the Exit Time in Stochastic Simulations”