[Pomp-commits] r306 - in pkg: . R tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 25 19:43:30 CEST 2010


Author: kingaa
Date: 2010-08-25 19:43:30 +0200 (Wed, 25 Aug 2010)
New Revision: 306

Modified:
   pkg/DESCRIPTION
   pkg/R/probe.R
   pkg/tests/ou2-probe-match.R
   pkg/tests/ou2-probe-match.Rout.save
Log:
- bug fix in 'probe'


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2010-08-24 20:51:15 UTC (rev 305)
+++ pkg/DESCRIPTION	2010-08-25 17:43:30 UTC (rev 306)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical inference for partially observed Markov processes
-Version: 0.32-2
-Date: 2010-08-24
+Version: 0.32-3
+Date: 2010-08-25
 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>

Modified: pkg/R/probe.R
===================================================================
--- pkg/R/probe.R	2010-08-24 20:51:15 UTC (rev 305)
+++ pkg/R/probe.R	2010-08-25 17:43:30 UTC (rev 306)
@@ -101,11 +101,12 @@
                                       seed=seed
                                       )
 
-            pvals <- numeric(length(probes))
-            names(pvals) <- names(probes)
-            quants <- numeric(length(probes))
-            names(quants) <- names(probes)
-            for (k in seq_along(probes)) {
+            nprobes <- length(datval)
+            pvals <- numeric(nprobes)
+            names(pvals) <- names(datval)
+            quants <- numeric(nprobes)
+            names(quants) <- names(datval)
+            for (k in seq_len(nprobes)) {
               tails <- c(sum(simval[,k]>datval[k]),sum(simval[,k]<datval[k])+1)/(nsim+1)
               pvals[k] <- min(c(2*tails,1))
               quants[k] <- sum(simval[,k]<datval[k])/nsim

Modified: pkg/tests/ou2-probe-match.R
===================================================================
--- pkg/tests/ou2-probe-match.R	2010-08-24 20:51:15 UTC (rev 305)
+++ pkg/tests/ou2-probe-match.R	2010-08-25 17:43:30 UTC (rev 306)
@@ -43,3 +43,14 @@
                 )
                 
 summary(pm.ou2)
+
+pb <- probe(
+            ou2,
+            probes=list(
+              y1=probe.quantile(var="y1",prob=seq(0.1,0.9,by=0.1)),
+              acf=probe.acf(var="y2",lag=c(2,4,7),transform=identity),
+              pd=probe.period(var="y1",kernel.width=3)
+              ),
+            nsim=200
+            )
+summary(pb)

Modified: pkg/tests/ou2-probe-match.Rout.save
===================================================================
--- pkg/tests/ou2-probe-match.Rout.save	2010-08-24 20:51:15 UTC (rev 305)
+++ pkg/tests/ou2-probe-match.Rout.save	2010-08-25 17:43:30 UTC (rev 306)
@@ -107,3 +107,33 @@
 0.2235529 0.5469062 0.9261477 
 
 > 
+> pb <- probe(
++             ou2,
++             probes=list(
++               y1=probe.quantile(var="y1",prob=seq(0.1,0.9,by=0.1)),
++               acf=probe.acf(var="y2",lag=c(2,4,7),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% y1.90%   acf1   acf2 
+ 0.755  0.790  0.765  0.555  0.335  0.115  0.035  0.025  0.010  0.160  0.345 
+  acf3     pd 
+ 0.750  0.060 
+
+$pvals
+    y1.10%     y1.20%     y1.30%     y1.40%     y1.50%     y1.60%     y1.70% 
+0.48756219 0.41791045 0.46766169 0.88557214 0.67661692 0.23880597 0.07960199 
+    y1.80%     y1.90%       acf1       acf2       acf3         pd 
+0.05970149 0.02985075 0.32835821 0.69651741 0.49751244 0.12935323 
+
+> 



More information about the pomp-commits mailing list