[Pomp-commits] r11 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jul 25 11:05:50 CEST 2008


Author: kingaa
Date: 2008-07-25 11:05:50 +0200 (Fri, 25 Jul 2008)
New Revision: 11

Modified:
   pkg/R/mif.R
Log:
trap as error parameters (including ivps) which are to be estimated but which have zero rw.sd

Modified: pkg/R/mif.R
===================================================================
--- pkg/R/mif.R	2008-07-22 14:32:47 UTC (rev 10)
+++ pkg/R/mif.R	2008-07-25 09:05:50 UTC (rev 11)
@@ -75,6 +75,18 @@
             rw.names <- names(rw.sd)
             if (any(!(rw.names%in%start.names)))
               stop("mif error: all the names of 'rw.sd' must be names of 'start'",call.=FALSE)
+            if (any(rw.sd[c(pars,ivps)]==0)) {
+              zero.pars <- names(which(rw.sd[c(pars,ivps)]==0))
+              stop(
+                   "mif error: for every parameter you wish to estimate, you must specify a positive ",
+                   sQuote("rw.sd"),
+                   ".  ",
+                   sQuote("rw.sd"),
+                   " is zero for ",
+                   paste(zero.pars,collapse=", "),
+                   call.=FALSE
+                   )
+            }
             if (!all(c('Np','cooling.factor','ic.lag','var.factor')%in%names(alg.pars)))
               stop(
                    "mif error: 'alg.pars' must be a named list with elements 'Np','cooling.factor','ic.lag',and 'var.factor'",



More information about the pomp-commits mailing list