[Pomp-commits] r347 - pkg/tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Sep 29 17:48:49 CEST 2010


Author: kingaa
Date: 2010-09-29 17:48:48 +0200 (Wed, 29 Sep 2010)
New Revision: 347

Added:
   pkg/tests/ou2-probe.R
   pkg/tests/ou2-probe.Rout.save
Removed:
   pkg/tests/ou2-probe-match.R
   pkg/tests/ou2-probe-match.Rout.save
Log:

- change name of file
- add in a test of probe.acf and probe.nlar


Deleted: pkg/tests/ou2-probe-match.R
===================================================================
--- pkg/tests/ou2-probe-match.R	2010-09-29 15:38:12 UTC (rev 346)
+++ pkg/tests/ou2-probe-match.R	2010-09-29 15:48:48 UTC (rev 347)
@@ -1,56 +0,0 @@
-library(pomp)
-set.seed(1066L)
-
-data(ou2)
-po <- ou2
-coef(po,c("x1.0","x2.0","alpha.1","alpha.4")) <- c(0,0,0.1,0.2)
-
-pm.ou2 <- probe(
-                ou2,
-                probes=list(
-                  y1.mean=probe.mean(var="y1"),
-                  y2.mean=probe.mean(var="y2"),
-                  y1.sd=probe.sd(var="y1"),
-                  y2.sd=probe.sd(var="y2")
-                  ),
-                nsim=500
-                )
-pm.po <- probe(
-               po,
-               probes=list(
-                 y1.mean=probe.mean(var="y1"),
-                 y2.mean=probe.mean(var="y2"),
-                 y1.sd=probe.sd(var="y1"),
-                 y2.sd=probe.sd(var="y2")
-                 ),
-               nsim=500
-               )
-
-summary(pm.ou2)
-summary(pm.po)
-
-plot(pm.ou2)
-plot(pm.po)
-
-pm.ou2 <- probe(
-                ou2,
-                probes=list(
-                  y1acf=probe.acf(var="y1",lag.max=2,type="corr"),
-                  y2.cov12=probe.cov(vars=c("y1"),lag=12,method="spearman"),
-                  y12.cov8=probe.cov(vars=c("y2","y1"),lag=8,method="pearson")
-                  ),
-                nsim=500
-                )
-                
-summary(pm.ou2)
-
-pb <- probe(
-            ou2,
-            probes=list(
-              y1=probe.quantile(var="y1",prob=seq(0.1,0.9,by=0.1)),
-              probe.acf(var=c("y1","y2"),lag.max=4,transform=identity),
-              pd=probe.period(var="y1",kernel.width=3)
-              ),
-            nsim=200
-            )
-summary(pb)

