[Pomp-commits] r892 - pkg/pomp/tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Mar 16 23:13:38 CET 2014


Author: kingaa
Date: 2014-03-16 23:13:37 +0100 (Sun, 16 Mar 2014)
New Revision: 892

Modified:
   pkg/pomp/tests/bbs.Rout.save
   pkg/pomp/tests/ou2-bsmc.Rout.save
   pkg/pomp/tests/ricker-bsmc.Rout.save
Log:
- update 3 tests


Modified: pkg/pomp/tests/bbs.Rout.save
===================================================================
--- pkg/pomp/tests/bbs.Rout.save	2014-03-16 21:57:33 UTC (rev 891)
+++ pkg/pomp/tests/bbs.Rout.save	2014-03-16 22:13:37 UTC (rev 892)
@@ -37,16 +37,21 @@
          rho        sigma          S.0          I.0          R.0 
    2.1972246    1.2809338   -0.0010005   -6.9077553         -Inf 
 > 
-> prior <- parmat(coef(bbs),nrep=1000)
-> prior["beta",] <- exp(runif(n=1000,min=1,max=2))
-> prior["sigma",] <- runif(n=1000,min=2,max=4)
-> fit1 <- bsmc(bbs,params=prior,transform=TRUE,est=c("beta","sigma"),smooth=0.2)
+> bbs <- pomp(bbs,
++             rprior=function(params,...){
++               params["beta"] <- exp(runif(n=1,min=1,max=2))
++               params["sigma"] <- runif(n=1,min=2,max=4)
++               params
++             }
++             )
+> 
+> fit1 <- bsmc(bbs,params=coef(bbs),Np=1000,transform=TRUE,est=c("beta","sigma"),smooth=0.2)
 Warning message:
 In sample.int(n = Np, size = Np, replace = TRUE, prob = g) :
   Walker's alias method used: results are different from R < 2.2.0
 > signif(coef(fit1),3)
    gamma       mu     iota     beta  beta.sd      pop      rho    sigma 
-   0.333    0.000    0.000    3.220    0.000 1400.000    0.900    2.240 
+   0.333    0.000    0.000    3.630    0.000 1400.000    0.900    2.220 
      S.0      I.0      R.0 
    0.999    0.001    0.000 
 > 
@@ -59,4 +64,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  2.824   0.036   2.881 
+  2.784   0.068   2.880 

Modified: pkg/pomp/tests/ou2-bsmc.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-bsmc.Rout.save	2014-03-16 21:57:33 UTC (rev 891)
+++ pkg/pomp/tests/ou2-bsmc.Rout.save	2014-03-16 22:13:37 UTC (rev 892)
@@ -63,7 +63,7 @@
 > post <- smc$post
 > 
 > print(etime <- toc-tic)
-Time difference of 2.936097 secs
+Time difference of 2.921494 secs
 > 
 > print(
 +       cbind(
@@ -90,6 +90,12 @@
 > print(smc$log.evidence)
 [1] 45.47584
 > 
+> ou2 <- pomp(ou2,
++             rprior=function(params,...){
++               params
++             }
++             )
+> 
 > smc <- bsmc(ou2,ntries=5,Np=5000,smooth=0.1,est=estnames,seed=648651945L)
 > print(smc$eff.sample.size)
  [1] 186.40437  36.29100  57.56951  29.30424 180.23722  34.63366 156.94264
@@ -99,4 +105,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  4.808   0.060   4.897 
+  4.788   0.072   4.889 

Modified: pkg/pomp/tests/ricker-bsmc.Rout.save
===================================================================
--- pkg/pomp/tests/ricker-bsmc.Rout.save	2014-03-16 21:57:33 UTC (rev 891)
+++ pkg/pomp/tests/ricker-bsmc.Rout.save	2014-03-16 22:13:37 UTC (rev 892)
@@ -25,14 +25,18 @@
 + 
 +   set.seed(6457673L)
 + 
-+   po <- ricker
++   po <- pomp(
++              ricker,
++              rprior=function (params, ...) {
++                params["r"] <- exp(runif(n=1,min=2,max=5))
++                params["sigma"] <- runif(n=1,min=0.1,max=1)
++                params
++              }
++              )
 + 
 +   Np <- 10000
-+   params <- parmat(coef(ricker),nrep=Np)
-+   params["r",] <- exp(runif(n=Np,min=2,max=5))
-+   params["sigma",] <- runif(n=Np,min=0.1,max=1)
 + 
-+   fit <- bsmc(ricker,params=params,est=c("r","sigma"),transform=TRUE,smooth=0.2)
++   fit <- bsmc(po,Np=1000,est=c("r","sigma"),transform=TRUE,smooth=0.2)
 + 
 +   invisible(apply(fit$prior[c("r","sigma"),],1,mean))
 + 
@@ -58,4 +62,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 22.097   0.064  22.399 
+  3.000   0.060   3.231 



More information about the pomp-commits mailing list