[Pomp-commits] r756 - in pkg/pomp: . inst tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Aug 3 17:07:45 CEST 2012


Author: kingaa
Date: 2012-08-03 17:07:45 +0200 (Fri, 03 Aug 2012)
New Revision: 756

Modified:
   pkg/pomp/DESCRIPTION
   pkg/pomp/inst/NEWS
   pkg/pomp/tests/ou2-probe.R
   pkg/pomp/tests/ou2-probe.Rout.save
   pkg/pomp/tests/ricker-bsmc.R
   pkg/pomp/tests/ricker-bsmc.Rout.save
   pkg/pomp/tests/ricker-probe.R
   pkg/pomp/tests/ricker-probe.Rout.save
Log:
- clean up tests


Modified: pkg/pomp/DESCRIPTION
===================================================================
--- pkg/pomp/DESCRIPTION	2012-07-31 20:54:21 UTC (rev 755)
+++ pkg/pomp/DESCRIPTION	2012-08-03 15:07:45 UTC (rev 756)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical inference for partially observed Markov processes
-Version: 0.43-3
-Date: 2012-07-31
+Version: 0.43-4
+Date: 2012-08-03
 Author: Aaron A. King, Edward L. Ionides, Carles Breto, Steve Ellner, Bruce Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman
 Maintainer: Aaron A. King <kingaa at umich.edu>
 URL: http://pomp.r-forge.r-project.org

Modified: pkg/pomp/inst/NEWS
===================================================================
--- pkg/pomp/inst/NEWS	2012-07-31 20:54:21 UTC (rev 755)
+++ pkg/pomp/inst/NEWS	2012-08-03 15:07:45 UTC (rev 756)
@@ -1,4 +1,7 @@
 NEWS
+0.43-4
+     o	Clean up tests.
+
 0.43-3
      o	Fix bug in 'pompBuilder' on mac.
 

Modified: pkg/pomp/tests/ou2-probe.R
===================================================================
--- pkg/pomp/tests/ou2-probe.R	2012-07-31 20:54:21 UTC (rev 755)
+++ pkg/pomp/tests/ou2-probe.R	2012-08-03 15:07:45 UTC (rev 756)
@@ -82,7 +82,8 @@
 z1 <- tail(x$y1,-1)
 y2 <- head(x$y2,-1)
 z2 <- tail(x$y2,-1)
