[Pomp-commits] r633 - in pkg: . inst inst/doc

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 27 22:57:54 CEST 2012


Author: kingaa
Date: 2012-03-27 22:57:54 +0200 (Tue, 27 Mar 2012)
New Revision: 633

Added:
   pkg/inst/doc/bsmc-ricker-flat-prior.rda
Modified:
   pkg/DESCRIPTION
   pkg/inst/ChangeLog
   pkg/inst/NEWS
   pkg/inst/doc/intro_to_pomp.Rnw
   pkg/inst/doc/intro_to_pomp.pdf
Log:
- improve 'bsmc' section in the 'intro' vignette
- update NEWS file


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2012-03-27 15:17:19 UTC (rev 632)
+++ pkg/DESCRIPTION	2012-03-27 20:57:54 UTC (rev 633)
@@ -2,7 +2,7 @@
 Type: Package
 Title: Statistical inference for partially observed Markov processes
 Version: 0.41-1
-Date: 2012-03-27
+Date: 2012-03-28
 Revision: $Rev$
 Author: Aaron A. King, Edward L. Ionides, Carles Breto, Steve Ellner, Bruce Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman
 Maintainer: Aaron A. King <kingaa at umich.edu>

Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2012-03-27 15:17:19 UTC (rev 632)
+++ pkg/inst/ChangeLog	2012-03-27 20:57:54 UTC (rev 633)
@@ -1,5 +1,217 @@
+2012-03-27  kingaa
+
+	* [r632] R/bsmc.R, inst/TODO, man/bsmc.Rd: - fix bug in plot method
+	  for 'bmscd.pomp'
+	  - parameter posterior means are now stored in the 'params' slot
+	  of 'bsmcd.pomp' objects
+	* [r631] inst/doc/intro_to_pomp.Rnw, inst/doc/intro_to_pomp.pdf,
+	  inst/doc/manual.pdf: - compress the manual and fix some typos in
+	  the intro vignette
+	* [r630] tests/ricker-bsmc.R, tests/ricker-bsmc.Rout.save: - units
+	  tests for new 'bsmc' facilities
+	* [r629] DESCRIPTION, R/bsmc.R, R/mif-class.R, R/mif-methods.R,
+	  R/mif.R, R/nlf-objfun.R, R/nlf.R, R/pfilter.R, R/pmcmc.R,
+	  R/pomp.R, R/probe-match.R, R/traj-match.R, data/blowflies.rda,
+	  data/dacca.rda, data/euler.sir.rda, data/gillespie.sir.rda,
+	  data/gompertz.rda, data/ou2.rda, data/ricker.rda, data/rw2.rda,
+	  data/verhulst.rda, inst/TODO, inst/data-R/dacca.R,
+	  inst/data-R/gompertz.R, inst/data-R/ricker.R, inst/data-R/sir.R,
+	  inst/doc/advanced_topics_in_pomp.Rnw,
+	  inst/doc/advanced_topics_in_pomp.pdf,
+	  inst/doc/gompertz-multi-mif.rda, inst/doc/gompertz-trajmatch.rda,
+	  inst/doc/intro_to_pomp.Rnw, inst/doc/intro_to_pomp.pdf,
+	  inst/doc/manual.pdf, inst/doc/nlf-block-boot.rda,
+	  inst/doc/nlf-boot.rda, inst/doc/nlf-fit-from-truth.rda,
+	  inst/doc/nlf-fits.rda, inst/doc/nlf-lag-tests.rda,
+	  inst/doc/nlf-multi-short.rda, inst/doc/ricker-mif.rda,
+	  inst/doc/ricker-probe-match.rda, man/bsmc.Rd, man/dacca.Rd,
+	  man/mif-class.Rd, man/mif.Rd, man/nlf.Rd, man/pmcmc.Rd,
+	  man/probe.Rd, man/sir.Rd, man/traj-match.Rd, src/cholmodel.c,
+	  src/gompertz.c, src/ricker.c, src/sir.c, tests/dacca.R,
+	  tests/dacca.Rout.save, tests/dimchecks.R,
+	  tests/dimchecks.Rout.save, tests/gillespie.R,
+	  tests/gillespie.Rout.save, tests/gompertz.R,
+	  tests/gompertz.Rout.save, tests/ou2-mif.R,
+	  tests/ou2-mif.Rout.save, tests/ou2-pmcmc.R,
+	  tests/ou2-trajmatch.Rout.save, tests/partrans.R,
+	  tests/partrans.Rout.save, tests/pfilter.R,
+	  tests/pfilter.Rout.save, tests/pomppomp.R,
+	  tests/pomppomp.Rout.save, tests/ricker-probe.R,
+	  tests/ricker-probe.Rout.save, tests/ricker-spect.R,
+	  tests/ricker-spect.Rout.save, tests/ricker.R,
+	  tests/ricker.Rout.save, tests/skeleton.R,
+	  tests/skeleton.Rout.save, tests/steps.R, tests/steps.Rout.save: -
+	  put parameter transformation options into 'mif', 'bsmc', 'pmcmc',
+	  'probe-match', 'traj-match', and 'nlf'
+	  - reverse direction of parameter transformations in
+	  data()-loadable examples
+	  - update documentation
+	  - make 'bsmc' into an S4 method
+	  - plot method for 'bsmcd.pomp' objects
+
+2012-03-21  kingaa
+
+	* [r628] DESCRIPTION, R/simulate-pomp.R: - bug fix in simulate code
+	  (with as.data.frame argument)
+
+2012-03-15  kingaa
+
+	* [r627] DESCRIPTION, R/simulate-pomp.R, R/trajectory-pomp.R,
+	  data/blowflies.rda, data/dacca.rda, data/euler.sir.rda,
+	  data/gillespie.sir.rda, data/gompertz.rda, data/ou2.rda,
+	  data/ricker.rda, data/rw2.rda, data/verhulst.rda, inst/NEWS,
+	  inst/TODO, inst/data-R/euler.sir.R, inst/data-R/gillespie.sir.R,
+	  inst/data-R/sir.R, man/simulate-pomp.Rd, man/sir.Rd,
+	  man/trajectory-pomp.Rd, tests/dacca.R, tests/dacca.Rout.save,
+	  tests/ricker.R, tests/ricker.Rout.save: - add new 'as.data.frame'
+	  argument to 'simulate' and 'trajectory'
+	  - consolidate both SIR models in one inst/data-R file
+
+2012-03-09  kingaa
+
+	* [r626] DESCRIPTION, R/pomp-methods.R, inst/TODO, src/partrans.c,
+	  src/simulate.c, tests/ou2-procmeas.Rout.save: - minor bugfixes
+	* [r625] DESCRIPTION, NAMESPACE, R/init-state-pomp.R, R/pomp-fun.R,
+	  R/pomp-methods.R, R/pomp.R, data/blowflies.rda, data/dacca.rda,
+	  data/euler.sir.rda, data/gillespie.sir.rda, data/gompertz.rda,
+	  data/ou2.rda, data/ricker.rda, data/rw2.rda, data/verhulst.rda,
+	  inst/NEWS, inst/doc/advanced_topics_in_pomp.Rnw,
+	  inst/doc/advanced_topics_in_pomp.pdf,
+	  inst/doc/gompertz-multi-mif.rda, inst/doc/gompertz-trajmatch.rda,
+	  inst/doc/intro_to_pomp.pdf, inst/doc/nlf-block-boot.rda,
+	  inst/doc/nlf-boot.rda, inst/doc/nlf-fit-from-truth.rda,
+	  inst/doc/nlf-fits.rda, inst/doc/nlf-lag-tests.rda,
+	  inst/doc/nlf-multi-short.rda, inst/doc/ricker-mif.rda,
+	  inst/doc/ricker-probe-match.rda, inst/include/pomp.h,
+	  man/pomp-class.Rd, src/dmeasure.c, src/dprocess.c,
+	  src/initstate.c, src/partrans.c, src/pomp.h, src/pomp_internal.h,
+	  src/rmeasure.c, src/rprocess.c, src/skeleton.c,
+	  tests/dimchecks.R, tests/dimchecks.Rout.save, tests/logistic.R,
+	  tests/logistic.Rout.save, tests/ou2-procmeas.R,
+	  tests/ou2-procmeas.Rout.save, tests/rw2.Rout.save,
+	  tests/sir.Rout.save: - parameter transformations are handled
+	  through 'partrans'
+	  - all the horsemen now recycle parameters or states as
+	  appropriate
+	* [r624] man/pomp-methods.Rd: - update documentation
+	* [r623] R/mif-methods.R: - use new 'partrans' method
+
+2012-03-08  kingaa
+
+	* [r622] src/euler.c: - fix incorrect comment
+
+2012-03-07  kingaa
+
+	* [r621] R/pomp-fun.R: - minor tweak
+	* [r620] DESCRIPTION, inst/NEWS, man/blowflies.Rd, man/pfilter.Rd:
+	  - update documentation of 'blowflies'
+	  - correct error in 'pfilter' documentation
+
+2012-03-06  kingaa
+
+	* [r619] DESCRIPTION, R/parmat.R, inst/NEWS, man/parmat.Rd: -
+	  extend functionality of 'parmat' slightly
+
+2012-02-15  kingaa
+
+	* [r618] R/probe-match.R, inst/NEWS: - same error as before, fixed
+	  now in 'probe.match'
+	* [r617] R/probe.R, inst/NEWS: - catch error in 'probe' when nsim <
+	  nprobes
+	* [r616] DESCRIPTION, data/blowflies.rda, data/dacca.rda,
+	  data/euler.sir.rda, data/gillespie.sir.rda, data/gompertz.rda,
+	  data/ou2.rda, data/ricker.rda, data/rw2.rda, data/verhulst.rda,
+	  inst/NEWS, inst/data-R/gillespie.sir.R: - fix the Gillespie
+	  example
+	* [r615] inst/NEWS: - fix NEWS file
+
+2012-02-14  kingaa
+
+	* [r614] DESCRIPTION: - back off of using svn keywords for the Date
+	  field
+	* [r613] tests/partrans.R, tests/partrans.Rout.save: - add some
+	  units tests
+	* [r612] DESCRIPTION, R/pomp-methods.R, R/pomp.R, inst/NEWS,
+	  inst/doc/advanced_topics_in_pomp.pdf, inst/doc/intro_to_pomp.pdf:
+	  - When a pomp object is updated using 'pomp', the 'params' slot
+	  will now be copied over (appropriately transformed). Before, it
+	  was simply dropped.
+
+2012-02-10  kingaa
+
+	* [r611] DESCRIPTION: - use svn keywords on date & svn revision
+	* [r610] inst/NEWS: - cosmetics
+
+2012-02-09  kingaa
+
+	* [r609] tests/ou2-mif-fp.R, tests/ou2-mif-fp.Rout.save: - some
+	  unit tests for new 'mif' functionality
+	* [r608] .Rinstignore, DESCRIPTION, R/mif.R, inst/NEWS, man/mif.Rd,
+	  src/dprocess.c, src/euler.c, src/rmeasure.c, src/skeleton.c: -
+	  more informative error messages in cases where dimensionality of
+	  state space or data space differ internally
+	  - more flexible choice of update methods in 'mif' via the new
+	  argument 'method' which replaces the old 'weighted' flag
+	  - the 'weighted' flag of 'mif' is now deprecated
+
+2012-02-06  kingaa
+
+	* [r607] inst/doc/intro_to_pomp.Rnw, inst/doc/intro_to_pomp.pdf,
+	  inst/doc/manual.pdf: - minor changes
+
+2012-01-19  kingaa
+
+	* [r606] man/probe.Rd: - cosmetology
+	* [r605] R/version.R: - add a 'version.string' to the return list
+	* [r604] DESCRIPTION, NAMESPACE, R/probe-match.R, R/sannbox.R,
+	  R/traj-match.R, inst/NEWS, inst/doc/manual.pdf, man/probe.Rd,
+	  man/sannbox.Rd, man/traj-match.Rd, tests/ou2-trajmatch.R,
+	  tests/ou2-trajmatch.Rout.save, tests/ricker-probe.Rout.save: -
+	  add new 'traj.match.objfun' and 'probe.match.objfun' functions
+	  - rearrange existing 'traj.match' and 'probe.match' codes to make
+	  use of these
+	  - an improved 'sannbox' algorithm is now exported
+	* [r603] R/bsmc.R: - use SVD method in 'rmvnorm' rather than
+	  'eigen' method
+	* [r602] DESCRIPTION, NAMESPACE, inst/NEWS:
+	* [r601] inst/doc/Makefile, inst/doc/intro_to_pomp.Rnw,
+	  inst/doc/intro_to_pomp.pdf: - use png flag for big files
+	* [r600] tests/ou2-bsmc.R, tests/ou2-bsmc.Rout.save: - change the
+	  seed in an attempt to forestall errors under windows R-devel
+	* [r599] man/ricker.Rd: - cosmetics
+	* [r598] R/eulermultinom.R, inst/include/pomp.h,
+	  man/eulermultinom.Rd, src/eulermultinom.c, src/pomp.h: - add an R
+	  interface to the 'rgammawn' function
+	* [r597] .Rinstignore: - add .Rinstignore file
+
+2012-01-16  kingaa
+
+	* [r596] DESCRIPTION, inst/doc/gompertz-multi-mif.rda,
+	  inst/doc/intro_to_pomp.Rnw, inst/doc/intro_to_pomp.pdf: - fix
+	  SD/SE of pfilter log-likelihoods in 'intro_to_pomp'
+
+2012-01-15  kingaa
+
+	* [r595] DESCRIPTION, inst/NEWS: - update DESCRIPTION & NEWS files
+	* [r594] src/pomp.h: - add two inline helper functions: one for
+	  doing the exponential to geometric rate correction (see He et al.
+	  2010),
+	  the other for computing the increment of an integrated gamma
+	  white-noise process (see Breto et al.)
+
+2012-01-12  kingaa
+
+	* [r593] R/bsmc.R, inst/NEWS, man/bsmc.Rd, tests/ou2-bsmc.R,
+	  tests/ou2-bsmc.Rout.save: - Pierre Jacob's contributions to
+	  'bsmc'
+	* [r592] DESCRIPTION:
+	* [r591] man/mif.Rd, man/slice-design.Rd: - minor documentation
+	  fixes
+
 2012-01-11  kingaa
 
