Introduction to stochastic dynamical modelling
Gavin J Gibson
Maxwell Institute for Mathematical Sciences Heriot-Watt University
Introduction to stochastic dynamical modelling Gavin J Gibson - - PowerPoint PPT Presentation
Introduction to stochastic dynamical modelling Gavin J Gibson Maxwell Institute for Mathematical Sciences Heriot-Watt University Outline Motivation for stochastic modelling Structure of stochastic models Simulation of stochastic
Gavin J Gibson
Maxwell Institute for Mathematical Sciences Heriot-Watt University
5 10 15 20 10 20 30 40 50 60 70 t n 5 10 15 20 40 60 80 100 t n 2 4 6 8 10 2 4 6 8 10 12 t n 5 10 15 20 10 20 30 40 50 60 70 t n
4 realisations with α = 1.1, β = 1 and N(0) = 10 EXTINCTION!
Gillespie algorithm: Current state (S(t), I(t)): [S+I+R = N] Total instantaneous rate: R = βS(t)I(t) + µI(t) 1. Simulate ∆ ~Exp(R), t → t+ ∆ 2. Choose event type to be infection with probability βS(t)/R (otherwise removal). 3. Update state vector at new time depending on the event type chosen. Repeat the process to generate a stochastic realisation of the process. Process generalises to compartment models of arbitrary complexity.
n_events = 1000 #number of times n = numeric(n_events) #vector for population sizes t = numeric(n_events) #vector of event times t[1] = 0 #initial time n[1] = 10 #initial population size beta = 1.1 #birth rate mu = 1 #death rate for( i in 1:(n_events-1) ) { #If extinct then nothing can happen! if(n[i] == 0) { n[i+1] = 0 t[i+1] = t[i] } #Otherwise simulate next event else{ del = rexp(1, n[i]*(beta + mu)) #time till event t[i+1] = t[i]+del #next event time #now select and implement event if( runif(1, 0, 1) < beta/(beta + mu) ) n[i+1] = n[i] + 1 else n[i+1] = n[i] - 1 } } plot(t, n, type = "l")
Challenge: How do we estimate the parameters if we only see the removal times?
18 time (days)
2 4 6 8 10 12 14 16
diseased plants
5 10 15 20 25 30 35
time (days)
2 4 6 8 10 12 14 16
diseased plants
5 10 15 20 25 30 35 (a) (b)
5 reps with trichoderma 5 reps without trichoderma
Likelihood Prior
Model: SEI with ‘quenching’, primary and secondary infection constant latent period. S→E rate: R(t) = e-at(rpS(t) + rsS(t)I(t)) Stay in E for fixed period κ 3 ‘submodels’:
recording I
recording E+I
No trichoderma Trichoderma
Although quantitative estimates
qualitative conclusion seems robust. There is consistent evidence that T viride appears to affect the primary infection parameter. Models are useful ‘lenses’ even if they cannot be used as ‘crystal balls’!
Primary Secondary Quenching Latent
al., Phytopathology, 2002; Jamieson, PhD Thesis, U. Cambridge, 2004, Cook et al. 2008, Neri et al 2014)
6056 susceptibles, 1124 infections after 12 30-day periods
Day 1 2 3 4 .
G1 G2 G3 G4
y = (time of 1st +ve test, last +ve test, peak viraemic level)
Depth 0 Depth 2 Depth 1 Depth 4
Group 1 Group 2 From Streftaris & Gibson, PRSB (2004)
If we accept the modelling assumptions we must nevertheless concede that, with high posterior probability, an ANOVA test would provide significant evidence of differences in viraemia with depth in the infection chain.