-max(abs(pb at datvals-c(mean(y1*z1)/mean(x$y1^2),mean(y2*z2)/mean(x$y2^2),mean(y1*z1)/mean(y1*y1),mean(y2*z2)/mean(y2*y2))))
+small.diff <- pb at datvals-c(mean(y1*z1)/mean(x$y1^2),mean(y2*z2)/mean(x$y2^2),mean(y1*z1)/mean(y1*y1),mean(y2*z2)/mean(y2*y2))
+stopifnot(max(abs(small.diff))<.Machine$double.eps*100)
 
 po <- simulate(ou2)
 pb <- probe(

Modified: pkg/pomp/tests/ou2-probe.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-probe.Rout.save	2012-07-31 20:54:21 UTC (rev 755)
+++ pkg/pomp/tests/ou2-probe.Rout.save	2012-08-03 15:07:45 UTC (rev 756)
@@ -1,5 +1,5 @@
 
-R version 2.15.0 (2012-03-30)
+R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
 Copyright (C) 2012 The R Foundation for Statistical Computing
 ISBN 3-900051-07-0
 Platform: x86_64-unknown-linux-gnu (64-bit)
@@ -193,8 +193,8 @@
 > z1 <- tail(x$y1,-1)
 > y2 <- head(x$y2,-1)
 > z2 <- tail(x$y2,-1)
-> max(abs(pb at datvals-c(mean(y1*z1)/mean(x$y1^2),mean(y2*z2)/mean(x$y2^2),mean(y1*z1)/mean(y1*y1),mean(y2*z2)/mean(y2*y2))))
-[1] 1.110223e-16
+> small.diff <- pb at datvals-c(mean(y1*z1)/mean(x$y1^2),mean(y2*z2)/mean(x$y2^2),mean(y1*z1)/mean(y1*y1),mean(y2*z2)/mean(y2*y2))
+> stopifnot(max(abs(small.diff))<.Machine$double.eps*100)
 > 
 > po <- simulate(ou2)
 > pb <- probe(
@@ -294,4 +294,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  1.292   0.028   1.377 
+  1.320   0.040   1.484 

Modified: pkg/pomp/tests/ricker-bsmc.R
===================================================================
--- pkg/pomp/tests/ricker-bsmc.R	2012-07-31 20:54:21 UTC (rev 755)
+++ pkg/pomp/tests/ricker-bsmc.R	2012-08-03 15:07:45 UTC (rev 756)
@@ -15,11 +15,11 @@
 
 fit <- bsmc(ricker,params=params,est=c("r","sigma"),transform=TRUE,smooth=0.2)
 
-print(apply(fit$prior[c("r","sigma"),],1,mean))
+invisible(apply(fit$prior[c("r","sigma"),],1,mean))
 
-print(apply(fit$post[c("r","sigma"),],1,mean))
+invisible(apply(fit$post[c("r","sigma"),],1,mean))
 
-print(coef(fit))
+invisible(coef(fit))
 
 plot(fit,thin=300)
 

Modified: pkg/pomp/tests/ricker-bsmc.Rout.save
===================================================================
--- pkg/pomp/tests/ricker-bsmc.Rout.save	2012-07-31 20:54:21 UTC (rev 755)
+++ pkg/pomp/tests/ricker-bsmc.Rout.save	2012-08-03 15:07:45 UTC (rev 756)
@@ -1,5 +1,5 @@
 
-R version 2.15.0 (2012-03-30)
+R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
 Copyright (C) 2012 The R Foundation for Statistical Computing
 ISBN 3-900051-07-0
 Platform: x86_64-unknown-linux-gnu (64-bit)
@@ -39,17 +39,11 @@
 In sample.int(n = Np, size = Np, replace = TRUE, prob = g) :
   Walker's alias method used: results are different from R < 2.2.0
 > 
-> print(apply(fit$prior[c("r","sigma"),],1,mean))
-         r      sigma 
- 3.4894675 -0.7495206 
+> invisible(apply(fit$prior[c("r","sigma"),],1,mean))
 > 
-> print(apply(fit$post[c("r","sigma"),],1,mean))
-        r     sigma 
- 3.890965 -1.766350 
+> invisible(apply(fit$post[c("r","sigma"),],1,mean))
 > 
-> print(coef(fit))
-         r      sigma        phi        N.0        e.0 
-50.0502049  0.1702842 10.0000000  7.0000000  0.0000000 
+> invisible(coef(fit))
 > 
 > plot(fit,thin=300)
 > 
@@ -59,4 +53,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 21.989   0.068  22.270 
+ 23.861   0.076  24.137 

Modified: pkg/pomp/tests/ricker-probe.R
===================================================================
--- pkg/pomp/tests/ricker-probe.R	2012-07-31 20:54:21 UTC (rev 755)
+++ pkg/pomp/tests/ricker-probe.R	2012-08-03 15:07:45 UTC (rev 756)
@@ -16,7 +16,7 @@
             seed=838775L
             )
 plot(pb)
-summary(pb)
+invisible(summary(pb))
 
 pb <- probe(
             po,
@@ -25,7 +25,7 @@
             seed=838775L
             )
 plot(pb)
-summary(pb)
+invisible(summary(pb))
 
 pb <- probe(
             po,
@@ -34,7 +34,7 @@
             seed=838775L
             )
 plot(pb)
-summary(pb)
+invisible(summary(pb))
 
 pb <- probe(
             po,
@@ -43,7 +43,7 @@
             seed=838775L
             )
 plot(pb)
-summary(pb)
+invisible(summary(pb))
 
 pb <- probe(
             po,
@@ -57,8 +57,8 @@
             nsim=1000,
             seed=838775L
             )
-pb at datvals
-summary(pb)
+invisible(pb at datvals)
+invisible(summary(pb))
 plot(pb)
 
 pb <- probe(
@@ -80,13 +80,13 @@
             nsim=1000,
             seed=838775L
             )
-pb at datvals
-summary(pb)
+invisible(pb at datvals)
+invisible(summary(pb))
 plot(pb)
 
 pbm <- probe.match(pb,eval.only=TRUE)
 plot(pbm)
-summary(pbm)
+invisible(summary(pb))
 
 coef(po) <- c(r=10,sigma=0.3,phi=20,N.0=5,e.0=0)
 
@@ -102,8 +102,8 @@
             nsim=1000,
             seed=838775L
             )