+	* [r590] DESCRIPTION, inst/ChangeLog, inst/NEWS, tests/steps.R,
+	  tests/steps.Rout.save: - version 0.40-2
 	* [r589] src/euler.c: - bug fix: inappropriate choice of number of
 	  steps in some circumstances
 

Modified: pkg/inst/NEWS
===================================================================
--- pkg/inst/NEWS	2012-03-27 15:17:19 UTC (rev 632)
+++ pkg/inst/NEWS	2012-03-27 20:57:54 UTC (rev 633)
@@ -1,4 +1,16 @@
 NEWS
+0.41-1
+     o	New arguments in 'mif', 'nlf', 'bsmc', 'pmcmc', 'probe-match', and 'traj-match' allow the estimation to be done on a transformed parameter space.
+     	When 'transform=TRUE' in these commands ('transform.params=TRUE' for 'nlf'), estimation is performed on the transformed parameter space.
+	This is described and demonstrated in the 'intro_to_pomp' vignette.
+	The data()-loadable examples have been re-implemented to make use of this facility.
+	Note that this new functionality makes it unnecessary to "un-transform" model parameters within the user-specified 'rprocess', 'dprocess', 'rmeasure', 'dmeasure', 'skeleton', and 'initializer' codes.
+
+     o	The Bayesian sequential Monte Carlo command 'bsmc' now returns not a list but an object of class 'bsmcd.pomp'.
+     	A 'plot' method for objects of this class now exists.
+	Also, the parameter posterior means are now stored in the 'params' slot of the 'bsmcd.pomp' object:
+	access them with the 'coef' command as usual.
+
 0.40-9
      o	Setting the new argument 'as.data.frame' to 'TRUE' in 'simulate' and 'trajectory' causes the results to be returned as a data-frame.
 

