[Pomp-commits] r1013 - pkg/pomp pkg/pomp/R pkg/pomp/man www/vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Dec 4 15:55:36 CET 2014


Author: kingaa
Date: 2014-12-04 15:55:35 +0100 (Thu, 04 Dec 2014)
New Revision: 1013

Modified:
   pkg/pomp/DESCRIPTION
   pkg/pomp/NAMESPACE
   pkg/pomp/R/generics.R
   pkg/pomp/R/probe.R
   pkg/pomp/man/probed-pomp-methods.Rd
   www/vignettes/bsmc-ricker-flat-prior.rda
   www/vignettes/bsmc-ricker-normal-prior.rda
   www/vignettes/gompertz-multi-mif.rda
   www/vignettes/gompertz-performance.rda
   www/vignettes/gompertz-pfilter-guess.rda
   www/vignettes/gompertz-trajmatch.rda
   www/vignettes/intro_to_pomp.R
   www/vignettes/intro_to_pomp.Rnw
   www/vignettes/intro_to_pomp.pdf
   www/vignettes/nlf-block-boot.rda
   www/vignettes/nlf-boot.rda
   www/vignettes/nlf-fit-from-truth.rda
   www/vignettes/nlf-fits.rda
   www/vignettes/nlf-lag-tests.rda
   www/vignettes/nlf-multi-short.rda
   www/vignettes/ricker-comparison.rda
   www/vignettes/ricker-first-probe.rda
   www/vignettes/ricker-mif.rda
   www/vignettes/ricker-probe-match.rda
   www/vignettes/ricker-probe.rda
Log:
- add 'values' method for 'probed.pomp' objects
- fix DESCRIPTION file

Modified: pkg/pomp/DESCRIPTION
===================================================================
--- pkg/pomp/DESCRIPTION	2014-12-04 14:54:07 UTC (rev 1012)
+++ pkg/pomp/DESCRIPTION	2014-12-04 14:55:35 UTC (rev 1013)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
-Title: Statistical inference for partially observed Markov processes
-Version: 0.54-1
-Date: 2014-09-23
+Title: Statistical Inference for Partially Observed Markov Processes
+Version: 0.55-1
+Date: 2014-12-03
 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")),
@@ -17,7 +17,7 @@
 	  person(given=c("Simon","N."),family="Wood",role=c("ctb"))
 	  )
 URL: http://pomp.r-forge.r-project.org
-Description: Inference methods for partially-observed Markov processes
+Description: Inference methods for partially observed Markov processes (AKA stochastic dynamical systems, state-space models)
 Depends: R(>= 3.0.0), methods, subplex, nloptr
 Imports: stats, graphics, mvtnorm, deSolve, coda
 License: GPL(>= 2)

Modified: pkg/pomp/NAMESPACE
===================================================================
--- pkg/pomp/NAMESPACE	2014-12-04 14:54:07 UTC (rev 1012)
+++ pkg/pomp/NAMESPACE	2014-12-04 14:55:35 UTC (rev 1013)
@@ -64,6 +64,7 @@
               eff.sample.size,cond.logLik,
               particles,mif,continue,states,trajectory,
               pred.mean,pred.var,filter.mean,conv.rec,
+              values,
               bsmc2,bsmc,pmcmc,abc,nlf,
               traj.match.objfun,
               probe.match.objfun,

Modified: pkg/pomp/R/generics.R
===================================================================
--- pkg/pomp/R/generics.R	2014-12-04 14:54:07 UTC (rev 1012)
+++ pkg/pomp/R/generics.R	2014-12-04 14:55:35 UTC (rev 1013)
@@ -45,6 +45,8 @@
 setGeneric("eff.sample.size",function(object,...)standardGeneric("eff.sample.size"))
 ## convergence record
 setGeneric("conv.rec",function(object,...)standardGeneric("conv.rec"))
+## values of probes
+setGeneric("values",function(object,...)standardGeneric("values"))
 ## stochastic simulation
 setGeneric("simulate",function(object,nsim=1,seed=NULL,...)standardGeneric("simulate"))
 

Modified: pkg/pomp/R/probe.R
===================================================================
--- pkg/pomp/R/probe.R	2014-12-04 14:54:07 UTC (rev 1012)
+++ pkg/pomp/R/probe.R	2014-12-04 14:55:35 UTC (rev 1013)
@@ -208,3 +208,13 @@
 
 setMethod("logLik",signature(object="probed.pomp"),function(object,...)object at synth.loglik)
 setMethod("$",signature=signature(x="probed.pomp"),function(x, name)slot(x,name))
+
+values.probe.internal <- function (object, ...) {
+  x <- as.data.frame(rbind(object at datvals,object at simvals))
+  row.names(x) <- seq.int(from=0,to=nrow(x)-1)
+  x$.id <- factor(c("data",rep("sim",nrow(x)-1)))
+  x
+}
+
+setMethod("values",signature(object="probed.pomp"),
+          definition=values.probe.internal)