Deleted: pkg/tests/ou2-probe-match.Rout.save
===================================================================
--- pkg/tests/ou2-probe-match.Rout.save	2010-09-29 15:38:12 UTC (rev 346)
+++ pkg/tests/ou2-probe-match.Rout.save	2010-09-29 15:48:48 UTC (rev 347)
@@ -1,142 +0,0 @@
-
-R version 2.11.1 (2010-05-31)
-Copyright (C) 2010 The R Foundation for Statistical Computing
-ISBN 3-900051-07-0
-
-R is free software and comes with ABSOLUTELY NO WARRANTY.
-You are welcome to redistribute it under certain conditions.
-Type 'license()' or 'licence()' for distribution details.
-
-R is a collaborative project with many contributors.
-Type 'contributors()' for more information and
-'citation()' on how to cite R or R packages in publications.
-
-Type 'demo()' for some demos, 'help()' for on-line help, or
-'help.start()' for an HTML browser interface to help.
-Type 'q()' to quit R.
-
-> library(pomp)
-> set.seed(1066L)
-> 
-> data(ou2)
-> po <- ou2
-> coef(po,c("x1.0","x2.0","alpha.1","alpha.4")) <- c(0,0,0.1,0.2)
-> 
-> pm.ou2 <- probe(
-+                 ou2,
-+                 probes=list(
-+                   y1.mean=probe.mean(var="y1"),
-+                   y2.mean=probe.mean(var="y2"),
-+                   y1.sd=probe.sd(var="y1"),
-+                   y2.sd=probe.sd(var="y2")
-+                   ),
-+                 nsim=500
-+                 )
-> pm.po <- probe(
-+                po,
-+                probes=list(
-+                  y1.mean=probe.mean(var="y1"),
-+                  y2.mean=probe.mean(var="y2"),
-+                  y1.sd=probe.sd(var="y1"),
-+                  y2.sd=probe.sd(var="y2")
-+                  ),
-+                nsim=500
-+                )
-> 
-> summary(pm.ou2)
-$coef
-alpha.1 alpha.2 alpha.3 alpha.4 sigma.1 sigma.2 sigma.3     tau    x1.0    x2.0 
-    0.8    -0.5     0.3     0.9     3.0    -0.5     2.0     1.0    -3.0     4.0 
-
-$nsim
-[1] 500
-
-$quantiles
-y1.mean y2.mean   y1.sd   y2.sd 
-  0.100   0.530   0.024   0.052 
-
-$pvals
-   y1.mean    y2.mean      y1.sd      y2.sd 
-0.20359281 0.94211577 0.05189621 0.10778443 
-
-> summary(pm.po)
-$coef
-alpha.1 alpha.2 alpha.3 alpha.4 sigma.1 sigma.2 sigma.3     tau    x1.0    x2.0 
-    0.1    -0.5     0.3     0.2     3.0    -0.5     2.0     1.0     0.0     0.0 
-
-$nsim
-[1] 500
-
-$quantiles
-y1.mean y2.mean   y1.sd   y2.sd 
-  0.054   0.644   1.000   1.000 
-
-$pvals
-    y1.mean     y2.mean       y1.sd       y2.sd 
-0.111776447 0.714570858 0.003992016 0.003992016 
-
-> 
-> plot(pm.ou2)
-> plot(pm.po)
-> 
-> pm.ou2 <- probe(
-+                 ou2,
-+                 probes=list(
-+                   y1acf=probe.acf(var="y1",lag.max=2,type="corr"),
-+                   y2.cov12=probe.cov(vars=c("y1"),lag=12,method="spearman"),
-+                   y12.cov8=probe.cov(vars=c("y2","y1"),lag=8,method="pearson")
-+                   ),
-+                 nsim=500
-+                 )
->                 
-> summary(pm.ou2)
-$coef
-alpha.1 alpha.2 alpha.3 alpha.4 sigma.1 sigma.2 sigma.3     tau    x1.0    x2.0 
-    0.8    -0.5     0.3     0.9     3.0    -0.5     2.0     1.0    -3.0     4.0 
-
-$nsim
-[1] 500
-
-$quantiles
-y1acf.acf.1.y1 y1acf.acf.2.y1       y2.cov12       y12.cov8 
-         0.092          0.054          0.726          0.462 
-
-$pvals
-y1acf.acf.1.y1 y1acf.acf.2.y1       y2.cov12       y12.cov8 
-     0.1876248      0.1117764      0.5508982      0.9261477 
-
-> 
-> pb <- probe(
-+             ou2,
-+             probes=list(
-+               y1=probe.quantile(var="y1",prob=seq(0.1,0.9,by=0.1)),
-+               probe.acf(var=c("y1","y2"),lag.max=4,transform=identity),
-+               pd=probe.period(var="y1",kernel.width=3)
-+               ),
-+             nsim=200
-+             )
-> summary(pb)
-$coef
-alpha.1 alpha.2 alpha.3 alpha.4 sigma.1 sigma.2 sigma.3     tau    x1.0    x2.0 
-    0.8    -0.5     0.3     0.9     3.0    -0.5     2.0     1.0    -3.0     4.0 
-
-$nsim
-[1] 200
-
-$quantiles
-  y1.10%   y1.20%   y1.30%   y1.40%   y1.50%   y1.60%   y1.70%   y1.80% 
-   0.755    0.790    0.765    0.555    0.335    0.115    0.035    0.025 
-  y1.90% acf.0.y1 acf.1.y1 acf.2.y1 acf.3.y1 acf.4.y1 acf.0.y2 acf.1.y2 
-   0.010    0.035    0.045    0.030    0.115    0.790    0.065    0.060 
-acf.2.y2 acf.3.y2 acf.4.y2       pd 
-   0.080    0.110    0.445    0.060 
-
-$pvals
-    y1.10%     y1.20%     y1.30%     y1.40%     y1.50%     y1.60%     y1.70% 
-0.49751244 0.42786070 0.47761194 0.89552239 0.67661692 0.23880597 0.07960199 
-    y1.80%     y1.90%   acf.0.y1   acf.1.y1   acf.2.y1   acf.3.y1   acf.4.y1 
-0.05970149 0.02985075 0.07960199 0.09950249 0.06965174 0.23880597 0.42786070 
-  acf.0.y2   acf.1.y2   acf.2.y2   acf.3.y2   acf.4.y2         pd 
-0.13930348 0.12935323 0.16915423 0.22885572 0.89552239 0.12935323 
-
-> 