Added: pkg/inst/doc/bsmc-ricker-flat-prior.rda
===================================================================
(Binary files differ)


Property changes on: pkg/inst/doc/bsmc-ricker-flat-prior.rda
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: pkg/inst/doc/intro_to_pomp.Rnw
===================================================================
--- pkg/inst/doc/intro_to_pomp.Rnw	2012-03-27 15:17:19 UTC (rev 632)
+++ pkg/inst/doc/intro_to_pomp.Rnw	2012-03-27 20:57:54 UTC (rev 633)
@@ -527,7 +527,8 @@
                  },
                  parameter.inv.transform=function(params,...){
                    params <- log(params[c("r","K","tau","sigma","X.0")])
-                   names(params) <- c("log.r","log.K","log.tau","log.sigma","log.X.0")
+                   names(params) <- c("log.r","log.K","log.tau",
+                                      "log.sigma","log.X.0")
                    params
                  }
                  )
@@ -1380,9 +1381,76 @@
 \clearpage
 \section{Bayesian sequential Monte Carlo: \code{bsmc}}
 
-\citet{Liu2001b}.  To be added.
+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 draw a sample from our prior distribution.
+Here, we'll use uniform priors on two model parameters ($\log{r}$ and $\sigma$), leaving the others fixed at their true values.
+<<bsmc-example-flat-prior-1,echo=F,eval=F>>=
+require(pomp)
+data(ricker)
+set.seed(136872209L)
+@ 
+We'll use 10,000 particles, so we'll need that many samples from the prior distribution.
+<<bsmc-example-flat-prior-2,eval=F>>=
+Np <- 10000
+params <- parmat(coef(ricker),nrep=Np)
+params["log.r",] <- runif(n=Np,min=2,max=5)
+params["sigma",] <- runif(n=Np,min=0.1,max=1)
+@ 
+Now \code{params} holds these 10,000 samples.
+The following runs the sequential Monte Carlo algorithm.
+Note that, by specifying \code{transform=TRUE}, we cause the estimation to proceed on the transformed scale.
+<<bsmc-example-flat-prior-3,eval=F>>=
+fit <- bsmc(ricker,params=params,transform=TRUE,
+            est=c("log.r","log.sigma"),smooth=0.2)
+@ 
+<<bsmc-example-flat-prior-eval,eval=T,echo=F>>=
+binary.file <- "bsmc-ricker-flat-prior.rda"
+if (file.exists(binary.file)) {
+  load(binary.file)
+} else {
+<<bsmc-example-flat-prior-1>>
+<<bsmc-example-flat-prior-2>>
+<<bsmc-example-flat-prior-3>>
+  save(fit,file=binary.file,compress="xz")
+}
+@ 
+Fig.~\ref{fig:bsmc-example-flat-prior} shows the results of this computation.
+Obtain the posterior means of the parameters by doing
+<<bsmc-example-flat-prior-coef>>=
+signif(coef(fit),digits=2)
+@ 
+Note that these are reported on the natural (i.e., untransformed) scale.
 