Modified: pkg/pomp/man/probed-pomp-methods.Rd
===================================================================
--- pkg/pomp/man/probed-pomp-methods.Rd	2014-12-04 14:54:07 UTC (rev 1012)
+++ pkg/pomp/man/probed-pomp-methods.Rd	2014-12-04 14:55:35 UTC (rev 1013)
@@ -8,6 +8,11 @@
 \alias{summary,probe.matched.pomp-method}
 \alias{summary-probed.pomp}
 \alias{summary-probe.matched.pomp}
+\alias{values}
+\alias{values,probed.pomp-method}
+\alias{values,probe.matched.pomp-method}
+\alias{values-probed.pomp}
+\alias{values-probe.matched.pomp}
 \alias{plot,probed.pomp-method}
 \alias{plot,probe.matched.pomp-method}
 \alias{plot-probed.pomp}
@@ -37,6 +42,7 @@
 \S4method{plot}{probe.matched.pomp}(x, y, \dots)
 \S4method{summary}{spect.pomp}(object, \dots)
 \S4method{logLik}{probed.pomp}(object, \dots)
+\S4method{values}{probed.pomp}(object, \dots)
 \S4method{plot}{spect.pomp}(x, y, max.plots.per.page = 4,
           plot.data = TRUE,
           quantiles = c(.025, .25, .5, .75, .975),
@@ -70,6 +76,10 @@
     \item{summary}{
       displays summary information.
     }
+    \item{values}{
+      extracts the realized values of the probes on the data and on the simulations as a data frame in long format.
+      The variable \code{.id} indicates whether the probes are from the data or simulations.
+    }
     \item{logLik}{
       returns the synthetic likelihood for the probes.
       NB: in general, this is not the same as the likelihood.

Modified: www/vignettes/bsmc-ricker-flat-prior.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/bsmc-ricker-normal-prior.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/gompertz-multi-mif.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/gompertz-performance.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/gompertz-pfilter-guess.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/gompertz-trajmatch.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/intro_to_pomp.R
===================================================================
--- www/vignettes/intro_to_pomp.R	2014-12-04 14:54:07 UTC (rev 1012)
+++ www/vignettes/intro_to_pomp.R	2014-12-04 14:55:35 UTC (rev 1013)
@@ -271,7 +271,6 @@
 
 
 ## ----gompertz-perform,eval=F,echo=T--------------------------------------
-## 
 ## tic <- Sys.time()
 ## sim1 <- simulate(gompertz,nsim=1000,seed=5676868L,obs=TRUE)
 ## toc <- Sys.time()
@@ -295,7 +294,6 @@
 ## g2pf <- toc-tic
 ## 
 ## stopifnot(all.equal(logLik(pf1),logLik(pf2)))
-## 
 
 ## ----gompertz-perform-eval,eval=T,echo=F---------------------------------
 binary.file <- "gompertz-performance.rda"
@@ -303,7 +301,6 @@
   load(binary.file)
 } else {
 set.seed(457645443L)
-
 tic <- Sys.time()
 sim1 <- simulate(gompertz,nsim=1000,seed=5676868L,obs=TRUE)
 toc <- Sys.time()
@@ -327,7 +324,6 @@
 g2pf <- toc-tic
 
 stopifnot(all.equal(logLik(pf1),logLik(pf2)))
-
 save(g1sim,g2sim,g1pf,g2pf,file=binary.file,compress='xz')
 }  
 
@@ -1256,9 +1252,9 @@
 
 
 ## ----bsmc-example-flat-prior-3,eval=F------------------------------------
-##   fit1 <- bsmc(ricker,Np=10000,transform=TRUE,
-##                est=c("r","sigma"),smooth=0.2,
-##                seed=1050180387L)
+##   fit1 <- bsmc2(ricker,Np=10000,transform=TRUE,
+##                 est=c("r","sigma"),smooth=0.2,
+##                 seed=1050180387L)
 
 ## ----bsmc-example-flat-prior-eval,eval=T,echo=F--------------------------
 binary.file <- "bsmc-ricker-flat-prior.rda"
@@ -1275,9 +1271,9 @@
                  params
                }
                )
-  fit1 <- bsmc(ricker,Np=10000,transform=TRUE,
-               est=c("r","sigma"),smooth=0.2,
-               seed=1050180387L)
+  fit1 <- bsmc2(ricker,Np=10000,transform=TRUE,
+                est=c("r","sigma"),smooth=0.2,
+                seed=1050180387L)
   save(fit1,file=binary.file,compress="xz")
 }
 
@@ -1299,9 +1295,9 @@
 ##                }
 ##                )
 ## 