-pb at datvals
-summary(pb)
+invisible(pb at datvals)
+invisible(summary(pb))
 plot(pb)
 
 pm <- probe.match(
@@ -119,7 +119,7 @@
                   )
 plot(pm)
 
-cbind(truth=coef(ricker),est=coef(pm),guess=coef(po))
+invisible(cbind(truth=coef(ricker),est=coef(pm),guess=coef(po)))
 
 pb <- probe(
             po,
@@ -132,8 +132,8 @@
             nsim=1000,
             seed=838775L
             )
-pb at datvals
-summary(pb)
+invisible(pb at datvals)
+invisible(summary(pb))
 plot(pb)
 
 pm <- probe.match(
@@ -151,7 +151,7 @@
 plot(as(pm,"pomp"),variables="y")
 plot(simulate(pm),variables="y")
 
-cbind(truth=coef(ricker),est=coef(pm),guess=coef(po))
+invisible(cbind(truth=coef(ricker),est=coef(pm),guess=coef(po)))
 
 pb <- probe(
             po,
@@ -165,8 +165,8 @@
             nsim=1000,
             seed=838775L
             )
-pb at datvals
-summary(pb)
+invisible(pb at datvals)
+invisible(summary(pb))
 plot(pb)
 
 pb <- probe(
@@ -180,8 +180,8 @@
             nsim=1000,
             seed=838775L
             )
-pb at datvals
-summary(pb)
+invisible(pb at datvals)
+invisible(summary(pb))
 plot(pb)
 
 pb <- probe(
@@ -195,8 +195,8 @@
             nsim=1000,
             seed=838775L
             )
-pb at datvals
-summary(pb)
+invisible(pb at datvals)
+invisible(summary(pb))
 plot(pb)
 
 pb <- probe(
@@ -219,8 +219,8 @@
             nsim=1000,
             seed=838775L
             )
-pb at datvals
-summary(pb)
+invisible(pb at datvals)
+invisible(summary(pb))
 plot(pb)
 
 try(

Modified: pkg/pomp/tests/ricker-probe.Rout.save
===================================================================
--- pkg/pomp/tests/ricker-probe.Rout.save	2012-07-31 20:54:21 UTC (rev 755)
+++ pkg/pomp/tests/ricker-probe.Rout.save	2012-08-03 15:07:45 UTC (rev 756)
@@ -1,5 +1,5 @@
 
-R version 2.15.0 (2012-03-30)
+R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
 Copyright (C) 2012 The R Foundation for Statistical Computing
 ISBN 3-900051-07-0
 Platform: x86_64-unknown-linux-gnu (64-bit)
@@ -37,23 +37,7 @@
 +             seed=838775L
 +             )
 > plot(pb)
-> summary(pb)
-$coef
-       r    sigma      phi      N.0      e.0 
-44.70118  0.30000 10.00000  7.00000  0.00000 
-
-$nsim
-[1] 1000
-
-$quantiles
-[1] 0.782
-
-$pvals
-[1] 0.3496503
-
-$synth.loglik
-[1] -2.437844
-
+> invisible(summary(pb))
 > 
 > pb <- probe(
 +             po,
@@ -62,25 +46,7 @@
 +             seed=838775L
 +             )
 > plot(pb)
-> summary(pb)
-$coef
-       r    sigma      phi      N.0      e.0 
-44.70118  0.30000 10.00000  7.00000  0.00000 
-
-$nsim
-[1] 1000
-
-$quantiles
-nlar.1^1 nlar.2^1 nlar.3^1 
-   0.166    0.251    0.803 
-
-$pvals
- nlar.1^1  nlar.2^1  nlar.3^1 
-0.3336663 0.5034965 0.3956044 
-
-$synth.loglik
-[1] 2.805501
-
+> invisible(summary(pb))
 > 
 > pb <- probe(
 +             po,
@@ -89,25 +55,7 @@
 +             seed=838775L
 +             )
 > plot(pb)
-> summary(pb)
-$coef
-       r    sigma      phi      N.0      e.0 
-44.70118  0.30000 10.00000  7.00000  0.00000 
-
-$nsim
-[1] 1000
-
-$quantiles
-nlar.1^1 nlar.2^1 nlar.3^1 
-   0.166    0.251    0.803 
-
-$pvals
- nlar.1^1  nlar.2^1  nlar.3^1 
-0.3336663 0.5034965 0.3956044 
-
-$synth.loglik
-[1] 2.805501
-
+> invisible(summary(pb))
 > 
 > pb <- probe(
 +             po,
@@ -116,25 +64,7 @@
 +             seed=838775L
 +             )
 > plot(pb)
-> summary(pb)
-$coef
-       r    sigma      phi      N.0      e.0 
-44.70118  0.30000 10.00000  7.00000  0.00000 
-
-$nsim
-[1] 1000
-
-$quantiles
-nlar.1^1 nlar.1^2 nlar.1^3 
-   0.403    0.805    0.323 
-
-$pvals
- nlar.1^1  nlar.1^2  nlar.1^3 
-0.8071928 0.3916084 0.6473526 
-
-$synth.loglik
-[1] 7.383561
-
+> invisible(summary(pb))
 > 
 > pb <- probe(
 +             po,
@@ -148,28 +78,8 @@
 +             nsim=1000,
 +             seed=838775L
 +             )
-> pb at datvals
-      marg.1       marg.2       marg.3 
-1.000000e+00 2.308125e-18 9.896164e-19 
-> summary(pb)
-$coef
-       r    sigma      phi      N.0      e.0 
-44.70118  0.30000 10.00000  7.00000  0.00000 
-
-$nsim
-[1] 1000
-
-$quantiles
-marg.1 marg.2 marg.3 
- 0.855  0.284  0.275 
-
-$pvals
-   marg.1    marg.2    marg.3 
-0.2917083 0.5694306 0.5514486 
-
-$synth.loglik
-[1] 12.42156
-
+> invisible(pb at datvals)
+> invisible(summary(pb))
 > plot(pb)
 > 
 > pb <- probe(
@@ -191,72 +101,13 @@
 +             nsim=1000,
 +             seed=838775L
 +             )
-> pb at datvals
-       marg.1        marg.2        marg.3       acf.0.y       acf.1.y 
- 1.000000e+00  2.308125e-18  9.896164e-19  3.679493e+03 -1.275470e+03 
-      acf.3.y       acf.5.y          mean 
- 4.212841e+02  2.954671e+02  4.430440e+00 
-> summary(pb)
-$coef
-       r    sigma      phi      N.0      e.0 
-44.70118  0.30000 10.00000  7.00000  0.00000 
-
-$nsim
-[1] 1000
-
-$quantiles
- marg.1  marg.2  marg.3 acf.0.y acf.1.y acf.3.y acf.5.y    mean 
-  0.855   0.284   0.275   0.647   0.034   0.920   0.686   0.838 
-
-$pvals
-    marg.1     marg.2     marg.3    acf.0.y    acf.1.y    acf.3.y    acf.5.y 
-0.29170829 0.56943057 0.55144855 0.70729271 0.06993007 0.16183816 0.62937063 
-      mean 
-0.32567433 
-
-$synth.loglik
-[1] -14.89908
-
+> invisible(pb at datvals)
+> invisible(summary(pb))
 > plot(pb)
 > 
 > pbm <- probe.match(pb,eval.only=TRUE)
 > plot(pbm)
-> summary(pbm)
-$coef
-       r    sigma      phi      N.0      e.0 
-44.70118  0.30000 10.00000  7.00000  0.00000 
-
-$nsim
-[1] 1000
-
-$quantiles
- marg.1  marg.2  marg.3 acf.0.y acf.1.y acf.3.y acf.5.y    mean 
-  0.857   0.281   0.276   0.648   0.035   0.899   0.708   0.830 
-
-$pvals
-    marg.1     marg.2     marg.3    acf.0.y    acf.1.y    acf.3.y    acf.5.y 
-0.28771229 0.56343656 0.55344655 0.70529471 0.07192807 0.20379620 0.58541459 
-      mean 
-0.34165834 
-
-$synth.loglik
-[1] -14.7743
-
-$est
-character(0)
-
-$value
-[1] 15.31774
-
-$eval
-[1] 1 0
-
-$convergence
-[1] NA
-
-$msg
-[1] "no optimization performed"
-
+> invisible(summary(pb))
 > 
 > coef(po) <- c(r=10,sigma=0.3,phi=20,N.0=5,e.0=0)
 > 
@@ -272,28 +123,8 @@
 +             nsim=1000,
 +             seed=838775L
 +             )
