[Pomp-commits] r801 - in pkg/pomp: . data inst inst/examples man tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jan 9 21:17:00 CET 2013


Author: kingaa
Date: 2013-01-09 21:16:59 +0100 (Wed, 09 Jan 2013)
New Revision: 801

Added:
   pkg/pomp/inst/examples/bbs.R
   pkg/pomp/inst/examples/euler.sir.R
   pkg/pomp/inst/examples/gillespie.sir.R
   pkg/pomp/man/example.Rd
Removed:
   pkg/pomp/data/bbs.rda
   pkg/pomp/data/blowflies.rda
   pkg/pomp/data/dacca.rda
   pkg/pomp/data/euler.sir.rda
   pkg/pomp/data/gillespie.sir.rda
   pkg/pomp/data/gompertz.rda
   pkg/pomp/data/ou2.rda
   pkg/pomp/data/ricker.rda
   pkg/pomp/data/rw2.rda
   pkg/pomp/data/verhulst.rda
   pkg/pomp/inst/examples/sir.R
Modified:
   pkg/pomp/.Rbuildignore
   pkg/pomp/DESCRIPTION
   pkg/pomp/inst/NEWS
   pkg/pomp/man/blowflies.Rd
   pkg/pomp/man/dacca.Rd
   pkg/pomp/man/gompertz.Rd
   pkg/pomp/man/init.state-pomp.Rd
   pkg/pomp/man/ou2.Rd
   pkg/pomp/man/parmat.Rd
   pkg/pomp/man/probe.Rd
   pkg/pomp/man/ricker.Rd
   pkg/pomp/man/rw2.Rd
   pkg/pomp/man/simulate-pomp.Rd
   pkg/pomp/man/sir.Rd
   pkg/pomp/man/spect.Rd
   pkg/pomp/man/traj-match.Rd
   pkg/pomp/man/trajectory-pomp.Rd
   pkg/pomp/man/verhulst.Rd
   pkg/pomp/tests/bbs-trajmatch.R
   pkg/pomp/tests/bbs-trajmatch.Rout.save
   pkg/pomp/tests/bbs.R
   pkg/pomp/tests/bbs.Rout.save
   pkg/pomp/tests/blowflies.R
   pkg/pomp/tests/blowflies.Rout.save
   pkg/pomp/tests/dacca.R
   pkg/pomp/tests/dacca.Rout.save
   pkg/pomp/tests/dimchecks.R
   pkg/pomp/tests/dimchecks.Rout.save
   pkg/pomp/tests/fhn.Rout.save
   pkg/pomp/tests/filtfail.Rout.save
   pkg/pomp/tests/gillespie.R
   pkg/pomp/tests/gillespie.Rout.save
   pkg/pomp/tests/gompertz.R
   pkg/pomp/tests/gompertz.Rout.save
   pkg/pomp/tests/logistic.Rout.save
   pkg/pomp/tests/ou2-bsmc.R
   pkg/pomp/tests/ou2-bsmc.Rout.save
   pkg/pomp/tests/ou2-forecast.R
   pkg/pomp/tests/ou2-forecast.Rout.save
   pkg/pomp/tests/ou2-icfit.R
   pkg/pomp/tests/ou2-icfit.Rout.save
   pkg/pomp/tests/ou2-kalman.R
   pkg/pomp/tests/ou2-kalman.Rout.save
   pkg/pomp/tests/ou2-mif-fp.R
   pkg/pomp/tests/ou2-mif-fp.Rout.save
   pkg/pomp/tests/ou2-mif.R
   pkg/pomp/tests/ou2-mif.Rout.save
   pkg/pomp/tests/ou2-nlf.R
   pkg/pomp/tests/ou2-nlf.Rout.save
   pkg/pomp/tests/ou2-pmcmc.R
   pkg/pomp/tests/ou2-pmcmc.Rout.save
   pkg/pomp/tests/ou2-probe.R
   pkg/pomp/tests/ou2-probe.Rout.save
   pkg/pomp/tests/ou2-procmeas.R
   pkg/pomp/tests/ou2-procmeas.Rout.save
   pkg/pomp/tests/ou2-simulate.R
   pkg/pomp/tests/ou2-simulate.Rout.save
   pkg/pomp/tests/ou2-trajmatch.R
   pkg/pomp/tests/ou2-trajmatch.Rout.save
   pkg/pomp/tests/partrans.R
   pkg/pomp/tests/partrans.Rout.save
   pkg/pomp/tests/pfilter.R
   pkg/pomp/tests/pfilter.Rout.save
   pkg/pomp/tests/pomppomp.R
   pkg/pomp/tests/pomppomp.Rout.save
   pkg/pomp/tests/ricker-bsmc.R
   pkg/pomp/tests/ricker-bsmc.Rout.save
   pkg/pomp/tests/ricker-probe.R
   pkg/pomp/tests/ricker-probe.Rout.save
   pkg/pomp/tests/ricker-spect.R
   pkg/pomp/tests/ricker-spect.Rout.save
   pkg/pomp/tests/ricker.R
   pkg/pomp/tests/ricker.Rout.save
   pkg/pomp/tests/rw2.R
   pkg/pomp/tests/rw2.Rout.save
   pkg/pomp/tests/sir.R
   pkg/pomp/tests/sir.Rout.save
   pkg/pomp/tests/skeleton.R
   pkg/pomp/tests/skeleton.Rout.save
   pkg/pomp/tests/steps.R
   pkg/pomp/tests/steps.Rout.save
   pkg/pomp/tests/synlik.R
   pkg/pomp/tests/synlik.Rout.save
   pkg/pomp/tests/verhulst.R
   pkg/pomp/tests/verhulst.Rout.save
