[Pomp-commits] r1050 - in pkg/pomp: . R tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 22 17:10:29 CET 2015


Author: kingaa
Date: 2015-01-22 17:10:29 +0100 (Thu, 22 Jan 2015)
New Revision: 1050

Modified:
   pkg/pomp/DESCRIPTION
   pkg/pomp/R/simulate-pomp.R
   pkg/pomp/tests/bbs.R
   pkg/pomp/tests/bbs.Rout.save
Log:
- fix bug in 'simulate' that shows up when 'include.dir=TRUE'

Modified: pkg/pomp/DESCRIPTION
===================================================================
--- pkg/pomp/DESCRIPTION	2015-01-10 12:36:12 UTC (rev 1049)
+++ pkg/pomp/DESCRIPTION	2015-01-22 16:10:29 UTC (rev 1050)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical Inference for Partially Observed Markov Processes
-Version: 0.58-4
-Date: 2015-01-10
+Version: 0.58-5
+Date: 2015-01-15
 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/pomp/R/simulate-pomp.R
===================================================================
--- pkg/pomp/R/simulate-pomp.R	2015-01-10 12:36:12 UTC (rev 1049)
+++ pkg/pomp/R/simulate-pomp.R	2015-01-22 16:10:29 UTC (rev 1050)
@@ -115,8 +115,7 @@
     if (include.data) {
       od <- as.data.frame(object)
       od$sim <- "data"
-      od <- od[names(retval)]
-      retval <- rbind(od,retval)
+      retval <- merge(od,retval,all=TRUE)
     }
 
     retval$sim <- factor(retval$sim)

Modified: pkg/pomp/tests/bbs.R
===================================================================
--- pkg/pomp/tests/bbs.R	2015-01-10 12:36:12 UTC (rev 1049)
+++ pkg/pomp/tests/bbs.R	2015-01-22 16:10:29 UTC (rev 1050)
@@ -25,3 +25,7 @@
 
 fit3 <- traj.match(bbs,est=c("beta","sigma"),transform=TRUE)
 signif(coef(fit3),3)
+
+sim1 <- simulate(bbs,nsim=20,as.data.frame=TRUE,include.data=TRUE)
+sim2 <- simulate(bbs,nsim=20,as.data.frame=TRUE,obs=TRUE,include.data=TRUE)
+sim3 <- simulate(bbs,nsim=20,as.data.frame=TRUE,states=TRUE,include.data=TRUE)

Modified: pkg/pomp/tests/bbs.Rout.save
===================================================================
--- pkg/pomp/tests/bbs.Rout.save	2015-01-10 12:36:12 UTC (rev 1049)
+++ pkg/pomp/tests/bbs.Rout.save	2015-01-22 16:10:29 UTC (rev 1050)
@@ -67,6 +67,10 @@
      S.0      I.0      R.0 
    0.999    0.001    0.000 
 > 
+> sim1 <- simulate(bbs,nsim=20,as.data.frame=TRUE,include.data=TRUE)
+> sim2 <- simulate(bbs,nsim=20,as.data.frame=TRUE,obs=TRUE,include.data=TRUE)
+> sim3 <- simulate(bbs,nsim=20,as.data.frame=TRUE,states=TRUE,include.data=TRUE)
+> 
 > proc.time()
    user  system elapsed 
-  7.008   0.076   7.124 
+  7.153   0.049   7.193 



More information about the pomp-commits mailing list