[Pomp-commits] r881 - in pkg/pompExamples: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jan 11 19:24:48 CET 2014


Author: kingaa
Date: 2014-01-11 19:24:48 +0100 (Sat, 11 Jan 2014)
New Revision: 881

Modified:
   pkg/pompExamples/DESCRIPTION
   pkg/pompExamples/R/budmoth.R
   pkg/pompExamples/R/pertussis.R
   pkg/pompExamples/man/budmoth.Rd
   pkg/pompExamples/man/pertussis.Rd
Log:
- small change to pertussis.sim and budmoth.sim


Modified: pkg/pompExamples/DESCRIPTION
===================================================================
--- pkg/pompExamples/DESCRIPTION	2014-01-10 22:43:03 UTC (rev 880)
+++ pkg/pompExamples/DESCRIPTION	2014-01-11 18:24:48 UTC (rev 881)
@@ -1,8 +1,8 @@
 Package: pompExamples
 Type: Package
 Title: Statistical inference for partially observed Markov processes
-Version: 0.22-1
-Date: 2013-11-11
+Version: 0.23-1
+Date: 2014-01-10
 Maintainer: Aaron A. King <kingaa at umich.edu>
 Authors at R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa at umich.edu"),
 	  person(given=c("Edward","L."),family="Ionides",role=c("aut")),