Log:
- get rid of all data()-loadable pomp objects, replacing them with the new 'pompExample' facility


Modified: pkg/pomp/.Rbuildignore
===================================================================
--- pkg/pomp/.Rbuildignore	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/.Rbuildignore	2013-01-09 20:16:59 UTC (rev 801)
@@ -1,6 +1,4 @@
 inst/doc/Makefile
-inst/data-R/Makefile
-inst/data-R/make.R
 inst/doc/(.+?)\.bst$
 inst/doc/(.+?)\.R$
 inst/doc/(.+?)\.png$

Modified: pkg/pomp/DESCRIPTION
===================================================================
--- pkg/pomp/DESCRIPTION	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/DESCRIPTION	2013-01-09 20:16:59 UTC (rev 801)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical inference for partially observed Markov processes
-Version: 0.43-6
-Date: 2013-01-08
+Version: 0.44-1
+Date: 2013-01-09
 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>
 URL: http://pomp.r-forge.r-project.org

Deleted: pkg/pomp/data/bbs.rda
===================================================================
(Binary files differ)

Deleted: pkg/pomp/data/blowflies.rda
===================================================================
(Binary files differ)

Deleted: pkg/pomp/data/dacca.rda
===================================================================
(Binary files differ)

Deleted: pkg/pomp/data/euler.sir.rda
===================================================================
(Binary files differ)

Deleted: pkg/pomp/data/gillespie.sir.rda
===================================================================
(Binary files differ)

Deleted: pkg/pomp/data/gompertz.rda
===================================================================
(Binary files differ)

Deleted: pkg/pomp/data/ou2.rda
===================================================================
(Binary files differ)

Deleted: pkg/pomp/data/ricker.rda
===================================================================
(Binary files differ)

Deleted: pkg/pomp/data/rw2.rda
===================================================================
(Binary files differ)

Deleted: pkg/pomp/data/verhulst.rda
===================================================================
(Binary files differ)

Modified: pkg/pomp/inst/NEWS
===================================================================
--- pkg/pomp/inst/NEWS	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/inst/NEWS	2013-01-09 20:16:59 UTC (rev 801)
@@ -1,4 +1,9 @@
 NEWS
+0.44-1
+     o	Remove all data()-loadable pomp objects.
+	To load the prebuilt example pomp objects from previous versions, use the new 'pompExample' function.
+	E.g., instead of 'data(euler.sir)', do 'pompExample("euler.sir")'.
+
 0.43-4
      o	Clean up tests.
 

