[Pomp-commits] r515 - in pkg: . inst inst/doc

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 8 17:35:39 CEST 2011


Author: kingaa
Date: 2011-06-08 17:35:39 +0200 (Wed, 08 Jun 2011)
New Revision: 515

Modified:
   pkg/DESCRIPTION
   pkg/inst/ChangeLog
   pkg/inst/doc/intro_to_pomp.Rnw
   pkg/inst/doc/intro_to_pomp.pdf
Log:

- remove the deterministic skeleton from the SIR-model pomp objects.


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2011-06-07 08:23:04 UTC (rev 514)
+++ pkg/DESCRIPTION	2011-06-08 15:35:39 UTC (rev 515)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical inference for partially observed Markov processes
-Version: 0.38-3
-Date: 2011-06-06
+Version: 0.38-4
+Date: 2011-06-08
 Author: Aaron A. King, Edward L. Ionides, Carles Breto, Steve Ellner, Bruce Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman
 Maintainer: Aaron A. King <kingaa at umich.edu>
 URL: http://pomp.r-forge.r-project.org

Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2011-06-07 08:23:04 UTC (rev 514)
+++ pkg/inst/ChangeLog	2011-06-08 15:35:39 UTC (rev 515)
@@ -1,3 +1,26 @@
+2011-06-07  kingaa
+
+	* [r514] man/dacca.Rd, man/eulermultinom.Rd: - fix 'dacca.Rd' to
+	  eliminate codoc warning
+	  - provide ascii-only eqns for 'eulermultinom' help
+
+2011-06-06  kingaa
+
+	* [r513] man/gompertz.Rd: - fix Gompertz model documentation
+	* [r512] DESCRIPTION, inst/NEWS: - update NEWS file
+	* [r511] man/bsplines.Rd, man/dacca.Rd, man/eulermultinom.Rd,
+	  man/gompertz.Rd, man/nlf.Rd, man/plugins.Rd, man/pomp-methods.Rd,
+	  man/pomp.Rd, man/ricker.Rd: - documentation improvements
+
+2011-06-05  kingaa
+
+	* [r510] DESCRIPTION, R/pomp.R, inst/ChangeLog,
+	  inst/doc/advanced_topics_in_pomp.pdf, inst/doc/intro_to_pomp.Rnw,
+	  inst/doc/intro_to_pomp.pdf, src/pfilter.c, src/tsir.c: - remove
+	  unused variables in C codes (per build warning)
+	  - fix errors in 'intro to pomp' vignette
+	  - minor change to some warnings in 'pomp'
+
 2011-06-03  kingaa
 
 	* [r509] DESCRIPTION, inst/NEWS,

Modified: pkg/inst/doc/intro_to_pomp.Rnw
===================================================================
--- pkg/inst/doc/intro_to_pomp.Rnw	2011-06-07 08:23:04 UTC (rev 514)
+++ pkg/inst/doc/intro_to_pomp.Rnw	2011-06-08 15:35:39 UTC (rev 515)
@@ -1549,6 +1549,42 @@
                 step.fun=sir.proc.sim,
                 delta.t=1/52/20
                 ),
+              measurement.model=reports~binom(size=cases,prob=exp(rho)),
+              initializer=function(params, t0, ic.pars, comp.names, ...){
+                x0 <- c(S=0,I=0,R=0,cases=0)
+                N <- exp(params["N"])
+                fracs <- exp(params[ic.pars])
+                x0[comp.names] <- round(N*fracs/sum(fracs))
+                x0
+              },
+              zeronames=c("cases"), # zero this variable after each obsvn.
+              ic.pars=c("S0","I0","R0"), # initial condition parameters
+              comp.names=c("S","I","R") # names of the compartments
+              ),
+         params=log(
+           c(
+             N=50000,
+             beta=60,gamma=8,mu=1/50,
+             rho=0.6,
+             S0=8/60,I0=0.002,R0=1-8/60-0.001
+             )
+           ),
+         seed=677573454L
+         ) -> sir
+@ 
+<<sir-pomp-def-with-skel,eval=F,echo=F>>=
+simulate(
+         pomp(
+              data=data.frame(
+                time=seq(1/52,15,by=1/52),
+                reports=NA
+                ),
+              times="time",
+              t0=0,
+              rprocess=euler.sim(
+                step.fun=sir.proc.sim,
+                delta.t=1/52/20
+                ),
               skeleton.type="vectorfield",
               skeleton=function(t,x,params,...){
                 N <- exp(params["N"])             # population size
@@ -1562,13 +1598,13 @@
                            x["I"]*c(gamma,mu), # exits from I
                            x["R"]*mu           # exits from R
                            )
-                ## now connect the compartments
+                ## now put the equations together:
                 c(
-                  terms[1]-terms[2]-terms[3],
-                  terms[2]-terms[4]-terms[5],
-                  terms[4]-terms[6],
                   ## approx. number of new infections/week:
-                  (terms[2]-terms[4]-terms[5])*gamma/52
+                  cases=unname((terms[2]-terms[4]-terms[5])*gamma/52),
+                  S=unname(terms[1]-terms[2]-terms[3]), # dS/dt
+                  I=unname(terms[2]-terms[4]-terms[5]), # dI/dt
+                  R=unname(terms[4]-terms[6])           # dR/dt
                   )
               },
               measurement.model=reports~binom(size=cases,prob=exp(rho)),

Modified: pkg/inst/doc/intro_to_pomp.pdf
===================================================================
(Binary files differ)



More information about the pomp-commits mailing list