[Pomp-commits] r1198 - pkg/pomp/inst/examples
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jun 11 13:55:58 CEST 2015
Author: kingaa
Date: 2015-06-11 13:55:58 +0200 (Thu, 11 Jun 2015)
New Revision: 1198
Modified:
pkg/pomp/inst/examples/bbs.R
pkg/pomp/inst/examples/euler.sir.R
pkg/pomp/inst/examples/gillespie.sir.R
Log:
- fix error in paramnames alignment with SIR models
Modified: pkg/pomp/inst/examples/bbs.R
===================================================================
--- pkg/pomp/inst/examples/bbs.R 2015-06-11 11:55:53 UTC (rev 1197)
+++ pkg/pomp/inst/examples/bbs.R 2015-06-11 11:55:58 UTC (rev 1198)
@@ -42,7 +42,7 @@
statenames=c("S","I","R","cases","W"),
paramnames=c(
"gamma","mu","iota",
- "beta","beta.sd","pop","rho","sigma",
+ "beta","beta.sd","pop","rho",
"S.0","I.0","R.0"
),
zeronames=c("cases"),
Modified: pkg/pomp/inst/examples/euler.sir.R
===================================================================
--- pkg/pomp/inst/examples/euler.sir.R 2015-06-11 11:55:53 UTC (rev 1197)
+++ pkg/pomp/inst/examples/euler.sir.R 2015-06-11 11:55:58 UTC (rev 1198)
@@ -220,7 +220,7 @@
beta1=400,beta2=480,beta3=320,
beta.sd=1e-3,
pop=2.1e6,
- rho=0.6,overdisp=1,
+ rho=0.6,
S.0=26/400,I.0=0.001,R.0=1-26/400
),
rprocess=euler.sim(
@@ -236,7 +236,7 @@
statenames=c("S","I","R","cases","W"),
paramnames=c(
"gamma","mu","iota",
- "beta1","beta.sd","pop","rho","overdisp",
+ "beta1","beta.sd","pop","rho",
"S.0","I.0","R.0"
),
zeronames=c("cases"),
Modified: pkg/pomp/inst/examples/gillespie.sir.R
===================================================================
--- pkg/pomp/inst/examples/gillespie.sir.R 2015-06-11 11:55:53 UTC (rev 1197)
+++ pkg/pomp/inst/examples/gillespie.sir.R 2015-06-11 11:55:58 UTC (rev 1198)
@@ -575,8 +575,7 @@
degree=3L,
period=1.0,
initializer=function(params, t0, comp.names, ic.names, ...) {
- x0 <- numeric(5)
- names(x0) <- c("S","I","R","N","cases")
+ x0 <- setNames(numeric(5),c("S","I","R","N","cases"))
fracs <- params[ic.names]
x0["N"] <- params["pop"]
x0[comp.names] <- round(params["pop"]*fracs/sum(fracs))
More information about the pomp-commits
mailing list