-## fit2 <- bsmc(ricker,transform=TRUE,Np=10000,
-##              est=c("r","sigma"),smooth=0.2,
-##              seed=90348704L)
+## fit2 <- bsmc2(ricker,transform=TRUE,Np=10000,
+##               est=c("r","sigma"),smooth=0.2,
+##               seed=90348704L)
 ## 
 
 ## ----bsmc-example-normal-prior-eval,eval=T,echo=F------------------------
@@ -1317,9 +1313,9 @@
                }
                )
 
-fit2 <- bsmc(ricker,transform=TRUE,Np=10000,
-             est=c("r","sigma"),smooth=0.2,
-             seed=90348704L)
+fit2 <- bsmc2(ricker,transform=TRUE,Np=10000,
+              est=c("r","sigma"),smooth=0.2,
+              seed=90348704L)
 
   save(fit2,file=binary.file,compress="xz")
 }

Modified: www/vignettes/intro_to_pomp.Rnw
===================================================================
--- www/vignettes/intro_to_pomp.Rnw	2014-12-04 14:54:07 UTC (rev 1012)
+++ www/vignettes/intro_to_pomp.Rnw	2014-12-04 14:55:35 UTC (rev 1013)
@@ -563,7 +563,6 @@
 
 Let's compare the performance of \code{gompertz} and \code{gomp2}.
 <<gompertz-perform,eval=F,echo=T>>=
-
 tic <- Sys.time()
 sim1 <- simulate(gompertz,nsim=1000,seed=5676868L,obs=TRUE)
 toc <- Sys.time()
@@ -587,7 +586,6 @@
 g2pf <- toc-tic
 
 stopifnot(all.equal(logLik(pf1),logLik(pf2)))
-
 @ 
 <<gompertz-perform-eval,eval=T,echo=F>>=
 binary.file <- "gompertz-performance.rda"
@@ -1519,9 +1517,9 @@
 %%\citet{Ellner1998,Kendall1999}
 
 \clearpage
-\section{Bayesian sequential Monte Carlo: \code{bsmc}}
+\section{Bayesian sequential Monte Carlo: \code{bsmc2}}
 
-The approximate Bayesian sequential Monte Carlo method of \citet{Liu2001b} is implemented in \pkg{pomp}.
+A modified version of the approximate Bayesian sequential Monte Carlo method of \citet{Liu2001b} is implemented in \pkg{pomp}.
 The following demonstrates its use on the Ricker model.
 
 First, we'll specify a prior distribution.
@@ -1544,9 +1542,9 @@
 The following runs the Bayesian sequential Monte Carlo algorithm with 10,000 particles.
 Note that, by specifying \code{transform=TRUE}, we cause the estimation to proceed on the transformed scale.
 <<bsmc-example-flat-prior-3,eval=F>>=
-  fit1 <- bsmc(ricker,Np=10000,transform=TRUE,
-               est=c("r","sigma"),smooth=0.2,
-               seed=1050180387L)
+  fit1 <- bsmc2(ricker,Np=10000,transform=TRUE,
+                est=c("r","sigma"),smooth=0.2,
+                seed=1050180387L)
 @ 
 <<bsmc-example-flat-prior-eval,eval=T,echo=F>>=
 binary.file <- "bsmc-ricker-flat-prior.rda"
@@ -1570,7 +1568,7 @@
 plot(fit1,pars=c("r","sigma"),thin=5000)
 @ 
 \caption{
-  Results of \code{bsmc} on the Ricker model.
+  Results of \code{bsmc2} on the Ricker model.
   The off-diagonal panels show 5000 samples from the prior (grey) and posterior (blue) distributions.
   The diagonal panels show kernel density estimates of the marginal prior and posterior distributions for each of the parameters.
   Note that these are shown on the natural scale.
@@ -1589,9 +1587,9 @@
                }
                )
 
-fit2 <- bsmc(ricker,transform=TRUE,Np=10000,
-             est=c("r","sigma"),smooth=0.2,
-             seed=90348704L)
+fit2 <- bsmc2(ricker,transform=TRUE,Np=10000,
+              est=c("r","sigma"),smooth=0.2,
+              seed=90348704L)
 
 <<bsmc-example-normal-prior-eval,eval=T,echo=F>>=
 binary.file <- "bsmc-ricker-normal-prior.rda"

Modified: www/vignettes/intro_to_pomp.pdf
===================================================================
(Binary files differ)

Modified: www/vignettes/nlf-block-boot.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/nlf-boot.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/nlf-fit-from-truth.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/nlf-fits.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/nlf-lag-tests.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/nlf-multi-short.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/ricker-comparison.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/ricker-first-probe.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/ricker-mif.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/ricker-probe-match.rda
===================================================================
(Binary files differ)

Modified: www/vignettes/ricker-probe.rda
===================================================================
(Binary files differ)



More information about the pomp-commits mailing list