Added: pkg/pomp/inst/examples/bbs.R
===================================================================
--- pkg/pomp/inst/examples/bbs.R	                        (rev 0)
+++ pkg/pomp/inst/examples/bbs.R	2013-01-09 20:16:59 UTC (rev 801)
@@ -0,0 +1,87 @@
+require(pomp)
+
+tc <- textConnection("
+day;reports
+1;3
+2;8
+3;28
+4;76
+5;222
+6;293
+7;257
+8;237
+9;192
+10;126
+11;70
+12;28
+13;12
+14;5
+")
+
+flu <- read.csv2(file=tc)
+close(tc)
+
+po <- pomp(
+           data=flu,
+           times="day",
+           t0=0,
+           rprocess=euler.sim(
+             step.fun="_sir_euler_simulator",
+             delta.t=1/12,
+             PACKAGE="pomp"
+             ),
+           skeleton.type="vectorfield",
+           skeleton="_sir_ODE",
+           measurement.model=reports~norm(mean=rho*cases,sd=1+sigma*cases),
+           PACKAGE="pomp",
+           obsnames = c("reports"),
+           statenames=c("S","I","R","cases","W"),
+           paramnames=c(
+             "gamma","mu","iota",
+             "beta","beta.sd","pop","rho",
+             "S.0","I.0","R.0"
+             ),
+           zeronames=c("cases"),
+           comp.names=c("S","I","R"),
+           ic.names=c("S.0","I.0","R.0"),
+           nbasis=1L,
+           degree=0L,
+           period=1.0,
+           logvar=c(
+             "beta","gamma","mu","iota","sigma","beta.sd",
+             "S.0","I.0","R.0"
+             ),
+           logitvar="rho",
+           parameter.inv.transform=function (params, logvar, logitvar, ...) {
+             params[logvar] <- log(params[logvar])
+             params[logitvar] <- qlogis(params[logitvar])
+             params
+           },
+           parameter.transform=function (params, logvar, logitvar, ...) {
+             params[logvar] <- exp(params[logvar])
+             params[logitvar] <- plogis(params[logitvar])
+             params
+           },
+           initializer=function(params, t0, comp.names, ic.names, ...) {
+             snames <- c("S","I","R","cases","W")
+             fracs <- params[ic.names]
+             x0 <- numeric(length(snames))
+             names(x0) <- snames
+             x0[comp.names] <- round(params['pop']*fracs/sum(fracs))
+             x0
+           }
+           )
+
+coef(po) <- c(
+              gamma=1/3,mu=0.0,iota=0.0,
+              beta=1.4,
+              beta.sd=0,
+              pop=1400,
+              rho=0.9,sigma=3.6,
+              S.0=0.999,I.0=0.001,R.0=0
+              )
+
+bbs <- po
+
+assign("bbs",bbs,envir=.GlobalEnv)
+c("bbs")

Added: pkg/pomp/inst/examples/euler.sir.R
===================================================================
--- pkg/pomp/inst/examples/euler.sir.R	                        (rev 0)
+++ pkg/pomp/inst/examples/euler.sir.R	2013-01-09 20:16:59 UTC (rev 801)
@@ -0,0 +1,57 @@
+require(pomp)
+
+po <- pomp(
+           data=data.frame(
+             time=seq(from=1/52,to=4,by=1/52),
+             reports=NA
+             ),
+           times="time",
+           t0=0,
+           rprocess=euler.sim(
+             step.fun="_sir_euler_simulator",
+             delta.t=1/52/20,
+             PACKAGE="pomp"
+             ),
+           skeleton.type="vectorfield",
+           skeleton="_sir_ODE",
+           rmeasure="_sir_binom_rmeasure",
+           dmeasure="_sir_binom_dmeasure",
+           PACKAGE="pomp",
+           obsnames = c("reports"),
+           statenames=c("S","I","R","cases","W"),
+           paramnames=c(
+             "gamma","mu","iota",
+             "beta1","beta.sd","pop","rho",
+             "S.0","I.0","R.0"
+             ),
+           zeronames=c("cases"),
+           comp.names=c("S","I","R"),
+           ic.names=c("S.0","I.0","R.0"),
+           parameter.transform="_sir_par_trans",
+           parameter.inv.transform="_sir_par_untrans",
+           nbasis=3L,
+           degree=3L,
+           period=1.0,
+           initializer=function(params, t0, comp.names, ic.names, ...) {
+             snames <- c("S","I","R","cases","W")
+             fracs <- params[ic.names]
+             x0 <- numeric(length(snames))
+             names(x0) <- snames
+             x0[comp.names] <- round(params['pop']*fracs/sum(fracs))
+             x0
+           }
+           )
+
+coef(po) <- c(
+              gamma=26,mu=0.02,iota=0.01,
+              beta1=400,beta2=480,beta3=320,
+              beta.sd=1e-3,
+              pop=2.1e6,
+              rho=0.6,
+              S.0=26/400,I.0=0.001,R.0=1-26/400
+              )
+
+simulate(po,nsim=1,seed=329343545L) -> euler.sir
+
+assign("euler.sir",euler.sir,envir=.GlobalEnv)
+c("euler.sir")

Added: pkg/pomp/inst/examples/gillespie.sir.R
===================================================================
--- pkg/pomp/inst/examples/gillespie.sir.R	                        (rev 0)
+++ pkg/pomp/inst/examples/gillespie.sir.R	2013-01-09 20:16:59 UTC (rev 801)
@@ -0,0 +1,75 @@
+require(pomp)
+
+po <- pomp(
+           data=data.frame(
+             time=seq(from=0,to=10,by=1/52),
+             reports=NA
+             ),
+           times="time",
+           t0=0,
+           rprocess=gillespie.sim(
+             rate.fun="_sir_rates",
+             PACKAGE="pomp",
+             v=cbind(
+               birth=c(1,0,0,1,0),
+               sdeath=c(-1,0,0,-1,0),
+               infection=c(-1,1,0,0,0),
+               ideath=c(0,-1,0,-1,0),
+               recovery=c(0,-1,1,0,1),
+               rdeath=c(0,0,-1,-1,0)
+               ),
+             d=cbind(
+               birth=c(0,0,0,1,0),
+               sdeath=c(1,0,0,0,0),
+               infection=c(1,1,0,1,0),
+               ideath=c(0,1,0,0,0),
+               recovery=c(0,1,0,0,0),
+               rdeath=c(0,0,1,0,0)
+               )
+             ),
+           skeleton.type="vectorfield",
+           skeleton="_sir_ODE",
+           measurement.model=reports~binom(size=cases,prob=rho),
+           PACKAGE="pomp",
+           obsnames = c("reports"),
+           statenames=c("S","I","R","N","cases"),
+           paramnames=c(
+             "gamma","mu","iota",
+             "beta1","beta.sd","pop","rho",
+             "S.0","I.0","R.0"
+             ),
+           zeronames=c("cases"),
+           comp.names=c("S","I","R"),
+           ic.names=c("S.0","I.0","R.0"),
+           parameter.transform="_sir_par_trans",
+           parameter.inv.transform="_sir_par_untrans",
+           nbasis=3L,
+           degree=3L,
+           period=1.0,
+           initializer=function(params, t0, comp.names, ic.names, ...) {
+             x0 <- numeric(5)
+             names(x0) <- c("S","I","R","N","cases")
+             fracs <- params[ic.names]
+             x0["N"] <- params["pop"]
+             x0[comp.names] <- round(params["pop"]*fracs/sum(fracs))
+             x0
+           }
+           )
+
+coef(po) <- c(
+              gamma=24,mu=1/70,iota=0.1,
+              beta1=330,beta2=410,beta3=490,
+              rho=0.1,
+              S.0=0.05,I.0=1e-4,R.0=0.95,
+              pop=1000000,
+              beta.sd=0
+              )
+
+simulate(
+         po,
+         nsim=1,
+         seed=1165270654L
+         ) -> gillespie.sir
+
+assign("gillespie.sir",gillespie.sir,envir=.GlobalEnv)
+c("gillespie.sir")

Deleted: pkg/pomp/inst/examples/sir.R
===================================================================
--- pkg/pomp/inst/examples/sir.R	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/inst/examples/sir.R	2013-01-09 20:16:59 UTC (rev 801)
@@ -1,196 +0,0 @@
-require(pomp)
-
-po <- pomp(
-           data=data.frame(
-             time=seq(from=1/52,to=4,by=1/52),
-             reports=NA
-             ),
-           times="time",
-           t0=0,
-           rprocess=euler.sim(
-             step.fun="_sir_euler_simulator",
-             delta.t=1/52/20,
-             PACKAGE="pomp"
-             ),
-           skeleton.type="vectorfield",
-           skeleton="_sir_ODE",
-           rmeasure="_sir_binom_rmeasure",
-           dmeasure="_sir_binom_dmeasure",
-           PACKAGE="pomp",
-           obsnames = c("reports"),
-           statenames=c("S","I","R","cases","W"),
-           paramnames=c(
-             "gamma","mu","iota",
-             "beta1","beta.sd","pop","rho",
-             "S.0","I.0","R.0"
-             ),
-           zeronames=c("cases"),
-           comp.names=c("S","I","R"),
-           ic.names=c("S.0","I.0","R.0"),
-           parameter.transform="_sir_par_trans",
-           parameter.inv.transform="_sir_par_untrans",
-           nbasis=3L,
-           degree=3L,
-           period=1.0,
-           initializer=function(params, t0, comp.names, ic.names, ...) {
-             snames <- c("S","I","R","cases","W")
-             fracs <- params[ic.names]
-             x0 <- numeric(length(snames))
-             names(x0) <- snames
-             x0[comp.names] <- round(params['pop']*fracs/sum(fracs))
-             x0
-           }
-           )
-
-coef(po) <- c(
-              gamma=26,mu=0.02,iota=0.01,
-              beta1=400,beta2=480,beta3=320,
-              beta.sd=1e-3,
-              pop=2.1e6,
-              rho=0.6,
-              S.0=26/400,I.0=0.001,R.0=1-26/400
-              )
-
-simulate(po,nsim=1,seed=329343545L) -> euler.sir
-
-time(po) <- seq(from=0,to=10,by=1/52)
-
-po <- pomp(
-           po,
-           statenames=c("S","I","R","N","cases"),
-           rprocess=gillespie.sim(
-             rate.fun="_sir_rates",
-             PACKAGE="pomp",
-             v=cbind(
-               birth=c(1,0,0,1,0),
-               sdeath=c(-1,0,0,-1,0),
-               infection=c(-1,1,0,0,0),
-               ideath=c(0,-1,0,-1,0),
-               recovery=c(0,-1,1,0,1),
-               rdeath=c(0,0,-1,-1,0)
-               ),
-             d=cbind(
-               birth=c(0,0,0,1,0),
-               sdeath=c(1,0,0,0,0),
-               infection=c(1,1,0,1,0),
-               ideath=c(0,1,0,0,0),
-               recovery=c(0,1,0,0,0),
-               rdeath=c(0,0,1,0,0)
-               )
-             ),
-           measurement.model=reports~binom(size=cases,prob=rho),
-           comp.names=c("S","I","R"),
-           ic.names=c("S.0","I.0","R.0"),
-           initializer=function(params, t0, comp.names, ic.names, ...) {
-             x0 <- numeric(5)
-             names(x0) <- c("S","I","R","N","cases")
-             fracs <- params[ic.names]
-             x0["N"] <- params["pop"]
-             x0[comp.names] <- round(params["pop"]*fracs/sum(fracs))
-             x0
-           }
-           )
-
-coef(po) <- c(
-              gamma=24,mu=1/70,iota=0.1,
-              beta1=330,beta2=410,beta3=490,
-              rho=0.1,
-              S.0=0.05,I.0=1e-4,R.0=0.95,
-              pop=1000000,
-              beta.sd=0
-              )
-
-simulate(
-         po,
-         nsim=1,
-         seed=1165270654L
-         ) -> gillespie.sir
-
-
-tc <- textConnection("
-day;reports
-1;3
-2;8
-3;28
-4;76
-5;222
-6;293
-7;257
-8;237
-9;192
-10;126
-11;70
-12;28
-13;12
-14;5
-")
-
-flu <- read.csv2(file=tc)
-close(tc)
-
-po <- pomp(
-           data=flu,
-           times="day",
-           t0=0,
-           rprocess=euler.sim(
-             step.fun="_sir_euler_simulator",
-             delta.t=1/12,
-             PACKAGE="pomp"
-             ),
-           skeleton.type="vectorfield",
-           skeleton="_sir_ODE",
-           measurement.model=reports~norm(mean=rho*cases,sd=1+sigma*cases),
-           PACKAGE="pomp",
-           obsnames = c("reports"),
-           statenames=c("S","I","R","cases","W"),
-           paramnames=c(
-             "gamma","mu","iota",
-             "beta","beta.sd","pop","rho",
-             "S.0","I.0","R.0"
-             ),
-           zeronames=c("cases"),
-           comp.names=c("S","I","R"),
-           ic.names=c("S.0","I.0","R.0"),
-           nbasis=1L,
-           degree=0L,
-           period=1.0,
-           logvar=c(
-             "beta","gamma","mu","iota","sigma","beta.sd",
-             "S.0","I.0","R.0"
-             ),
-           logitvar="rho",
-           parameter.inv.transform=function (params, logvar, logitvar, ...) {
-             params[logvar] <- log(params[logvar])
-             params[logitvar] <- qlogis(params[logitvar])
-             params
-           },
-           parameter.transform=function (params, logvar, logitvar, ...) {
-             params[logvar] <- exp(params[logvar])
-             params[logitvar] <- plogis(params[logitvar])
-             params
-           },
-           initializer=function(params, t0, comp.names, ic.names, ...) {
-             snames <- c("S","I","R","cases","W")
-             fracs <- params[ic.names]
-             x0 <- numeric(length(snames))
-             names(x0) <- snames
-             x0[comp.names] <- round(params['pop']*fracs/sum(fracs))
-             x0
-           }
-           )
-
-coef(po) <- c(
-              gamma=1/3,mu=0.0,iota=0.0,
-              beta=1.4,
-              beta.sd=0,
-              pop=1400,
-              rho=0.9,sigma=3.6,
-              S.0=0.999,I.0=0.001,R.0=0
-              )
-
-bbs <- po
-
-assign("euler.sir",euler.sir,envir=.GlobalEnv)
-assign("gillespie.sir",gillespie.sir,envir=.GlobalEnv)
-assign("bbs",bbs,envir=.GlobalEnv)
-c("euler.sir","gillespie.sir","bbs")

Modified: pkg/pomp/man/blowflies.Rd
===================================================================
--- pkg/pomp/man/blowflies.Rd	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/man/blowflies.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -7,9 +7,8 @@
 \description{
   \code{blowflies1} and \code{blowflies2} are \code{pomp} objects encoding stochastic delay-difference models.
 }
-\usage{data(blowflies)}
 \examples{
-data(blowflies)
+pompExample("blowflies")
 plot(blowflies1)
 plot(blowflies2)
 }
@@ -34,7 +33,7 @@
   
   Do
 
-  \code{file.show(system.file("data-R","blowflies.R",package="pomp"))}
+  \code{file.show(system.file("examples","blowflies.R",package="pomp"))}
 
   to view the code that constructs these pomp objects.
 }

Modified: pkg/pomp/man/dacca.Rd
===================================================================
--- pkg/pomp/man/dacca.Rd	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/man/dacca.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -9,9 +9,6 @@
 
   Data are provided courtesy of Dr. Menno J. Bouma, London School of Tropical Medicine and Hygiene.
 }
