[Pomp-commits] r396 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Oct 23 18:00:01 CEST 2010


Author: kingaa
Date: 2010-10-23 18:00:01 +0200 (Sat, 23 Oct 2010)
New Revision: 396

Modified:
   pkg/R/probe-match.R
Log:

- go back to using synthetic likelihood as the objective function
- deal with missing 'nsim'


Modified: pkg/R/probe-match.R
===================================================================
--- pkg/R/probe-match.R	2010-10-23 15:58:49 UTC (rev 395)
+++ pkg/R/probe-match.R	2010-10-23 16:00:01 UTC (rev 396)
@@ -98,7 +98,7 @@
                         verbose = getOption("verbose"), 
                         eval.only = FALSE, fail.value = NA, ...) {
 
-  obj.fn <- probe.mismatch
+  obj.fn <- neg.synth.loglik
 
   if (!is(object,"pomp"))
     stop(sQuote("object")," must be of class ",sQuote("pomp"))
@@ -124,6 +124,13 @@
   if (!all(sapply(probes,function(f)length(formals(f))==1)))
     stop("each probe must be a function of a single argument")            
 
+  if (missing(nsim)) {
+    if (is(object,"probed.pomp"))
+      nsim <- nrow(object at simvals)
+    else
+      stop(sQuote("nsim")," must be supplied")
+  }
+
   if (missing(weights)) weights <- 1
 
   method <- match.arg(method)



More information about the pomp-commits mailing list