[Pomp-commits] r1237 - in pkg/pomp: inst/examples tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jul 1 21:31:52 CEST 2015
Author: kingaa
Date: 2015-07-01 21:31:52 +0200 (Wed, 01 Jul 2015)
New Revision: 1237
Modified:
pkg/pomp/inst/examples/bbs.R
pkg/pomp/inst/examples/euler.sir.R
pkg/pomp/inst/examples/gillespie.sir.R
pkg/pomp/tests/bbs-trajmatch.R
pkg/pomp/tests/bbs-trajmatch.Rout.save
pkg/pomp/tests/bbs.Rout.save
pkg/pomp/tests/gillespie.R
pkg/pomp/tests/gillespie.Rout.save
pkg/pomp/tests/pfilter.Rout.save
Log:
- change some initial conditions to match those in code
Modified: pkg/pomp/inst/examples/bbs.R
===================================================================
--- pkg/pomp/inst/examples/bbs.R 2015-06-30 11:32:39 UTC (rev 1236)
+++ pkg/pomp/inst/examples/bbs.R 2015-07-01 19:31:52 UTC (rev 1237)
@@ -28,7 +28,7 @@
beta.sd=0,
pop=1400,
rho=0.9,sigma=3.6,
- S.0=0.999,I.0=0.001,R.0=0
+ S_0=0.999,I_0=0.001,R_0=0
),
rprocess=euler.sim(
step.fun="_sir_euler_simulator",
@@ -43,7 +43,7 @@
paramnames=c(
"gamma","mu","iota",
"beta","beta.sd","pop","rho",
- "S.0","I.0","R.0"
+ "S_0","I_0","R_0"
),
zeronames=c("cases"),
nbasis=1L,
@@ -51,7 +51,7 @@
period=1.0,
logvar=c(
"beta","gamma","mu","iota","sigma","beta.sd",
- "S.0","I.0","R.0"
+ "S_0","I_0","R_0"
),
logitvar="rho",
toEstimationScale=function (params, logvar, logitvar, ...) {
Modified: pkg/pomp/inst/examples/euler.sir.R
===================================================================
--- pkg/pomp/inst/examples/euler.sir.R 2015-06-30 11:32:39 UTC (rev 1236)
+++ pkg/pomp/inst/examples/euler.sir.R 2015-07-01 19:31:52 UTC (rev 1237)
@@ -221,7 +221,7 @@
beta.sd=1e-3,
pop=2.1e6,
rho=0.6,
- S.0=26/400,I.0=0.001,R.0=1-26/400
+ S_0=26/400,I_0=0.001,R_0=1-26/400
),
rprocess=euler.sim(
step.fun="_sir_euler_simulator",
@@ -237,7 +237,7 @@
paramnames=c(
"gamma","mu","iota",
"beta1","beta.sd","pop","rho",
- "S.0","I.0","R.0"
+ "S_0","I_0","R_0"
),
zeronames=c("cases"),
fromEstimationScale="_sir_par_trans",
Modified: pkg/pomp/inst/examples/gillespie.sir.R
===================================================================
--- pkg/pomp/inst/examples/gillespie.sir.R 2015-06-30 11:32:39 UTC (rev 1236)
+++ pkg/pomp/inst/examples/gillespie.sir.R 2015-07-01 19:31:52 UTC (rev 1237)
@@ -532,7 +532,7 @@
gamma=24,mu=1/70,iota=0.1,
beta1=330,beta2=410,beta3=490,
rho=0.1,
- S.0=0.05,I.0=1e-4,R.0=0.95,
+ S_0=0.05,I_0=1e-4,R_0=0.95,
pop=1000000,
beta.sd=0
),
@@ -564,11 +564,11 @@
paramnames=c(
"gamma","mu","iota",
"beta1","beta.sd","pop","rho",
- "S.0","I.0","R.0"
+ "S_0","I_0","R_0"
),
zeronames=c("cases"),
comp.names=c("S","I","R"),
- ic.names=c("S.0","I.0","R.0"),
+ ic.names=c("S_0","I_0","R_0"),
fromEstimationScale="_sir_par_trans",
toEstimationScale="_sir_par_untrans",
nbasis=3L,
Modified: pkg/pomp/tests/bbs-trajmatch.R
===================================================================
--- pkg/pomp/tests/bbs-trajmatch.R 2015-06-30 11:32:39 UTC (rev 1236)
+++ pkg/pomp/tests/bbs-trajmatch.R 2015-07-01 19:31:52 UTC (rev 1237)
@@ -5,7 +5,7 @@
guess <- c(
mu=0,gamma=1/3,beta=1,beta.sd=0,iota=0,
pop=1400,rho=0.9,sigma=3.6,
- S.0=1390,I.0=1,R.0=0
+ S_0=1390,I_0=1,R_0=0
)
est <- c("beta","gamma")
Modified: pkg/pomp/tests/bbs-trajmatch.Rout.save
===================================================================
--- pkg/pomp/tests/bbs-trajmatch.Rout.save 2015-06-30 11:32:39 UTC (rev 1236)
+++ pkg/pomp/tests/bbs-trajmatch.Rout.save 2015-07-01 19:31:52 UTC (rev 1237)
@@ -1,5 +1,5 @@
-R version 3.2.0 (2015-04-16) -- "Full of Ingredients"
+R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)
@@ -25,7 +25,7 @@
> guess <- c(
+ mu=0,gamma=1/3,beta=1,beta.sd=0,iota=0,
+ pop=1400,rho=0.9,sigma=3.6,
-+ S.0=1390,I.0=1,R.0=0
++ S_0=1390,I_0=1,R_0=0
+ )
> est <- c("beta","gamma")
>
@@ -81,4 +81,4 @@
>
> proc.time()
user system elapsed
- 2.116 0.064 2.181
+ 2.527 0.055 2.564
Modified: pkg/pomp/tests/bbs.Rout.save
===================================================================
--- pkg/pomp/tests/bbs.Rout.save 2015-06-30 11:32:39 UTC (rev 1236)
+++ pkg/pomp/tests/bbs.Rout.save 2015-07-01 19:31:52 UTC (rev 1237)
@@ -1,5 +1,5 @@
-R version 3.2.0 (2015-04-16) -- "Full of Ingredients"
+R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)
@@ -27,12 +27,12 @@
> coef(bbs)
gamma mu iota beta beta.sd pop
0.3333333 0.0000000 0.0000000 1.4000000 0.0000000 1400.0000000
- rho sigma S.0 I.0 R.0
+ rho sigma S_0 I_0 R_0
0.9000000 3.6000000 0.9990000 0.0010000 0.0000000
> coef(bbs,transform=TRUE)
gamma mu iota beta beta.sd pop
-1.0986123 -Inf -Inf 0.3364722 -Inf 1400.0000000
- rho sigma S.0 I.0 R.0
+ rho sigma S_0 I_0 R_0
2.1972246 1.2809338 -0.0010005 -6.9077553 -Inf
>
> bbs <- pomp(bbs,
@@ -48,7 +48,7 @@
> signif(coef(fit1),3)
gamma mu iota beta beta.sd pop rho sigma
0.333 0.000 0.000 3.570 0.000 1400.000 0.900 1.920
- S.0 I.0 R.0
+ S_0 I_0 R_0
0.999 0.001 0.000
>
> fit2 <- bsmc2(bbs,params=coef(bbs),Np=5000,transform=TRUE,
@@ -56,14 +56,14 @@
> signif(coef(fit2),3)
gamma mu iota beta beta.sd pop rho sigma
0.333 0.000 0.000 3.670 0.000 1400.000 0.900 1.940
- S.0 I.0 R.0
+ S_0 I_0 R_0
0.999 0.001 0.000
>
> fit3 <- traj.match(bbs,est=c("beta","sigma"),transform=TRUE)
> signif(coef(fit3),3)
gamma mu iota beta beta.sd pop rho sigma
0.333 0.000 0.000 2.090 0.000 1400.000 0.900 0.474
- S.0 I.0 R.0
+ S_0 I_0 R_0
0.999 0.001 0.000
>
> sim1 <- simulate(bbs,nsim=20,as.data.frame=TRUE,include.data=TRUE)
@@ -72,4 +72,4 @@
>
> proc.time()
user system elapsed
- 5.636 0.048 5.699
+ 6.228 0.044 6.259
Modified: pkg/pomp/tests/gillespie.R
===================================================================
--- pkg/pomp/tests/gillespie.R 2015-06-30 11:32:39 UTC (rev 1236)
+++ pkg/pomp/tests/gillespie.R 2015-07-01 19:31:52 UTC (rev 1237)
@@ -8,10 +8,10 @@
beta3=490,
gamma=24,
iota=0.1,
- S.0=0.05,
- I.0=1e-4,
- R.0=0.95,
- N.0=1000000
+ S_0=0.05,
+ I_0=1e-4,
+ R_0=0.95,
+ N_0=1000000
)
seasonality <- data.frame(
@@ -65,13 +65,13 @@
measurement.model=reports~binom(size=cases,prob=0.1),
initializer=function(params, t0, ...){
comp.names <- c("S","I","R")
- icnames <- paste(comp.names,"0",sep=".")
+ icnames <- paste(comp.names,"0",sep="_")
snames <- c("S","I","R","N","cases")
fracs <- params[icnames]
x0 <- numeric(length(snames))
names(x0) <- snames
- x0["N"] <- params["N.0"]
- x0[comp.names] <- round(params['N.0']*fracs/sum(fracs))
+ x0["N"] <- params["N_0"]
+ x0[comp.names] <- round(params['N_0']*fracs/sum(fracs))
x0
}
),
Modified: pkg/pomp/tests/gillespie.Rout.save
===================================================================
--- pkg/pomp/tests/gillespie.Rout.save 2015-06-30 11:32:39 UTC (rev 1236)
+++ pkg/pomp/tests/gillespie.Rout.save 2015-07-01 19:31:52 UTC (rev 1237)
@@ -1,5 +1,5 @@
-R version 3.2.0 (2015-04-16) -- "Full of Ingredients"
+R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)
@@ -25,10 +25,10 @@
+ beta3=490,
+ gamma=24,
+ iota=0.1,
-+ S.0=0.05,
-+ I.0=1e-4,
-+ R.0=0.95,
-+ N.0=1000000
++ S_0=0.05,
++ I_0=1e-4,
++ R_0=0.95,
++ N_0=1000000
+ )
>
> seasonality <- data.frame(
@@ -82,13 +82,13 @@
+ measurement.model=reports~binom(size=cases,prob=0.1),
+ initializer=function(params, t0, ...){
+ comp.names <- c("S","I","R")
-+ icnames <- paste(comp.names,"0",sep=".")
++ icnames <- paste(comp.names,"0",sep="_")
+ snames <- c("S","I","R","N","cases")
+ fracs <- params[icnames]
+ x0 <- numeric(length(snames))
+ names(x0) <- snames
-+ x0["N"] <- params["N.0"]
-+ x0[comp.names] <- round(params['N.0']*fracs/sum(fracs))
++ x0["N"] <- params["N_0"]
++ x0[comp.names] <- round(params['N_0']*fracs/sum(fracs))
+ x0
+ }
+ ),
@@ -130,4 +130,4 @@
>
> proc.time()
user system elapsed
- 2.392 0.036 2.456
+ 2.508 0.040 2.529
Modified: pkg/pomp/tests/pfilter.Rout.save
===================================================================
--- pkg/pomp/tests/pfilter.Rout.save 2015-06-30 11:32:39 UTC (rev 1236)
+++ pkg/pomp/tests/pfilter.Rout.save 2015-07-01 19:31:52 UTC (rev 1237)
@@ -1,5 +1,5 @@
-R version 3.2.0 (2015-04-16) -- "Full of Ingredients"
+R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)
@@ -50,7 +50,7 @@
> print(coef(pf))
gamma mu iota beta1 beta2 beta3 beta.sd pop
2.60e+01 2.00e-02 1.00e-02 4.00e+02 4.80e+02 3.20e+02 1.00e-03 2.10e+06
- rho S.0 I.0 R.0
+ rho S_0 I_0 R_0
6.00e-01 6.50e-02 1.00e-03 9.35e-01
> print(pf$loglik,digits=4)
[1] -947.4
@@ -62,7 +62,7 @@
> print(coef(pf))
gamma mu iota beta1 beta2 beta3 beta.sd pop
2.60e+01 2.00e-02 1.00e+00 4.00e+02 4.80e+02 3.20e+02 1.00e-03 2.10e+06
- rho S.0 I.0 R.0
+ rho S_0 I_0 R_0
6.00e-01 6.50e-02 1.00e-03 9.35e-01
> print(logLik(pf),digits=4)
[1] -945.4
@@ -76,4 +76,4 @@
>
> proc.time()
user system elapsed
- 6.308 0.040 6.488
+ 8.475 0.034 8.491
More information about the pomp-commits
mailing list