gillepsie.md 1.64 KB
 Victor committed Oct 07, 2020 1 2 3 4 5 6 7 8 # Gillepsie algorithm ## Mathematical foundations - The original article by Gillepsie: [**A general method for numerically simulating the stochastic time evolution of coupled chemical reactions**](https://www.sciencedirect.com/science/article/pii/0021999176900413?via%3Dihub)  Victor committed Oct 11, 2020 9 10 ### Update Rates  b_i  and  d_i  represent respcetively birth and death rates of agents i. The total rate is given by the sum of all individual rates  Victor committed Oct 07, 2020 11 12 13 math R(t) = \left[ \sum_i b_i(t) + d_i(t) \right]   Victor committed Oct 09, 2020 14 A particular event, birth or death, is chosen at random with a probability equal to the rate of this event divided by the total rate R  Victor committed Oct 07, 2020 15 16  ### Time steps  Victor committed Oct 09, 2020 17 An event is exponentiallly distributed in time, with parameter \lambda = U(t). This makes events memoryless, meaning that the probability of having a birth or death event is always the same, no matter when (P(X > s_t | X > t) = P(X > s) .  Victor committed Oct 07, 2020 18   Victor committed Oct 11, 2020 19 20 !!! tip "Inversion method" Let B(t) = \sum_i b_i(t) and  D(t) = \sum_i d_i(t). Let T_b, T_d the time for a birth or death event to occur. Then we have P(T_b < T_d) = \frac{B(t)}{B(t) + D(t)} (competing exponentials).  Victor committed Oct 07, 2020 21   Victor committed Oct 11, 2020 22 23 24 25  Let U be an \mathcal{U}_{(0,1)}-distributed random variable and F \colon \R \to [0,1] be a distribution function. Then we have math P(I_F(U) \leq x ) = P(U \leq F(x)) = F(x)   Victor committed Oct 07, 2020 26 27   Victor committed Oct 11, 2020 28  Thanks to the ***inversion method*** we get the incremental time step dt, exponentially distributed with parameter \lambda = R(t), as  Victor committed Oct 07, 2020 29   Victor committed Oct 11, 2020 30 31 32  math dt(\omega) = -\frac{\log(U(\omega))}{R(t)} \iff X(\omega) = \exp(-U(t)dt(\omega))   Victor committed Oct 07, 2020 33 34 35 36 37  @autodocs Modules = [ABMEv] Pages = ["ABMEv_Gillepsie.jl"]