+\begin{figure}
+<<bsmc-example-flat-prior-plot,fig=T,pdf=F,png=T,height=6,width=6,echo=F>>=
+  plot(fit,thin=5000)
+@ 
+\caption{
+  Results of \code{bsmc} on the Ricker model.
+  The off-diagonal panels show 5000 samples from the prior (grey) and posterior (blue) distributions.
+  The diagonal panels show histograms of the marginal posterior distributions for each of the parameters.
+  Note that these are shown on the transformed scale.
+  This plot was produced by executing \code{plot(fit,thin=5000)}.
+  \label{fig:bsmc-example-flat-prior}
+}
+\end{figure}
+
+To repeat the procedure with log-normal priors on $r$ and $\sigma$, one might do the following.
+<<bsmc-example-normal-prior>>=
+## normal prior on log.r
+params["log.r",] <- rnorm(n=Np,mean=coef(ricker,"log.r"),sd=3)
+## log-normal prior on sigma
+params["sigma",] <- rlnorm(n=Np,meanlog=log(coef(ricker,"sigma")),
+                           sdlog=5)
+fit <- bsmc(ricker,params=params,transform=TRUE,
+            est=c("log.r","log.sigma"),smooth=0.2)
+signif(coef(fit),digits=2)
+@ 
+
+
+\clearpage
 \section{Particle Markov chain Monte Carlo: \code{pmcmc}}
 
 \citet{Andrieu2010}.  To be added.

Modified: pkg/inst/doc/intro_to_pomp.pdf
===================================================================
(Binary files differ)



More information about the pomp-commits mailing list