[Pomp-commits] r617 - in pkg: R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 15 23:58:17 CET 2012


Author: kingaa
Date: 2012-02-15 23:58:17 +0100 (Wed, 15 Feb 2012)
New Revision: 617

Modified:
   pkg/R/probe.R
   pkg/inst/NEWS
Log:
- catch error in 'probe' when nsim < nprobes


Modified: pkg/R/probe.R
===================================================================
--- pkg/R/probe.R	2012-02-15 18:52:58 UTC (rev 616)
+++ pkg/R/probe.R	2012-02-15 22:58:17 UTC (rev 617)
@@ -42,6 +42,9 @@
 
             ## apply probes to data
             datval <- .Call(apply_probe_data,object,probes)
+            nprobes <- length(datval)
+            if (nprobes > nsim)
+              stop(sQuote("nsim"),"(=",nsim,") should be (much) larger than the number of probes (=",nprobes,")")
             ## apply probes to model simulations
             simval <- .Call(
                             apply_probe_sim,
@@ -53,7 +56,6 @@
                             datval=datval
                             )
                             
-            nprobes <- length(datval)
             pvals <- numeric(nprobes)
             names(pvals) <- names(datval)
             quants <- numeric(nprobes)

Modified: pkg/inst/NEWS
===================================================================
--- pkg/inst/NEWS	2012-02-15 18:52:58 UTC (rev 616)
+++ pkg/inst/NEWS	2012-02-15 22:58:17 UTC (rev 617)
@@ -6,6 +6,9 @@
      o	The 'gillespie.sir' example has been changed to make the reporting rate equal to 'rho'.
      	Before, it was fixed at 10%.
 
+     o	A new error-trap has been put into 'probe' for the case nsim < nprobes.
+     	Thanks to Dani Jonas for finding this error.
+
 0.40-5
      o	More informative error messages when dimension of state space or data space disagree internally.
 



More information about the pomp-commits mailing list