[Pomp-commits] r762 - branches/mif2/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Aug 7 20:59:06 CEST 2012


Author: nxdao2000
Date: 2012-08-07 20:59:06 +0200 (Tue, 07 Aug 2012)
New Revision: 762

Modified:
   branches/mif2/R/pfilter.R
Log:
correct update

Modified: branches/mif2/R/pfilter.R
===================================================================
--- branches/mif2/R/pfilter.R	2012-08-07 18:58:43 UTC (rev 761)
+++ branches/mif2/R/pfilter.R	2012-08-07 18:59:06 UTC (rev 762)
@@ -24,7 +24,7 @@
 
 pfilter.internal <- function (object, params, Np,
 		tol, max.fail,
-		pred.mean, pred.var, filter.mean, paramMatrix, cooling.scalar,cooling.m, option,
+		pred.mean, pred.var, filter.mean, paramMatrix, cooling.scalar,cooling.m,
 		.rw.sd, seed, verbose,
 		save.states, save.params,
 		transform) {
@@ -180,15 +180,18 @@
 	else
 		paramMatrix <- array(dim=c(0,0))
 	
+	if(missing(cooling.scalar))
+		cooling.scalar <-400
+	if(missing(cooling.m))
+		cooling.m <--1
 	
 	
 	for (nt in seq_len(ntimes)) {
-		if (option=="mif2")
+		if (cooling.m>0)
 		{	  cool.sched <- try(mif.cooling2(cooling.scalar, nt , cooling.m, ntimes), silent = FALSE)
 			if (inherits(cool.sched, "try-error")) 
 				stop("pfilter error: cooling schedule error", call. = FALSE)
 			sigma1=sigma*cool.sched$alpha
-			
 		}	  
 		else
 			sigma1=sigma



More information about the pomp-commits mailing list