Modified: pkg/pompExamples/R/budmoth.R
===================================================================
--- pkg/pompExamples/R/budmoth.R	2014-01-10 22:43:03 UTC (rev 880)
+++ pkg/pompExamples/R/budmoth.R	2014-01-11 18:24:48 UTC (rev 881)
@@ -1,9 +1,10 @@
 budmoth.sim <- function (which) {
   if (missing(which)) {
-    cat("available datasets:",
-        sQuote(c("food","para1","para2","tri")),"\n")
+    datasets <- c("food","para1","para2","tri")
+    cat("available datasets:",sQuote(datasets),"\n")
+    invisible(datasets)
   } else {
-    w <- as.character(substitute(which))
+    which <- as.character(substitute(which))
     simulate(
              pomp(
                   data=data.frame(
@@ -13,32 +14,36 @@
                   time="time",
                   t0=-1,
                   params=switch(
-                    w,
+                    which,
                     tri=c(
-                      alpha=0.5, sig.alpha=0.1, gam=50, lambda=22, sig.lambda=0.25, g=0.08, delta=10,
+                      alpha=0.5, sig.alpha=0.1, gam=50, lambda=22,
+                      sig.lambda=0.25, g=0.08, delta=10,
                       a=1.7, sig.a=0.1, w=0.15, beta0=0, beta1=35, u=0.9,
                       sigQobs=0.03, sigNobs=0.5, sigSobs=0.1,
                       Q.0=0.96, N.0=0.02, S.0=0.22
                       ),
                     food=c(
-                      alpha=0.5, sig.alpha=0.1, gam=20, lambda=5, sig.lambda=0.25, g=0.02, delta=10,
+                      alpha=0.5, sig.alpha=0.1, gam=20, lambda=5,
+                      sig.lambda=0.25, g=0.02, delta=10,
                       a=1, sig.a=0.1, w=0, beta0=0, beta1=35, u=0.9,
                       sigQobs=0.03, sigNobs=0.5, sigSobs=0.1,
                       Q.0=0.96, N.0=0.02, S.0=0.22
                       ),
                     para1=c(
-                      alpha=0.5, sig.alpha=0.1, gam=50, lambda=22, sig.lambda=0.25, g=0.08, delta=0.5,
+                      alpha=0.5, sig.alpha=0.1, gam=50, lambda=22,
+                      sig.lambda=0.25, g=0.08, delta=0.5,
                       a=1.7, sig.a=0.1, w=0.15, beta0=0, beta1=35, u=0.9,
                       sigQobs=0.03, sigNobs=0.5, sigSobs=0.1,
                       Q.0=0.96, N.0=0.02, S.0=0.22
                       ),
                     para2=c(
-                      alpha=0.5, sig.alpha=0.1, gam=50, lambda=10, sig.lambda=5, g=0.08, delta=0.5,
+                      alpha=0.5, sig.alpha=0.1, gam=50, lambda=10,
+                      sig.lambda=5, g=0.08, delta=0.5,
                       a=1.7, sig.a=1, w=0.15, beta0=0, beta1=35, u=0.9,
                       sigQobs=0.03, sigNobs=0.5, sigSobs=0.1,
                       Q.0=0.96, N.0=0.02, S.0=0.22
                       ),
-                    stop("unrecognized dataset ",sQuote(w),call.=FALSE)
+                    stop("unrecognized dataset ",sQuote(which),call.=FALSE)
                     ),
                   rprocess=euler.sim(
                     step.fun="budmoth_map",
@@ -75,24 +80,26 @@
                     "g","delta","a","w","sig.a","beta1","sigQobs",
                     "sigNobs", "sigSobs","N.0"
                     ),
-                  parameter.transform=function (params, logitvar, logvar, ...) {
+                  parameter.transform=function (params, logitvar,
+                    logvar, ...) {
                     params[logitvar] <- plogis(params[logitvar])
                     params[logvar] <- exp(params[logvar])
                     params
                   },
-                  parameter.inv.transform=function (params, logitvar, logvar, ...) {
+                  parameter.inv.transform=function (params, logitvar,
+                    logvar, ...) {
                     params[logitvar] <- qlogis(params[logitvar])
                     params[logvar] <- log(params[logvar])
                     params
                   }
                   ),
              seed=switch(
-               w,
+               which,
                tri=1691699385L,
                food=1054866677L,
                para1=1116757478L,
                para2=1361101458L,
-               stop("unrecognized dataset ",sQuote(w),call.=FALSE)
+               stop("unrecognized dataset ",sQuote(which),call.=FALSE)
                )
              )
   }

Modified: pkg/pompExamples/R/pertussis.R
===================================================================
--- pkg/pompExamples/R/pertussis.R	2014-01-10 22:43:03 UTC (rev 880)
+++ pkg/pompExamples/R/pertussis.R	2014-01-11 18:24:48 UTC (rev 881)
@@ -4,11 +4,15 @@
 
 pertussis.sim <- function (which) {
   if (missing(which)) {
-    cat("available datasets:",
-        sQuote(c("SEIR.small","SEIR.big",
-                 "SEIRS.small","SEIRS.big",
-                 "SEIRR.small","SEIRR.big",
-                 "full.small","full.big")),"\n")
+    datasets <- c(
+                  "SEIR.small","SEIR.big",
+                  "SEIRS.small","SEIRS.big",
+                  "SEIRR.small","SEIRR.big",
+                  "full.small","full.big"
+                  )
+
+    cat("available datasets:",sQuote(datasets),"\n")
+    invisible(datasets)
   } else {
     which <- as.character(substitute(which))
     simulate(

Modified: pkg/pompExamples/man/budmoth.Rd
===================================================================
--- pkg/pompExamples/man/budmoth.Rd	2014-01-10 22:43:03 UTC (rev 880)
+++ pkg/pompExamples/man/budmoth.Rd	2014-01-11 18:24:48 UTC (rev 881)
@@ -20,7 +20,7 @@
 plot(budmoth.sim(food))
 plot(budmoth.sim(para1))
 plot(budmoth.sim(para2))
-plot(budmoth.sim(tri))
+plot(budmoth.sim("tri"))
 }
 \seealso{the \dQuote{budmoth-model} vignette}
 \keyword{datasets}

Modified: pkg/pompExamples/man/pertussis.Rd
===================================================================
--- pkg/pompExamples/man/pertussis.Rd	2014-01-10 22:43:03 UTC (rev 880)
+++ pkg/pompExamples/man/pertussis.Rd	2014-01-11 18:24:48 UTC (rev 881)
@@ -18,7 +18,7 @@
 plot(pertussis.sim(SEIR.small))
 plot(pertussis.sim(SEIRS.big))
 plot(pertussis.sim(SEIRR.small))
-plot(pertussis.sim(full.big))
+plot(pertussis.sim("full.big"))
 }
 \seealso{the \dQuote{pertussis-model} vignette}
 \keyword{datasets}



More information about the pomp-commits mailing list