Copied: pkg/tests/ou2-probe.R (from rev 324, pkg/tests/ou2-probe-match.R)
===================================================================
--- pkg/tests/ou2-probe.R	                        (rev 0)
+++ pkg/tests/ou2-probe.R	2010-09-29 15:48:48 UTC (rev 347)
@@ -0,0 +1,74 @@
+library(pomp)
+set.seed(1066L)
+
+data(ou2)
+po <- ou2
+coef(po,c("x1.0","x2.0","alpha.1","alpha.4")) <- c(0,0,0.1,0.2)
+
+pm.ou2 <- probe(
+                ou2,
+                probes=list(
+                  y1.mean=probe.mean(var="y1"),
+                  y2.mean=probe.mean(var="y2"),
+                  y1.sd=probe.sd(var="y1"),
+                  y2.sd=probe.sd(var="y2")
+                  ),
+                nsim=500
+                )
+pm.po <- probe(
+               po,
+               probes=list(
+                 y1.mean=probe.mean(var="y1"),
+                 y2.mean=probe.mean(var="y2"),
+                 y1.sd=probe.sd(var="y1"),
+                 y2.sd=probe.sd(var="y2")
+                 ),
+               nsim=500
+               )
+
+summary(pm.ou2)
+summary(pm.po)
+
+plot(pm.ou2)
+plot(pm.po)
+
+pm.ou2 <- probe(
+                ou2,
+                probes=list(
+                  y1acf=probe.acf(var="y1",lag.max=2,type="corr"),
+                  y2.cov12=probe.cov(vars=c("y1"),lag=12,method="spearman"),
+                  y12.cov8=probe.cov(vars=c("y2","y1"),lag=8,method="pearson")
+                  ),
+                nsim=500
+                )
+                
+summary(pm.ou2)
+
+pb <- probe(
+            ou2,
+            probes=list(
+              y1=probe.quantile(var="y1",prob=seq(0.1,0.9,by=0.1)),
+              probe.acf(var=c("y1","y2"),lag.max=4,transform=identity),
+              pd=probe.period(var="y1",kernel.width=3)
+              ),
+            nsim=200
+            )
+summary(pb)
+
+po <- ou2
+coef(po,c("alpha.2","alpha.3")) <- c(0,0)
+coef(po,c("sigma.2","sigma.1","sigma.3")) <- c(0,0.0,0.0)
+coef(po,c("tau")) <- c(0.0)
+po <- simulate(po)
+pb <- probe(
+            po,
+            probes=list(
+              probe.acf(var=c("y1","y2"),lag.max=1,type="cor"),
+              probe.nlar("y1",lags=1,powers=1),
+              probe.nlar("y2",lags=1,powers=1)
+              ),
+            nsim=1000,
+            seed=1066L
+            )
+summary(pb)
+pb at datvals

