Stochastic degradation model¶
-
class
pints.toy.
StochasticDegradationModel
(initial_molecule_count=20)[source]¶ Stochastic degradation model of a single chemical reaction starting from an initial molecule count \(A(0)\) and degrading to 0 with a fixed rate \(k\):
\[A \xrightarrow{k} 0\]Simulations are performed using Gillespie’s algorithm [1], [2]:
- Sample a random value \(r\) from a uniform distribution
\[r \sim U(0,1)\]- Calculate the time \(\tau\) until the next single reaction as
\[\tau = \frac{-\ln(r)}{A(t) k}\]- Update the molecule count \(A\) at time \(t + \tau\) as:
\[A(t + \tau) = A(t) - 1\]- Return to step (1) until the molecule count reaches 0
The model has one parameter, the rate constant \(k\).
Extends
pints.ForwardModel
,pints.toy.ToyModel
.Parameters: initial_molecule_count – The initial molecule count \(A(0)\). References
[1] A Practical Guide to Stochastic Simulations of Reaction Diffusion Processes. Erban, Chapman, Maini (2007). arXiv:0704.1908v2 [q-bio.SC] https://arxiv.org/abs/0704.1908 [2] A general method for numerically simulating the stochastic time evolution of coupled chemical reactions. Gillespie (1976). Journal of Computational Physics https://doi.org/10.1016/0021-9991(76)90041-3 -
interpolate_mol_counts
(time, mol_count, output_times)[source]¶ Takes raw times and inputs and mol counts and outputs interpolated values at output_times
-
mean
(parameters, times)[source]¶ Returns the deterministic mean of infinitely many stochastic simulations, which follows \(A(0) \exp(-kt)\).
-
n_outputs
()¶ Returns the number of outputs this model has. The default is 1.