Moment closure inference for stochastic kinetic models

of 60 /60
Moment closure inference for stochastic kinetic models Colin Gillespie School of Mathematics & Statistics

Embed Size (px)

description

My talk from the MBI Workshop on Recent Advances in Statistical Inference for Mathematical Biology 2012 http://www.mbi.osu.edu/2011/rasschedule.html

Transcript of Moment closure inference for stochastic kinetic models

  • 1. Moment closure inference forstochastic kinetic models Colin GillespieSchool of Mathematics & Statistics

2. Talk outlineAn introduction to moment closureCase study: AphidsConclusion2/43 3. Birth-death processBirth-death model X 2Xand 2X Xwhich has the propensity functions X and X .Deterministic representationThe deterministic model is dX (t ) = ( )X (t ) , dtwhich can be solved to give X (t ) = X (0) exp[( )t ]. 3/43 4. Birth-death processBirth-death model X 2Xand 2X Xwhich has the propensity functions X and X .Deterministic representationThe deterministic model is dX (t ) = ( )X (t ) , dtwhich can be solved to give X (t ) = X (0) exp[( )t ]. 3/43 5. Stochastic representationIn the stochastic framework, eachreaction has a probability of occurring 50The analogous version of the 40birth-death process is the differencePopulationequation 30 20dpn= (n 1)pn1 + (n + 1)pn+110 dt ( + )npn 00 12 3 4TimeUsually called the forward Kolmogorovequation or chemical master equation 4/43 6. Moment equationsMultiply the CME by en and sum over n, to obtain MM= [(e 1) + (e 1)] twhere M (; t ) = e n pn ( t )n =0If we differentiate this p.d.e. w.r.t and set = 0, we get dE[N (t )]= ( )E[N (t )] dtwhere E[N (t )] is the mean5/43 7. The mean equation dE[N (t )]= ( )E[N (t )] dtThis ODE is solvable - the associated forward Kolmogorov equation isalso solvableThe equation for the mean and deterministic ODE are identicalWhen the rate laws are linear, the stochastic mean and deterministicsolution always correspond 6/43 8. The variance equationIf we differentiate the p.d.e. w.r.t twice and set = 0, we get: dE[N (t )2 ]= ( )E[N (t )] + 2( )E[N (t )2 ]dtand hence the variance Var[N (t )] = E[N (t )2 ] E[N (t )]2 .Differentiating three times gives an expression for the skewness, etc7/43 9. Simple dimerisation modelDimerisation2X1 X2and X2 2X1with propensities 0.5k1 X1 (X1 1) and k2 X2 .8/43 10. Dimerisation moment equationsWe formulate the dimer model in terms of moment equations dE[X1 ] 2 = 0.5k1 (E[X1 ] E[X1 ]) k2 E[X1 ]dt 2dE[X1 ] 2 2 = k1 (E[X1 X2 ] E[X1 X2 ]) + 0.5k1 (E[X1 ] E[X1 ]) dt2 + k2 (E[X1 ] 2E[X1 ])where E[X1 ] is the mean of X1 and E[X1 ] E[X1 ]2 is the variance2The i th moment equation depends on the (i + 1)th equation9/43 11. Deterministic approximates stochasticRewriting dE[X1 ] 2 = 0.5k1 (E[X1 ] E[X1 ]) k2 E[X1 ]dtin terms of its variance, i.e. E[X1 ] = Var[X1 ] + E[X1 ]2 , we get2 dE[X1 ] = 0.5k1 E [X1 ](E[X1 ] 1) + 0.5k1 Var[X1 ] k2 E[X1 ] (1)dt Setting Var[X1 ] = 0 in (1), recovers the deterministic equation So we can consider the deterministic models as an approximation to the stochastic When we have polynomial rate laws, setting the variance to zero results in the deterministic equation 10/43 12. Deterministic approximates stochasticRewriting dE[X1 ] 2 = 0.5k1 (E[X1 ] E[X1 ]) k2 E[X1 ]dtin terms of its variance, i.e. E[X1 ] = Var[X1 ] + E[X1 ]2 , we get2 dE[X1 ] = 0.5k1 E [X1 ](E[X1 ] 1) + 0.5k1 Var[X1 ] k2 E[X1 ] (1)dt Setting Var[X1 ] = 0 in (1), recovers the deterministic equation So we can consider the deterministic models as an approximation to the stochastic When we have polynomial rate laws, setting the variance to zero results in the deterministic equation 10/43 13. Simple dimerisation modelTo close the equations, we assume an underlying distributionThe easiest option is to assume an underlying Normal distribution, i.e.E[X1 ] = 3E[X1 ]E[X1 ] 2E[X1 ]3 3 2But we could also use, the Poisson3 E[X1 ] = E[X1 ] + 3E[X1 ]2 + E[X1 ]3or the Log normal2 3 3 E [ X1 ]E [ X1 ] = E [ X1 ] 11/43 14. Simple dimerisation modelTo close the equations, we assume an underlying distributionThe easiest option is to assume an underlying Normal distribution, i.e.E[X1 ] = 3E[X1 ]E[X1 ] 2E[X1 ]3 3 2But we could also use, the Poisson3 E[X1 ] = E[X1 ] + 3E[X1 ]2 + E[X1 ]3or the Log normal2 3 3 E [ X1 ]E [ X1 ] = E [ X1 ] 11/43 15. Heat shock modelProctor et al, 2005. Stochastic kinetic model of the heat shock system twenty-three reactions seventeen chemical speciesA single stochastic simulation up to t = 2000 takes about 35 minutes.If we convert the model to moment equations, we get 139 equationsADPNative Protein 12006000000 5950000 1000 5900000 800Population 5850000 600 5800000 400 5750000 200 570000000 500 1000 1500 2000 0 500 1000 1500 2000TimeGillespie, CS, 200912/43 16. Density plots: heat shock modelTime t=200 Time t=20000.006Density0.0040.0020.000600 800 1000 1200 1400 600 8001000 1200 1400ADP population 13/43 17. P53-Mdm2 oscillation modelProctor and Grey, 2008 30016 chemical species 250Around a dozen reactions 200PopulationThe model contains an eventsAt t = 1, set X = 0150If we convert the model to moment100equations, we get 139 equations. 50However, in this case the moment 0closure approximation doesnt do to0 5 101520 25 30Timewell! 14/43 18. P53-Mdm2 oscillation modelProctor and Grey, 2008 30016 chemical speciesAround a dozen reactions 250The model contains an events 200PopulationAt t = 1, set X = 0150If we convert the model to moment100equations, we get 139 equations. 50However, in this case the moment 0closure approximation doesnt do to 0 5 101520 25 30well! Time 14/43 19. P53-Mdm2 oscillation modelProctor and Grey, 2008 30016 chemical speciesAround a dozen reactions 250The model contains an events 200PopulationAt t = 1, set X = 0150If we convert the model to moment100equations, we get 139 equations. 50However, in this case the moment 0closure approximation doesnt do to 0 5 101520 25 30well! Time 14/43 20. What went wrong?The Moment closure (tends) to fail when there is a large differencebetween the deterministic and stochastic formulationsIn this particular case, strongly correlated speciesTypically when the MC approximation fails, it gives a negativevarianceThe MC approximation does work well for other parameter values forthe p53 model15/43 21. Part IICotton aphids16/43 22. Cotton aphidsAphid infestation (G & Golightly, 2010)A cotton aphid infestation of a cotton plant can result in: leaves that curl and pucker seedling plants become stunted and may die a late season infestation can result in stained cotton cotton aphids have developed resistance to many chemical treatments and so can be difcult to treat Basically it costs someone a lot of money 17/43 23. Cotton aphidsAphid infestation (G & Golightly, 2010)A cotton aphid infestation of a cotton plant can result in: leaves that curl and pucker seedling plants become stunted and may die a late season infestation can result in stained cotton cotton aphids have developed resistance to many chemical treatments and so can be difcult to treat Basically it costs someone a lot of money 17/43 24. Cotton aphidsThe data consists ofve observations at each plotthe sampling times are t=0, 1.14, 2.29, 3.57 and 4.57 weeks (i.e.every 7 to 8 days)three blocks, each being in a distinct areathree irrigation treatments (low, medium and high)three nitrogen levels (blanket, variable and none)18/43 25. The data Zero Variable Block q25002000 q1500 Lowq q1000 qqqq qq500 q qq q qqqqqq qqqq q qqqq q q q 0 qqq2500 q2000 Medium q1500qqqq q 19/431000 q q q 26. ZeroVariable Block The dataq25002000q1500Low qq1000q qq q qq500q qqq q qq q q q qq qq q q q qq qq q 0 q qq2500qNo. of aphids2000Mediumq1500 qq q q q1000q q qq500 q q q qq qq q q q qq q q q q q q qq q 025002000qqHigh1500 q q qq1000q q qqq q500q qq q q qq q q qq q q q q q q q qq q q 0 qq 0 1 2 3 4 0 12 3 4 0 1 2 3 4 Time19/43 27. Some notationLetn (t ) to be the size of the aphid population at time tc (t ) to be the cumulative aphid population at time t1. We observe n (t ) at discrete time points2. We dont observe c (t )3. c (t ) n (t )20/43 28. The modelWe assume, based on previous modelling (Matis et al., 2004)An aphid birth rate of n (t )An aphid death rate of n (t )c (t )So extinction is certain, as eventually nc > n for large t 21/43 29. The modelDeterministic representationPrevious modelling efforts have focused on deterministic models: dN (t ) = N (t ) C (t )N (t )dt dC (t ) = N (t )dtSome problemsInitial and nal aphid populations are quite smallNo allowance for natural random variationSolution: use a stochastic model 22/43 30. The modelDeterministic representationPrevious modelling efforts have focused on deterministic models: dN (t ) = N (t ) C (t )N (t )dt dC (t ) = N (t )dtSome problemsInitial and nal aphid populations are quite smallNo allowance for natural random variationSolution: use a stochastic model 22/43 31. The modelStochastic representationLet pn,c (t ) denote the probability: there are n aphids in the population at time t a cumulative population size of c at time tThis gives the forward Kolmogorov equationdpn,c (t ) = (n 1)pn1,c 1 (t ) + c (n + 1)pn+1,c (t ) dt n ( + c ) p n ,c ( t )Even though this equation is fairly simple, it still cant be solved exactly.23/43 32. Some simulations 800 600Aphid pop. 400 200 0 0 2 46 8 10 Time (days)Parameters: n (0) = c (0) = 1, = 1.7 and = 0.00124/43 33. Some simulations 800 600Aphid pop. 400 200 0 0 2 46 8 10 Time (days)Parameters: n (0) = c (0) = 1, = 1.7 and = 0.00124/43 34. Some simulations 800 600Aphid pop. 400 200 0 0 2 46 8 10 Time (days)Parameters: n (0) = c (0) = 1, = 1.7 and = 0.00124/43 35. Stochastic parameter estimationLet X(tu ) = (n (tu ), c (tu )) be the vector of observed aphid countsand unobserved cumulative population size at time tu ;To infer and , we need to estimatePr[X(tu )| X(tu 1 ), , ]i.e. the solution of the forward Kolmogorov equationWe will use moment closure to estimate this distribution 25/43 36. Stochastic parameter estimationLet X(tu ) = (n (tu ), c (tu )) be the vector of observed aphid countsand unobserved cumulative population size at time tu ;To infer and , we need to estimatePr[X(tu )| X(tu 1 ), , ]i.e. the solution of the forward Kolmogorov equationWe will use moment closure to estimate this distribution 25/43 37. Moment equations for the means dE[n (t )]= E[n(t )] (E[n(t )]E[c (t )] + Cov[n(t ), c (t )]) dt dE[c (t )]= E[n(t )] dtThe equation for the E[n (t )] depends on the Cov[n (t ), c (t )]Setting Cov[n (t ), c (t )]=0 gives the deterministic modelWe obtain similar equations for higher-order moments26/43 38. Moment equations for the means dE[n (t )]= E[n(t )] (E[n(t )]E[c (t )] + Cov[n(t ), c (t )]) dt dE[c (t )]= E[n(t )] dtThe equation for the E[n (t )] depends on the Cov[n (t ), c (t )]Setting Cov[n (t ), c (t )]=0 gives the deterministic modelWe obtain similar equations for higher-order moments26/43 39. Parameter inferenceGiventhe parameters: {, }the initial states: X(tu 1 ) = (n (tu 1 ), c (tu 1 ));We have X(tu ) | X(tu 1 ), , N (u 1 , u 1 )where u 1 and u 1 are calculated using the moment closureapproximation 27/43 40. Parameter inferenceSummarising our beliefs about {, } and the unobservedcumulative population c (t0 ) via priors p (, ) and p (c (t0 ))The joint posterior for parameters and unobserved states (for a singledata set) is4 p (, , c | n) p (, ) p (c(t0 )) p (x(tu ) | x(tu1 ), , ) u =1For the results shown, we used a simple random walk MH step toexplore the parameter and state spacesFor more complicated models, we can use a Durham & Gallant stylebridge (Milner, G & Wilkinson, 2012). 28/43 41. Parameter inferenceSummarising our beliefs about {, } and the unobservedcumulative population c (t0 ) via priors p (, ) and p (c (t0 ))The joint posterior for parameters and unobserved states (for a singledata set) is4 p (, , c | n) p (, ) p (c(t0 )) p (x(tu ) | x(tu1 ), , ) u =1For the results shown, we used a simple random walk MH step toexplore the parameter and state spacesFor more complicated models, we can use a Durham & Gallant stylebridge (Milner, G & Wilkinson, 2012). 28/43 42. Simulation studyThree treatments & two blocksBaseline birth and death rates: { = 1.75, = 0.00095}Treatment 2 increases by 0.0004Treatment 3 increases by 0.35The block effect reduces by 0.0003Treatment 1 Treatment 2 Treatment 3Block 1 {1.75, 0.00095} {1.75, 0.00135} {2.1, 0.00095}Block 2 {1.75, 0.00065} {1.75, 0.00105} {2.1, 0.00065} 29/43 43. Simulation studyThree treatments & two blocksBaseline birth and death rates: { = 1.75, = 0.00095}Treatment 2 increases by 0.0004Treatment 3 increases by 0.35The block effect reduces by 0.0003Treatment 1 Treatment 2 Treatment 3Block 1 {1.75, 0.00095} {1.75, 0.00135} {2.1, 0.00095}Block 2 {1.75, 0.00065} {1.75, 0.00105} {2.1, 0.00065} 29/43 44. Simulation studyThree treatments & two blocksBaseline birth and death rates: { = 1.75, = 0.00095}Treatment 2 increases by 0.0004Treatment 3 increases by 0.35The block effect reduces by 0.0003Treatment 1 Treatment 2 Treatment 3Block 1 {1.75, 0.00095} {1.75, 0.00135} {2.1, 0.00095}Block 2 {1.75, 0.00065} {1.75, 0.00105} {2.1, 0.00065} 29/43 45. Simulation studyThree treatments & two blocksBaseline birth and death rates: { = 1.75, = 0.00095}Treatment 2 increases by 0.0004Treatment 3 increases by 0.35The block effect reduces by 0.0003Treatment 1 Treatment 2 Treatment 3Block 1 {1.75, 0.00095} {1.75, 0.00135} {2.1, 0.00095}Block 2 {1.75, 0.00065} {1.75, 0.00105} {2.1, 0.00065} 29/43 46. Simulated dataTreament 1Treatment 2 Treatment 3 1500q BlockPopulation 1000qq1q 2 500qqq qqqq qq q q0 q0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5Time30/43 47. Parameter structureLet i , k represent the block and treatments level, i {1, 2} andk {1, 2, 3}For each data set, we assume birth rates of the form:ik = + i + kwhere 1 = 1 = 0So for block 1, treatment 1 we have: 11 = and for block 2, treatment 1 we have:21 = + 2 31/43 48. MCMC schemeUsing the MCMC scheme described previously, we generated 2Miterates and thinned by 1KThis took a few hours and convergence was fairly quickWe used independent proper uniform priors for the parametersFor the initial unobserved cumulative population, we hadc (t0 ) = n (t0 ) +where has a Gamma distribution with shape 1 and scale 10.This set up mirrors the scheme that we used for the real data set32/43 49. Marginal posterior distributions for and 200006 15000Density Density4 10000250000X0X1.6 1.7 1.81.9 2.0 0.00090 0.00095 0.00100Birth RateDeath Rate 33/43 50. Marginal posterior distributions for birthrates0.2 0.0 0.2 0.4Block 2 Treatment 2Treatment 3 6 Density 4 2 0XXX 0.2 0.0 0.2 0.40.2 0.0 0.2 0.4 Birth RateWe obtained similar densities for the death rates.34/43 51. Application to the cotton aphid data setRecall that the data consists of ve observations on twenty randomly chosen leaves in each plot; three blocks, each being in a distinct area; three irrigation treatments (low, medium and high); three nitrogen levels (blanket, variable and none); the sampling times are t=0, 1.14, 2.29, 3.57 and 4.57 weeks (i.e. every 7 to 8 days).Following in the same vein as the simulated data, we are estimating 38parameters (including interaction terms) and the latent cumulative aphidpopulation. 35/43 52. Cotton aphid dataMarginal posterior distributions6 15000Density Density4 1000025000001.6 1.7 1.81.9 2.0 0.00090 0.000950.00100Birth Rate Death Rate36/43 53. Does the model t the data?We simulate predictive distributions from the MCMC output, i.e. werandomly sample parameter values (, ) and the unobserved statec and simulate forwardWe simulate forward using the Gillespie simulatornot the moment closure approximation 37/43 54. Does the model t the data?Predictive distributions for 6 of the 27 Aphid data setsD 123 D 121D131250020001500 X q q q q1000 X qq X q q q qAphid Populationqqqqq qq 500Xq q qXq qqq q Xqq q qX X qqq X qXq qq X X0qD 112 D 122 D 113 q q X 2500 q q 2000 1500q q Xq qqq 1000 qq qqX qqX qqq qqq q500 XqqX q qX q q qq qXqq q X X q XXq 0q1.14 2.29 3.57 4.57 1.14 2.29 3.57 4.57 1.14 2.29 3.57 4.57Time 38/43 55. Summarising the resultsConsider the additional number of aphids per treatment combinationSet c (0) = n (0) = 1 and tmax = 6We now calculate the number of aphids we would see for eachparameter combination in addition to the baselineFor example, the effect due to medium water:211 = + Water (M) and 211 = + Water (M)Soii Additional aphids = cWater (M) cbaseline 39/43 56. Aphids over baseline Main Effects0 20006000 10000 Nitrogen (V)Water (H)Water (M)0.00250.00200.00150.00100.00050.0000DensityBlock 3Block 2 Nitrogen (Z)0.00250.00200.00150.00100.00050.0000 0 20006000 100000 2000 600010000 Aphids 40/43 57. Aphids over baselineInteractions0 2000 6000 10000 0 2000 6000 10000 W(H) N(Z) W(M) N(Z) W(H) N(V) W(M) N(V)0.0030.0020.0010.000B3 W(H) B2 W(H) B3 W(M) B2 W(M)0.003Density0.0020.0010.000 B3 N(Z) B2 N(Z) B3 N(V) B2 N(V)0.0030.0020.0010.0000 2000 6000 10000 0 2000 6000 10000 Aphids40/43 58. ConclusionsThe 95% credible intervals for the baseline birth and death rates are(1.64, 1.86) and (0.00090, 0.00099).Main effects have little effect by themselvesHowever block 2 appears to have a very strong interaction withnitrogenMoment closure parameter inference is a very useful technique forestimating parameters in stochastic population models41/43 59. Future workAphid modelOther data sets suggest that there is aphid immigration in the earlystagesModel selection for stochastic modelsIncorporate measurement errorMoment closureBetter closure techniquesAssessing the t 42/43 60. Acknowledgements Andrew Golightly Richard Boys Peter Milner Darren Wilkinson Jim Matis (Texas A & M)References Gillespie, CS Moment closure approximations for mass-action models. IET Systems Biology 2009. Gillespie, CS, Golightly, A Bayesian inference for generalized stochastic population growth models with application to aphids. Journal of the Royal Statistical Society, Series C 2010. Milner, P, Gillespie, CS, Wilkinson, DJ Moment closure approximations for stochastic kinetic models with rational rate laws. Mathematical Biosciences 2011. Milner, P, Gillespie, CS and Wilkinson, DJ Moment closure based parameter inference of stochastic kinetic models. Statistics and Computing 2012.43/43