[Pomp-commits] r51 - in pkg: R man tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Aug 25 23:23:02 CEST 2008


Author: kingaa
Date: 2008-08-25 23:23:02 +0200 (Mon, 25 Aug 2008)
New Revision: 51

Modified:
   pkg/R/mif.R
   pkg/man/mif.Rd
   pkg/tests/ou2-mif.Rout.save
Log:
error trap in 'mif': 'rw.sd' must have names

Modified: pkg/R/mif.R
===================================================================
--- pkg/R/mif.R	2008-08-25 17:14:21 UTC (rev 50)
+++ pkg/R/mif.R	2008-08-25 21:23:02 UTC (rev 51)
@@ -77,6 +77,8 @@
                    )
 
             rw.names <- names(rw.sd)
+            if (is.null(rw.names))
+              stop("mif error: ",sQuote("rw.sd")," must be a named vector",call.=FALSE)
             if (any(!(rw.names%in%start.names)))
               stop("mif error: all the names of ",sQuote("rw.sd")," must be names of ",sQuote("start"),call.=FALSE)
             if (any(rw.sd[c(pars,ivps)]<=0)) {

Modified: pkg/man/mif.Rd
===================================================================
--- pkg/man/mif.Rd	2008-08-25 17:14:21 UTC (rev 50)
+++ pkg/man/mif.Rd	2008-08-25 21:23:02 UTC (rev 51)
@@ -44,7 +44,7 @@
     If \code{particles} is not supplied by the user, the default behavior is to draw the particles from a multivariate normal distribution with mean \code{center} and standard deviation \code{sd}.
   }
   \item{rw.sd}{
-    numeric vector; the intensity of the random walk to be applied to parameters.
+    numeric vector with names; the intensity of the random walk to be applied to parameters.
     The random walk is only applied to parameters named in \code{pars}.
     The algorithm requires that the random walk be nontrivial.
     Thus, each element in \code{rw.sd[pars]} must be positive.

Modified: pkg/tests/ou2-mif.Rout.save
===================================================================
--- pkg/tests/ou2-mif.Rout.save	2008-08-25 17:14:21 UTC (rev 50)
+++ pkg/tests/ou2-mif.Rout.save	2008-08-25 21:23:02 UTC (rev 51)
@@ -68,11 +68,11 @@
 > mif.fit <- continue(mif.fit,Nmif=70,max.fail=100)
 > toc <- Sys.time()
 > print(toc-tic)
-Time difference of 1.396902 mins
+Time difference of 1.694885 mins
 > cat("PF estimated log likelihood at MIF MLE\n")
 PF estimated log likelihood at MIF MLE
 > print(pfilter(mif.fit)$loglik,digits=4)
-[1] -421.7
+[1] -422.6
 > 
 > cat("coefficients at truth\n")
 coefficients at truth
@@ -83,7 +83,7 @@
 MIF MLE
 > print(coef(mif.fit,c('x1.0','x2.0','alpha.1','alpha.4')),digits=4)
     x1.0     x2.0  alpha.1  alpha.4 
- 51.2028 -50.0965   0.9032   0.9738 
+ 51.1941 -51.2739   0.8990   0.9736 
 > 
 > plot(mif.fit)
 > compare.mif(mif.fit)



More information about the pomp-commits mailing list