-> pb at datvals
-      marg.1       marg.2       marg.3 
-1.000000e+00 2.308125e-18 9.896164e-19 
-> summary(pb)
-$coef
-    r sigma   phi   N.0   e.0 
- 10.0   0.3  20.0   5.0   0.0 
-
-$nsim
-[1] 1000
-
-$quantiles
-marg.1 marg.2 marg.3 
- 1.000  0.115  0.218 
-
-$pvals
-     marg.1      marg.2      marg.3 
-0.001998002 0.231768232 0.437562438 
-
-$synth.loglik
-[1] -19.71994
-
+> invisible(pb at datvals)
+> invisible(summary(pb))
 > plot(pb)
 > 
 > pm <- probe.match(
@@ -309,13 +140,7 @@
 +                   )
 > plot(pm)
 > 
-> cbind(truth=coef(ricker),est=coef(pm),guess=coef(po))
-         truth       est guess
-r     44.70118 15.509632  10.0
-sigma  0.30000  0.300000   0.3
-phi   10.00000 32.376974  20.0
-N.0    7.00000  2.898467   5.0
-e.0    0.00000  0.000000   0.0
+> invisible(cbind(truth=coef(ricker),est=coef(pm),guess=coef(po)))
 > 
 > pb <- probe(
 +             po,
@@ -328,28 +153,8 @@
 +             nsim=1000,
 +             seed=838775L
 +             )