-\usage{
-data(dacca)
-}
 \details{
   \code{dacca} is a \code{pomp} object containing the model, data, and MLE parameters.
   Parameters that naturally range over the positive reals are log-transformed;
@@ -19,7 +16,7 @@
   parameters that are naturally unbounded or take integer values are not transformed.
 }
 \examples{
-data(dacca)
+pompExample("dacca")
 plot(dacca)
 #MLEs on the natural scale
 coef(dacca)

Added: pkg/pomp/man/example.Rd
===================================================================
--- pkg/pomp/man/example.Rd	                        (rev 0)
+++ pkg/pomp/man/example.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -0,0 +1,23 @@
+\name{pompExample}
+\alias{pompExample}
+\title{Pre-built examples of pomp objects.}
+\description{
+  \code{pompExample} loads pre-built example \code{pomp} objects.
+}
+\usage{
+pompExample(example)
+}
+\arguments{
+  \item{example}{
+    character; name of the example to load.
+    Evoked without an argument, \code{pompExample} lists all available examples.
+  }
+}
+\value{
+  \code{pompExample} has the side effect of creating one or more \code{pomp} objects in the global workspace.
+}
+\author{Aaron A. King \email{kingaa at umich dot edu}}
+\examples{
+  pompExample()
+  pompExample("euler.sir")
+}

Modified: pkg/pomp/man/gompertz.Rd
===================================================================
--- pkg/pomp/man/gompertz.Rd	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/man/gompertz.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -5,7 +5,6 @@
 \description{
   \code{gompertz} is a \code{pomp} object encoding a stochastic Gompertz population model with log-normal measurement error.
 }
-\usage{data(gompertz)}
 \details{
   The state process is \eqn{X_{t+1} = K^{1-S} X_{t}^S \epsilon_{t}}{X[t+1]=K^(1-S) X[t]^S eps[t]}, where \eqn{S=e^{-r}}{S=e^{-r}} and the \eqn{\epsilon_t}{eps[t]} are i.i.d. lognormal random deviates with variance \eqn{\sigma^2}{sigma^2}.
   The observed variables \eqn{Y_t} are distributed as \eqn{\mathrm{lognormal}(\log{X_t},\tau)}{lognormal(log(X[t]),tau)}.
@@ -13,7 +12,7 @@
   The \code{pomp} object includes parameter transformations that log-transform the parameters for estimation purposes.
 }
 \examples{
-data(gompertz)
+pompExample("gompertz")
 plot(gompertz)
 coef(gompertz)
 coef(gompertz,transform=TRUE)

Modified: pkg/pomp/man/init.state-pomp.Rd
===================================================================
--- pkg/pomp/man/init.state-pomp.Rd	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/man/init.state-pomp.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -25,11 +25,11 @@
   Returns a matrix of initial states (with rownames).
 }
 \examples{
-data(ou2)
+pompExample("ou2")
 coef(ou2)
 init.state(ou2)
 
-data(euler.sir)
+pompExample("euler.sir")
 coef(euler.sir)
 init.state(euler.sir)
 }

Modified: pkg/pomp/man/ou2.Rd
===================================================================
--- pkg/pomp/man/ou2.Rd	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/man/ou2.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -5,7 +5,6 @@
 \description{
   \code{ou2} is a \code{pomp} object encoding a bivariate discrete-time Ornstein-Uhlenbeck process.
 }
-\usage{data(ou2)}
 \details{
   If the state process is \eqn{X(t) = (x_{1}(t),x_{2}(t))}, then
   \deqn{X(t+1) = \alpha X(t) + \sigma \epsilon(t),}
@@ -16,7 +15,7 @@
   This object is demonstrated in the vignette "Advanced topics in pomp".
 }
 \examples{
-data(ou2)
+pompExample("ou2")
 plot(ou2)
 coef(ou2)
 x <- simulate(ou2)

Modified: pkg/pomp/man/parmat.Rd
===================================================================
--- pkg/pomp/man/parmat.Rd	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/man/parmat.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -21,7 +21,7 @@
 \author{Aaron A. King \email{kingaa at umich dot edu}}
 \examples{
   ## generate a bifurcation diagram for the Ricker map
-  data(ricker)
+  pompExample("ricker")
   p <- parmat(coef(ricker),nrep=500)
   p["r",] <- exp(seq(from=1.5,to=4,length=500))
   x <- trajectory(ricker,times=seq(from=1000,to=2000,by=1),params=p)

Modified: pkg/pomp/man/probe.Rd
===================================================================
--- pkg/pomp/man/probe.Rd	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/man/probe.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -166,7 +166,7 @@
   Aaron A. King (kingaa at umich dot edu)
 }
 \examples{
-data(ou2)
+pompExample("ou2")
 good <- probe(
               ou2,
               probes=list(

Modified: pkg/pomp/man/ricker.Rd
===================================================================
--- pkg/pomp/man/ricker.Rd	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/man/ricker.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -5,13 +5,12 @@
 \description{
   \code{ricker} is a \code{pomp} object encoding a stochastic Ricker model with Poisson measurement error.
 }
-\usage{data(ricker)}
 \details{
   The state process is \eqn{N_{t+1} = r N_{t} \exp(-N_{t}+e_{t})}{N[t+1] = r N[t] exp(-N[t]+e[t])}, where the \eqn{e_t}{e[t]} are i.i.d. normal random deviates with zero mean and variance \eqn{\sigma^2}{sigma^2}.
   The observed variables \eqn{y_t}{y[t]} are distributed as \eqn{\mathrm{Poisson}(\phi N_t)}{Poisson(phi N[t])}.
 }
 \examples{
-data(ricker)
+pompExample("ricker")
 plot(ricker)
 coef(ricker)
 }

Modified: pkg/pomp/man/rw2.Rd
===================================================================
--- pkg/pomp/man/rw2.Rd	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/man/rw2.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -5,12 +5,11 @@
 \description{
   \code{rw2} is a \code{pomp} object encoding a 2-D normal random walk.
 }
-\usage{data(rw2)}
 \details{
   The random-walk process is fully but noisily observed.
 }
 \examples{
-data(rw2)
+pompExample("rw2")
 plot(rw2)
 x <- simulate(rw2,nsim=10,seed=20348585L,params=c(x1.0=0,x2.0=0,s1=1,s2=3,tau=1))
 plot(x[[1]])

Modified: pkg/pomp/man/simulate-pomp.Rd
===================================================================
--- pkg/pomp/man/simulate-pomp.Rd	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/man/simulate-pomp.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -61,7 +61,7 @@
   This makes it possible for the user to write highly optimized code for these potentially expensive computations.
 }
 \examples{
-data(ou2)
+pompExample("ou2")
 x <- simulate(ou2,seed=3495485,nsim=10)
 x <- simulate(ou2,seed=3495485,nsim=10,states=TRUE,obs=TRUE)
 }

Modified: pkg/pomp/man/sir.Rd
===================================================================
--- pkg/pomp/man/sir.Rd	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/man/sir.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -10,33 +10,28 @@
   \code{gillespie.sir} has the same model implemented using Gillespie's algorithm.
   \code{bbs} is a nonseasonal SIR model together with data from a 1978 outbreak of influenza in a British boarding school.
 }
-\usage{
-data(euler.sir)
-data(gillespie.sir)
-data(bbs)
-}
 \details{
   This example is discussed extensively in the \dQuote{Introduction to \pkg{pomp}} and \dQuote{Advanced topics in \pkg{pomp}} vignettes.
 
-  The codes that construct these \code{pomp} objects can be found in the \dQuote{data-R} directory in the installed package.
-  Do \code{file.show(system.file("data-R/sir.R",package="pomp"))} to view these codes.
+  The codes that construct these \code{pomp} objects can be found in the \dQuote{examples} directory in the installed package.
+  Do \code{system.file("examples",package="pomp"))} to find this directory.
   For the basic \code{rprocess}, \code{dmeasure}, \code{rmeasure}, and \code{skeleton} functions, these codes use compiled native routines built into the package's library.
   View \dQuote{src/sir.c} in the package source or \code{file.show("examples/sir.c")} from an \R session to view these codes.
 
   The boarding school influenza outbreak is described in Anonymous (1978).
 }
 \examples{
-data(euler.sir)
+pompExample("euler.sir")
 plot(euler.sir)
 plot(simulate(euler.sir,seed=20348585))
 coef(euler.sir)
 
-data(gillespie.sir)
+pompExample("gillespie.sir")
 plot(gillespie.sir)
 plot(simulate(gillespie.sir,seed=20348585))
 coef(gillespie.sir)
 
-data(bbs)
+pompExample("bbs")
 plot(bbs)
 coef(bbs)
 }

Modified: pkg/pomp/man/spect.Rd
===================================================================
--- pkg/pomp/man/spect.Rd	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/man/spect.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -154,7 +154,7 @@
   Aaron A. King (kingaa at umich dot edu)
 }
 \examples{
-data(ou2)
+pompExample("ou2")
 good <- spect(
               ou2,
               vars=c("y1","y2"),

Modified: pkg/pomp/man/traj-match.Rd
===================================================================
--- pkg/pomp/man/traj-match.Rd	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/man/traj-match.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -111,7 +111,7 @@
   \code{traj.match.objfun} returns a function suitable for use as an objective function in an \code{\link{optim}}-like optimizer.
 }
 \examples{
-  data(ou2)
+  pompExample("ou2")
   true.p <- c(
 	      alpha.1=0.9,alpha.2=0,alpha.3=-0.4,alpha.4=0.99,
 	      sigma.1=2,sigma.2=0.1,sigma.3=2,
@@ -137,11 +137,11 @@
   lines(x1~time,data=as(res,"data.frame"),col='blue')
   lines(x2~time,data=as(res,"data.frame"),col='red')
 
-  data(ricker)
+  pompExample("ricker")
   ofun <- traj.match.objfun(ricker,est=c("r","phi"),transform=TRUE)
   optim(fn=ofun,par=c(2,0),method="BFGS")
 
-  data(bbs)
+  pompExample("bbs")
   ofun <- traj.match.objfun(bbs,est=c("beta","gamma"),transform=TRUE,hmax=0.001)
   optim(fn=ofun,par=c(0,-1),method="Nelder-Mead")
 }

Modified: pkg/pomp/man/trajectory-pomp.Rd
===================================================================
--- pkg/pomp/man/trajectory-pomp.Rd	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/man/trajectory-pomp.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -48,7 +48,7 @@
 }
 \author{Aaron A. King \email{kingaa at umich dot edu}}
 \examples{
-data(euler.sir)
+pompExample("euler.sir")
 x <- trajectory(euler.sir)
 plot(time(euler.sir),x["I",1,],type='l',xlab='time',ylab='I')
 lines(time(euler.sir),x["cases",1,],col='red')

Modified: pkg/pomp/man/verhulst.Rd
===================================================================
--- pkg/pomp/man/verhulst.Rd	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/man/verhulst.Rd	2013-01-09 20:16:59 UTC (rev 801)
@@ -5,13 +5,12 @@
 \description{
   \code{verhulst} is a \code{pomp} object encoding a univariate stochastic logistic model with measurement error.
 }
-\usage{data(verhulst)}
 \details{
   The model is written as an Ito diffusion, \eqn{dn = r n (1-n/K) dt + \sigma n dW}, where \eqn{W} is a Wiener process.
   It is implemented using the \code{\link{euler.sim}} plug-in.
 }
 \examples{
-data(verhulst)
+pompExample("verhulst")
 plot(verhulst)
 coef(verhulst)
 params <- cbind(

Modified: pkg/pomp/tests/bbs-trajmatch.R
===================================================================
--- pkg/pomp/tests/bbs-trajmatch.R	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/tests/bbs-trajmatch.R	2013-01-09 20:16:59 UTC (rev 801)
@@ -1,6 +1,6 @@
 library(pomp)
 
-data(bbs)
+pompExample("bbs")
 
 guess <- c(
            mu=0,gamma=1/3,beta=1,beta.sd=0,iota=0,

Modified: pkg/pomp/tests/bbs-trajmatch.Rout.save
===================================================================
--- pkg/pomp/tests/bbs-trajmatch.Rout.save	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/tests/bbs-trajmatch.Rout.save	2013-01-09 20:16:59 UTC (rev 801)
@@ -1,5 +1,5 @@
 
-R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
+R version 2.15.2 (2012-10-26) -- "Trick or Treat"
 Copyright (C) 2012 The R Foundation for Statistical Computing
 ISBN 3-900051-07-0
 Platform: x86_64-unknown-linux-gnu (64-bit)
@@ -21,7 +21,9 @@
 Loading required package: subplex
 Loading required package: deSolve
 > 
-> data(bbs)
+> pompExample("bbs")
+newly created pomp objects:
+ bbs 
 > 
 > guess <- c(
 +            mu=0,gamma=1/3,beta=1,beta.sd=0,iota=0,
@@ -68,4 +70,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  2.180   0.032   2.236 
+  2.424   0.060   2.516 

Modified: pkg/pomp/tests/bbs.R
===================================================================
--- pkg/pomp/tests/bbs.R	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/tests/bbs.R	2013-01-09 20:16:59 UTC (rev 801)
@@ -1,6 +1,6 @@
 library(pomp)
 
-data(bbs)
+pompExample("bbs")
 
 set.seed(48857734L)
 

Modified: pkg/pomp/tests/bbs.Rout.save
===================================================================
--- pkg/pomp/tests/bbs.Rout.save	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/tests/bbs.Rout.save	2013-01-09 20:16:59 UTC (rev 801)
@@ -21,7 +21,9 @@
 Loading required package: subplex
 Loading required package: deSolve
 > 
-> data(bbs)
+> pompExample("bbs")
+newly created pomp objects:
+ bbs 
 > 
 > set.seed(48857734L)
 > 
@@ -58,4 +60,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  2.656   0.056   2.736 
+  2.704   0.100   2.827 

Modified: pkg/pomp/tests/blowflies.R
===================================================================
--- pkg/pomp/tests/blowflies.R	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/tests/blowflies.R	2013-01-09 20:16:59 UTC (rev 801)
@@ -1,6 +1,6 @@
 library(pomp)
 
-data(blowflies)
+pompExample("blowflies")
 
 init.state(blowflies1)
 x1 <- simulate(blowflies1)

Modified: pkg/pomp/tests/blowflies.Rout.save
===================================================================
--- pkg/pomp/tests/blowflies.Rout.save	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/tests/blowflies.Rout.save	2013-01-09 20:16:59 UTC (rev 801)
@@ -1,5 +1,5 @@
 
-R version 2.14.2 (2012-02-29)
+R version 2.15.2 (2012-10-26) -- "Trick or Treat"
 Copyright (C) 2012 The R Foundation for Statistical Computing
 ISBN 3-900051-07-0
 Platform: x86_64-unknown-linux-gnu (64-bit)
@@ -21,7 +21,9 @@
 Loading required package: subplex
 Loading required package: deSolve
 > 
-> data(blowflies)
+> pompExample("blowflies")
+newly created pomp objects:
+ blowflies1 blowflies2 
 > 
 > init.state(blowflies1)
      [,1]
@@ -68,3 +70,6 @@
 > logLik(f2)
 [1] -1471.781
 > 
+> proc.time()
+   user  system elapsed 
+  1.316   0.064   1.397 

Modified: pkg/pomp/tests/dacca.R
===================================================================
--- pkg/pomp/tests/dacca.R	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/tests/dacca.R	2013-01-09 20:16:59 UTC (rev 801)
@@ -2,7 +2,7 @@
 
 set.seed(1420306530L)
 
-data(dacca)
+pompExample("dacca")
 
 x <- as.data.frame(dacca)
 print(names(x))

Modified: pkg/pomp/tests/dacca.Rout.save
===================================================================
--- pkg/pomp/tests/dacca.Rout.save	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/tests/dacca.Rout.save	2013-01-09 20:16:59 UTC (rev 801)
@@ -1,5 +1,5 @@
 
-R version 2.15.0 (2012-03-30)
+R version 2.15.2 (2012-10-26) -- "Trick or Treat"
 Copyright (C) 2012 The R Foundation for Statistical Computing
 ISBN 3-900051-07-0
 Platform: x86_64-unknown-linux-gnu (64-bit)
@@ -23,7 +23,9 @@
 > 
 > set.seed(1420306530L)
 > 
-> data(dacca)
+> pompExample("dacca")
+newly created pomp objects:
+ dacca 
 > 
 > x <- as.data.frame(dacca)
 > print(names(x))
@@ -50,4 +52,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  3.428   0.052   3.501 
+  3.544   0.096   3.661 

Modified: pkg/pomp/tests/dimchecks.R
===================================================================
--- pkg/pomp/tests/dimchecks.R	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/tests/dimchecks.R	2013-01-09 20:16:59 UTC (rev 801)
@@ -2,7 +2,7 @@
 
 set.seed(1420306530L)
 
-data(ricker)
+pompExample("ricker")
 po <- ricker
 
 pars <- coef(po)
@@ -49,7 +49,7 @@
 stopifnot(identical(g1,g3[,1:3,]))
 stopifnot(identical(g1,g3[,4:6,]))
 
-data(gompertz)
+pompExample("gompertz")
 p <- parmat(coef(gompertz),5)
 f1 <- partrans(gompertz,p,"inv")
 f2 <- parmat(coef(gompertz,transform=TRUE),5)

Modified: pkg/pomp/tests/dimchecks.Rout.save
===================================================================
--- pkg/pomp/tests/dimchecks.Rout.save	2013-01-09 16:53:21 UTC (rev 800)
+++ pkg/pomp/tests/dimchecks.Rout.save	2013-01-09 20:16:59 UTC (rev 801)
@@ -1,5 +1,5 @@
 
-R version 2.15.0 (2012-03-30)
+R version 2.15.2 (2012-10-26) -- "Trick or Treat"
 Copyright (C) 2012 The R Foundation for Statistical Computing
 ISBN 3-900051-07-0
 Platform: x86_64-unknown-linux-gnu (64-bit)
@@ -23,7 +23,9 @@
 > 
 > set.seed(1420306530L)
 > 
-> data(ricker)
+> pompExample("ricker")
+newly created pomp objects:
+ ricker 
 > po <- ricker
 > 
 > pars <- coef(po)
@@ -151,7 +153,9 @@
 > stopifnot(identical(g1,g3[,1:3,]))
 > stopifnot(identical(g1,g3[,4:6,]))
 > 
-> data(gompertz)
+> pompExample("gompertz")
+newly created pomp objects:
+ gompertz 
 > p <- parmat(coef(gompertz),5)
 > f1 <- partrans(gompertz,p,"inv")
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/pomp -r 801


More information about the pomp-commits mailing list