[Pomp-commits] r1223 - in pkg/pomp: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jun 18 19:55:14 CEST 2015


Author: kingaa
Date: 2015-06-18 19:55:13 +0200 (Thu, 18 Jun 2015)
New Revision: 1223

Modified:
   pkg/pomp/DESCRIPTION
   pkg/pomp/R/mif2.R
Log:
- mif2 now stores the perturbation-size matrix rather than the list of unevaluated expressions

Modified: pkg/pomp/DESCRIPTION
===================================================================
--- pkg/pomp/DESCRIPTION	2015-06-18 17:55:06 UTC (rev 1222)
+++ pkg/pomp/DESCRIPTION	2015-06-18 17:55:13 UTC (rev 1223)
@@ -1,7 +1,7 @@
 Package: pomp
 Type: Package
 Title: Statistical Inference for Partially Observed Markov Processes
-Version: 0.68-2
+Version: 0.68-3
 Date: 2015-06-18
 Authors at R: c(person(given=c("Aaron","A."),family="King",
 		role=c("aut","cre"),email="kingaa at umich.edu"),

Modified: pkg/pomp/R/mif2.R
===================================================================
--- pkg/pomp/R/mif2.R	2015-06-18 17:55:06 UTC (rev 1222)
+++ pkg/pomp/R/mif2.R	2015-06-18 17:55:13 UTC (rev 1223)
@@ -35,7 +35,7 @@
          contains='pfilterd.pomp',
          slots=c(
            Nmif = 'integer',
-           rw.sd = 'list',
+           rw.sd = 'matrix',
            cooling.type = 'character',
            cooling.fraction.50 = 'numeric',
            transform = 'logical',
@@ -206,8 +206,6 @@
                                      ntimes=length(time(object))
                                      )
 
-  rw.sd.mat <- pkern.sd(rw.sd,time=time(object),paramnames=names(start))
-
   conv.rec <- array(data=NA,dim=c(Nmif+1,length(start)+2),
                     dimnames=list(seq.int(.ndone,.ndone+Nmif),
                       c('loglik','nfail',names(start))))
@@ -238,7 +236,7 @@
                             Np=Np,
                             mifiter=.ndone+n,
                             cooling.fn=cooling.fn,
-                            rw.sd=rw.sd.mat,
+                            rw.sd=rw.sd,
                             tol=tol,
                             max.fail=max.fail,
                             verbose=verbose,
@@ -330,6 +328,12 @@
             if (any(Np <= 0))
               stop("number of particles, ",sQuote("Np"),", must always be positive")
 
+            if (missing(rw.sd))
+              stop(sQuote("mif2")," error: ",sQuote("rw.sd")," must be specified!",call.=FALSE)
+            if (!is.matrix(rw.sd)) {
+              rw.sd <- pkern.sd(rw.sd,time=time(object),paramnames=names(start))
+            }
+
             cooling.type <- match.arg(cooling.type)
 
             cooling.fraction.50 <- as.numeric(cooling.fraction.50)



More information about the pomp-commits mailing list