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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun May 18 18:10:46 CEST 2014


Author: kingaa
Date: 2014-05-18 18:10:45 +0200 (Sun, 18 May 2014)
New Revision: 959

Modified:
   pkg/pomp/DESCRIPTION
   pkg/pomp/R/pmcmc-methods.R
   pkg/pomp/inst/NEWS
   pkg/pomp/inst/NEWS.Rd
Log:
- fix bug in 'compare.pmcmc'

Modified: pkg/pomp/DESCRIPTION
===================================================================
--- pkg/pomp/DESCRIPTION	2014-05-18 14:51:39 UTC (rev 958)
+++ pkg/pomp/DESCRIPTION	2014-05-18 16:10:45 UTC (rev 959)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical inference for partially observed Markov processes
-Version: 0.50-8
-Date: 2014-05-17
+Version: 0.50-9
+Date: 2014-05-18
 Authors at R: c(person(given=c("Aaron","A."),family="King",
 		role=c("aut","cre"),email="kingaa at umich.edu"),
 	  person(given=c("Edward","L."),family="Ionides",role=c("aut")),

Modified: pkg/pomp/R/pmcmc-methods.R
===================================================================
--- pkg/pomp/R/pmcmc-methods.R	2014-05-18 14:51:39 UTC (rev 958)
+++ pkg/pomp/R/pmcmc-methods.R	2014-05-18 16:10:45 UTC (rev 959)
@@ -36,65 +36,13 @@
   ## assumes that x is a list of pmcmcs with identical structure
   if (!is.list(z)) z <- list(z)
   if (!all(sapply(z,function(x)is(x,'pmcmc'))))
-    stop("compare.pmcmc error: ",sQuote("z")," must be a pmcmc object or a list of pmcmc objects",call.=FALSE)
+    stop("compare.pmcmc error: ",sQuote("z"),
+         " must be a pmcmc object or a list of pmcmc objects",call.=FALSE)
   mar.multi <- c(0,5.1,0,2.1)
   oma.multi <- c(6,0,5,0)
   xx <- z[[1]]
   estnames <- xx at pars
-  parnames <- names(coef(xx))
-  unestnames <- parnames[-match(estnames,parnames)]
 
-  ## plot filter means
-  filt.diag <- rbind("eff. sample size"=xx at eff.sample.size,filter.mean(xx))
-  filtnames <- rownames(filt.diag)
-#  plotnames <- if(length(unestnames)>0) filtnames[-match(unestnames,filtnames)] else filtnames
-  plotnames <- filtnames
-  lognames <- filtnames[1] # eff. sample size
-  nplots <- length(plotnames)
-  n.per.page <- min(nplots,10)
-  if(n.per.page<=4) nc <- 1 else nc <- 2
-  nr <- ceiling(n.per.page/nc)
-  oldpar <- par(mar=mar.multi,oma=oma.multi,mfcol=c(nr,nc),ask=dev.interactive(orNone=TRUE))
-  on.exit(par(oldpar)) 
-  low <- 1
-  hi <- 0
-  time <- time(xx)
-  while (hi<nplots) {
-    hi <- min(low+n.per.page-1,nplots)
-    for (i in seq(from=low,to=hi,by=1)) {
-      n <- i-low+1
-      logplot <- if (plotnames[i]%in%lognames) "y" else ""
-      dat <- sapply(
-                    z,
-                    function(po, label) {
-                      if (label=="eff. sample size") 
-                        po at eff.sample.size
-                      else
-                        filter.mean(po,label)
-                    },
-                    label=plotnames[i]
-                    )
-      matplot(
-              y=dat, 
-              x=time,
-              axes = FALSE,
-              xlab = "",
-              log=logplot,
-              ylab = "",
-              type = "l"
-              )
-      box()
-      y.side <- 2
-      axis(y.side, xpd = NA)
-      mtext(plotnames[i], y.side, line = 3)
-      do.xax <- (n%%nr==0||n==n.per.page)
-      if (do.xax) axis(1,xpd=NA)
-      if (do.xax) mtext("time",side=1,line=3)
-    }  
-    low <- hi+1
-    mtext("Filter diagnostics (last iteration)",3,line=2,outer=TRUE)
-  } 
-
   ## plot pmcmc convergence diagnostics
   other.diagnostics <- c("loglik", "log.prior","nfail")
   plotnames <- c(other.diagnostics,estnames)
@@ -102,8 +50,8 @@
   n.per.page <- min(nplots,10)
   nc <- if (n.per.page<=4) 1 else 2
   nr <- ceiling(n.per.page/nc)
-  par(mar=mar.multi,oma=oma.multi,mfcol=c(nr,nc))
-  ## on.exit(par(oldpar)) 
+  oldpar <- par(mar=mar.multi,oma=oma.multi,mfcol=c(nr,nc))
+  on.exit(par(oldpar)) 
   low <- 1
   hi <- 0
   iteration <- seq(0,xx at Nmcmc)

Modified: pkg/pomp/inst/NEWS
===================================================================
--- pkg/pomp/inst/NEWS	2014-05-18 14:51:39 UTC (rev 958)
+++ pkg/pomp/inst/NEWS	2014-05-18 16:10:45 UTC (rev 959)
@@ -1,5 +1,9 @@
 _N_e_w_s _f_o_r _p_a_c_k_a_g_e '_p_o_m_p'
 
+_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._5_0-_9:
+
+        • Fix bug in ‘compare.pmcmc’.
+
 _C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._5_0-_8:
 
         • Introduced new ‘compare.pmcmc’ and ‘compare.abc’ functions,

Modified: pkg/pomp/inst/NEWS.Rd
===================================================================
--- pkg/pomp/inst/NEWS.Rd	2014-05-18 14:51:39 UTC (rev 958)
+++ pkg/pomp/inst/NEWS.Rd	2014-05-18 16:10:45 UTC (rev 959)
@@ -1,5 +1,10 @@
 \name{NEWS}
 \title{News for package `pomp'}
+\section{Changes in \pkg{pomp} version 0.50-9}{
+  \itemize{
+    \item Fix bug in \code{compare.pmcmc}.
+  }
+}
 \section{Changes in \pkg{pomp} version 0.50-8}{
   \itemize{
     \item Introduced new \code{compare.pmcmc} and \code{compare.abc} functions, comparable to \code{compare.mif}.



More information about the pomp-commits mailing list