-> pb at datvals
-   nlar.1^1    nlar.1^2    nlar.1^3 
--0.50800036 -0.12068721  0.01214788 
-> summary(pb)
-$coef
-    r sigma   phi   N.0   e.0 
- 10.0   0.3  20.0   5.0   0.0 
-
-$nsim
-[1] 1000
-
-$quantiles
-nlar.1^1 nlar.1^2 nlar.1^3 
-   0.999    0.078    0.065 
-
-$pvals
-   nlar.1^1    nlar.1^2    nlar.1^3 
-0.003996004 0.157842158 0.131868132 
-
-$synth.loglik
-[1] -5.862151
-
+> invisible(pb at datvals)
+> invisible(summary(pb))
 > plot(pb)
 > 
 > pm <- probe.match(
@@ -367,13 +172,7 @@
 > plot(as(pm,"pomp"),variables="y")
 > plot(simulate(pm),variables="y")
 > 
-> cbind(truth=coef(ricker),est=coef(pm),guess=coef(po))
-         truth       est guess
-r     44.70118  5.569172  10.0
-sigma  0.30000  0.300000   0.3
-phi   10.00000 32.412299  20.0
-N.0    7.00000  7.298905   5.0
-e.0    0.00000  0.000000   0.0
+> invisible(cbind(truth=coef(ricker),est=coef(pm),guess=coef(po)))
 > 
 > pb <- probe(
 +             po,
@@ -387,28 +186,8 @@
 +             nsim=1000,
 +             seed=838775L
 +             )
-> pb at datvals
-   marg.1    marg.2    marg.3 
-24.879460 -5.950185 -2.211594 
-> summary(pb)
-$coef
-    r sigma   phi   N.0   e.0 
- 10.0   0.3  20.0   5.0   0.0 
-
-$nsim
-[1] 1000
-
-$quantiles
-marg.1 marg.2 marg.3 
-  1.00   0.00   0.32 
-
-$pvals
-     marg.1      marg.2      marg.3 
-0.001998002 0.001998002 0.641358641 
-
-$synth.loglik
-[1] -56.62876
-
+> invisible(pb at datvals)
+> invisible(summary(pb))
 > plot(pb)
 > 
 > pb <- probe(
@@ -422,28 +201,8 @@
 +             nsim=1000,
 +             seed=838775L
 +             )
-> pb at datvals
-  acf.0.y   acf.1.y   acf.2.y   acf.3.y   acf.4.y   acf.5.y 
-21.763354 -7.220449 -4.970518  3.099575 -2.823081  1.507337 
-> summary(pb)
-$coef
-       r    sigma      phi      N.0      e.0 
-44.70118  0.30000 10.00000  7.00000  0.00000 
-
-$nsim
-[1] 1000
-
-$quantiles
-acf.0.y acf.1.y acf.2.y acf.3.y acf.4.y acf.5.y 
-  0.592   0.067   0.315   0.907   0.144   0.658 
-
-$pvals
-  acf.0.y   acf.1.y   acf.2.y   acf.3.y   acf.4.y   acf.5.y 
-0.8171828 0.1358641 0.6313686 0.1878122 0.2897103 0.6853147 
-
-$synth.loglik
-[1] -12.45474
-
+> invisible(pb at datvals)
+> invisible(summary(pb))
 > plot(pb)
 > 
 > pb <- probe(
@@ -457,28 +216,8 @@
 +             nsim=1000,
 +             seed=838775L
 +             )
-> pb at datvals
-    acf.1.y     acf.2.y     acf.3.y     acf.4.y     acf.5.y 
--0.33177095 -0.22838933  0.14242173 -0.12971720  0.06926033 
-> summary(pb)
-$coef
-       r    sigma      phi      N.0      e.0 
-44.70118  0.30000 10.00000  7.00000  0.00000 
-
-$nsim
-[1] 1000
-
-$quantiles
-acf.1.y acf.2.y acf.3.y acf.4.y acf.5.y 
-  0.152   0.317   0.896   0.143   0.653 
-
-$pvals
-  acf.1.y   acf.2.y   acf.3.y   acf.4.y   acf.5.y 
-0.3056943 0.6353646 0.2097902 0.2877123 0.6953047 
-
-$synth.loglik
-[1] 5.174849
-
+> invisible(pb at datvals)
+> invisible(summary(pb))
 > plot(pb)
 > 
 > pb <- probe(
@@ -501,28 +240,8 @@
 +             nsim=1000,
 +             seed=838775L
 +             )
-> pb at datvals
-         v    acf.0.y    acf.1.y    acf.2.y   nlar.1^1   nlar.2^1 
-22.1986212 21.7633541 -7.2204486 -4.9705179 -0.4637368 -0.3923487 
-> summary(pb)
-$coef
-       r    sigma      phi      N.0      e.0 
-44.70118  0.30000 10.00000  7.00000  0.00000 
-
-$nsim
-[1] 1000
-
-$quantiles
-       v  acf.0.y  acf.1.y  acf.2.y nlar.1^1 nlar.2^1 
-   0.592    0.592    0.067    0.315    0.105    0.133 
-
-$pvals
-        v   acf.0.y   acf.1.y   acf.2.y  nlar.1^1  nlar.2^1 
-0.8171828 0.8171828 0.1358641 0.6313686 0.2117882 0.2677323 
-
-$synth.loglik
-[1] 29.82456
-
+> invisible(pb at datvals)
+> invisible(summary(pb))
 > plot(pb)
 > 
 > try(
@@ -577,4 +296,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 13.044   0.064  13.327 
+ 12.404   0.060  12.659 



More information about the pomp-commits mailing list