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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Nov 10 14:53:15 CET 2011


Author: kingaa
Date: 2011-11-10 14:53:14 +0100 (Thu, 10 Nov 2011)
New Revision: 564

Modified:
   pkg/DESCRIPTION
   pkg/R/sannbox.R
   pkg/tests/ou2-probe.Rout.save
Log:
- change SANN algorithm in sannbox to replace non-finite objective-function values with a big number (as is done in optim's SANN).
- update test file


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2011-10-21 07:34:50 UTC (rev 563)
+++ pkg/DESCRIPTION	2011-11-10 13:53:14 UTC (rev 564)
@@ -2,7 +2,7 @@
 Type: Package
 Title: Statistical inference for partially observed Markov processes
 Version: 0.39-4
-Date: 2011-10-21
+Date: 2011-11-10
 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/R/sannbox.R
===================================================================
--- pkg/R/sannbox.R	2011-10-21 07:34:50 UTC (rev 563)
+++ pkg/R/sannbox.R	2011-11-10 13:53:14 UTC (rev 564)
@@ -11,6 +11,8 @@
 
 sannbox <- function (par, fn, control = list(), ...) {
 
+  big <- 1e35  ## a very large number
+
   npar <- length(par)
   neval <- 0
   
@@ -47,7 +49,9 @@
   ## initialization for the algorithm
   laststep <- 0
   thetabest <- thetacurrent <- par
-  ybest <- ycurrent <- fn(thetacurrent,...)
+  ycurrent <- fn(thetacurrent,...)
+  if (!is.finite(ycurrent)) ycurrent <- big
+  ybest <- ycurrent
   neval <- 1
   
   if (control$trace>0)
@@ -71,6 +75,7 @@
                         thetacand
                        )
     ycand <- fn(thetacand,...)
+    if (!is.finite(ycand)) ycand <- big
     neval <- neval+1
     
     ## see if you have a new best.params

Modified: pkg/tests/ou2-probe.Rout.save
===================================================================
--- pkg/tests/ou2-probe.Rout.save	2011-10-21 07:34:50 UTC (rev 563)
+++ pkg/tests/ou2-probe.Rout.save	2011-11-10 13:53:14 UTC (rev 564)
@@ -187,7 +187,8 @@
 In probe.acf(var = c("y1", "y2"), lags = c(0, 1), type = "cor") :
   useless zero lag discarded in 'probe.acf'
 > x <- as.data.frame(po)
-> x <- sweep(x,2,mean(x))
+> mx <- sapply(x,mean)
+> x <- sweep(x,2,mx)
 > y1 <- head(x$y1,-1)
 > z1 <- tail(x$y1,-1)
 > y2 <- head(x$y2,-1)



More information about the pomp-commits mailing list