Copied: pkg/tests/ou2-probe.Rout.save (from rev 324, pkg/tests/ou2-probe-match.Rout.save)
===================================================================
--- pkg/tests/ou2-probe.Rout.save	                        (rev 0)
+++ pkg/tests/ou2-probe.Rout.save	2010-09-29 15:48:48 UTC (rev 347)
@@ -0,0 +1,142 @@
+
+R version 2.11.1 (2010-05-31)
+Copyright (C) 2010 The R Foundation for Statistical Computing
+ISBN 3-900051-07-0
+
+R is free software and comes with ABSOLUTELY NO WARRANTY.
+You are welcome to redistribute it under certain conditions.
+Type 'license()' or 'licence()' for distribution details.
+
+R is a collaborative project with many contributors.
+Type 'contributors()' for more information and
+'citation()' on how to cite R or R packages in publications.
+
+Type 'demo()' for some demos, 'help()' for on-line help, or
+'help.start()' for an HTML browser interface to help.
+Type 'q()' to quit R.
+
+> library(pomp)
+> set.seed(1066L)
+> 
+> data(ou2)
+> po <- ou2
+> coef(po,c("x1.0","x2.0","alpha.1","alpha.4")) <- c(0,0,0.1,0.2)
+> 
+> pm.ou2 <- probe(
++                 ou2,
++                 probes=list(
++                   y1.mean=probe.mean(var="y1"),
++                   y2.mean=probe.mean(var="y2"),
++                   y1.sd=probe.sd(var="y1"),
++                   y2.sd=probe.sd(var="y2")
++                   ),
++                 nsim=500
++                 )
+> pm.po <- probe(
++                po,
++                probes=list(
++                  y1.mean=probe.mean(var="y1"),
++                  y2.mean=probe.mean(var="y2"),
++                  y1.sd=probe.sd(var="y1"),
++                  y2.sd=probe.sd(var="y2")
++                  ),
++                nsim=500
++                )
+> 
+> summary(pm.ou2)
+$coef
+alpha.1 alpha.2 alpha.3 alpha.4 sigma.1 sigma.2 sigma.3     tau    x1.0    x2.0 
+    0.8    -0.5     0.3     0.9     3.0    -0.5     2.0     1.0    -3.0     4.0 
+
+$nsim
+[1] 500
+
+$quantiles
+y1.mean y2.mean   y1.sd   y2.sd 
+  0.100   0.530   0.024   0.052 
+
+$pvals
+   y1.mean    y2.mean      y1.sd      y2.sd 
+0.20359281 0.94211577 0.05189621 0.10778443 
+
+> summary(pm.po)
+$coef
+alpha.1 alpha.2 alpha.3 alpha.4 sigma.1 sigma.2 sigma.3     tau    x1.0    x2.0 
+    0.1    -0.5     0.3     0.2     3.0    -0.5     2.0     1.0     0.0     0.0 
+
+$nsim
+[1] 500
+
+$quantiles
+y1.mean y2.mean   y1.sd   y2.sd 
+  0.054   0.644   1.000   1.000 
+
+$pvals
+    y1.mean     y2.mean       y1.sd       y2.sd 
+0.111776447 0.714570858 0.003992016 0.003992016 
+
+> 
+> plot(pm.ou2)
+> plot(pm.po)
+> 
+> pm.ou2 <- probe(
++                 ou2,
++                 probes=list(
++                   y1acf=probe.acf(var="y1",lag.max=2,type="corr"),
++                   y2.cov12=probe.cov(vars=c("y1"),lag=12,method="spearman"),
++                   y12.cov8=probe.cov(vars=c("y2","y1"),lag=8,method="pearson")
++                   ),
++                 nsim=500
++                 )
+>                 
+> summary(pm.ou2)
+$coef
+alpha.1 alpha.2 alpha.3 alpha.4 sigma.1 sigma.2 sigma.3     tau    x1.0    x2.0 
+    0.8    -0.5     0.3     0.9     3.0    -0.5     2.0     1.0    -3.0     4.0 
+
+$nsim
+[1] 500
+
+$quantiles
+y1acf.acf.1.y1 y1acf.acf.2.y1       y2.cov12       y12.cov8 
+         0.092          0.054          0.726          0.462 
+
+$pvals
+y1acf.acf.1.y1 y1acf.acf.2.y1       y2.cov12       y12.cov8 
+     0.1876248      0.1117764      0.5508982      0.9261477 
+
+> 
+> pb <- probe(
++             ou2,
++             probes=list(
++               y1=probe.quantile(var="y1",prob=seq(0.1,0.9,by=0.1)),
++               probe.acf(var=c("y1","y2"),lag.max=4,transform=identity),
++               pd=probe.period(var="y1",kernel.width=3)
++               ),
++             nsim=200
++             )
+> summary(pb)
+$coef
+alpha.1 alpha.2 alpha.3 alpha.4 sigma.1 sigma.2 sigma.3     tau    x1.0    x2.0 
+    0.8    -0.5     0.3     0.9     3.0    -0.5     2.0     1.0    -3.0     4.0 
+
+$nsim
+[1] 200
+
+$quantiles
+  y1.10%   y1.20%   y1.30%   y1.40%   y1.50%   y1.60%   y1.70%   y1.80% 
+   0.755    0.790    0.765    0.555    0.335    0.115    0.035    0.025 
+  y1.90% acf.0.y1 acf.1.y1 acf.2.y1 acf.3.y1 acf.4.y1 acf.0.y2 acf.1.y2 
+   0.010    0.035    0.045    0.030    0.115    0.790    0.065    0.060 
+acf.2.y2 acf.3.y2 acf.4.y2       pd 
+   0.080    0.110    0.445    0.060 
+
+$pvals
+    y1.10%     y1.20%     y1.30%     y1.40%     y1.50%     y1.60%     y1.70% 
+0.49751244 0.42786070 0.47761194 0.89552239 0.67661692 0.23880597 0.07960199 
+    y1.80%     y1.90%   acf.0.y1   acf.1.y1   acf.2.y1   acf.3.y1   acf.4.y1 
+0.05970149 0.02985075 0.07960199 0.09950249 0.06965174 0.23880597 0.42786070 
+  acf.0.y2   acf.1.y2   acf.2.y2   acf.3.y2   acf.4.y2         pd 
+0.13930348 0.12935323 0.16915423 0.22885572 0.89552239 0.12935323 
+
+> 



More information about the pomp-commits mailing list