[Pomp-commits] r755 - branches/mif2/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jul 31 22:54:21 CEST 2012
Author: nxdao2000
Date: 2012-07-31 22:54:21 +0200 (Tue, 31 Jul 2012)
New Revision: 755
Modified:
branches/mif2/R/pfilter.R
Log:
update mif2geom accordingly, also it may need to modify
Modified: branches/mif2/R/pfilter.R
===================================================================
--- branches/mif2/R/pfilter.R 2012-07-31 20:53:35 UTC (rev 754)
+++ branches/mif2/R/pfilter.R 2012-07-31 20:54:21 UTC (rev 755)
@@ -24,7 +24,7 @@
pfilter.internal <- function (object, params, Np,
tol, max.fail,
- pred.mean, pred.var, filter.mean, paramMatrix, cooling.scalar,cooling.m,
+ pred.mean, pred.var, filter.mean, paramMatrix, cooling.scalar,cooling.m,option,
.rw.sd, seed, verbose,
save.states, save.params,
transform) {
@@ -45,7 +45,6 @@
if (missing(tol))
stop(sQuote("pfilter")," error: ",sQuote("tol")," must be specified",call.=FALSE)
-
one.par <- FALSE
times <- time(object,t0=TRUE)
ntimes <- length(times)-1
@@ -180,21 +179,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 (cooling.m>0)
+ if (option=="mif2")
{ 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
+
+ }
## transform the parameters if necessary
if (transform) tparams <- partrans(object,params,dir="forward")
More information about the pomp-commits
mailing list