From noreply at r-forge.r-project.org Thu May 1 14:51:38 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 May 2014 14:51:38 +0200 (CEST) Subject: [Pomp-commits] r943 - in pkg/mif2: . R man Message-ID: <20140501125138.53D6018704E@r-forge.r-project.org> Author: kingaa Date: 2014-05-01 14:51:37 +0200 (Thu, 01 May 2014) New Revision: 943 Removed: pkg/mif2/R/aaa.R pkg/mif2/man/mif2-class.Rd Modified: pkg/mif2/DESCRIPTION pkg/mif2/man/mif2.Rd Log: - require R>=3.0.0 - remove unneeded 'paste0' definition - remove documentation of 'mif2d.pomp' class Modified: pkg/mif2/DESCRIPTION =================================================================== --- pkg/mif2/DESCRIPTION 2014-04-30 13:28:47 UTC (rev 942) +++ pkg/mif2/DESCRIPTION 2014-05-01 12:51:37 UTC (rev 943) @@ -10,8 +10,8 @@ ) URL: http://pomp.r-forge.r-project.org Description: Inference methods for partially-observed Markov processes -Depends: R(>= 2.15.1), pomp(>= 0.49-1), methods +Depends: R(>= 3.0.0), pomp(>= 0.49-1), methods License: GPL(>= 2) LazyData: true BuildVignettes: true -Collate: aaa.R generics.R mif2.R mif2-methods.R +Collate: generics.R mif2.R mif2-methods.R Deleted: pkg/mif2/R/aaa.R =================================================================== --- pkg/mif2/R/aaa.R 2014-04-30 13:28:47 UTC (rev 942) +++ pkg/mif2/R/aaa.R 2014-05-01 12:51:37 UTC (rev 943) @@ -1,3 +0,0 @@ -if (!exists("paste0",where="package:base")) { - paste0 <- function(...) paste(...,sep="") -} Deleted: pkg/mif2/man/mif2-class.Rd =================================================================== --- pkg/mif2/man/mif2-class.Rd 2014-04-30 13:28:47 UTC (rev 942) +++ pkg/mif2/man/mif2-class.Rd 2014-05-01 12:51:37 UTC (rev 943) @@ -1,51 +0,0 @@ -\name{mif2d.pomp-class} -\docType{class} -\alias{mif2d.pomp-class} -\keyword{internal} -\title{The "mif2d.pomp" class} -\description{ - The \code{mif2d.pomp} class holds a fitted model and is created by a call to \code{\link{mif2}}. - See \code{\link{mif2}} for usage. -} -\section{Objects from the Class}{ - Objects can be created by calls to the \code{\link{mif2}} method on a \code{\link{pomp}} or \code{\link[pomp]{pfilterd.pomp-class}} object. - Such a call uses the MIF2 algorithm to fit the model parameters. -} -\section{Slots}{ - A \code{mif2d.pomp} object is derived from a \code{pfilterd.pomp} object and therefore has all the slots of such an object. - The \code{mif2d.pomp} specific slots are described below. - \describe{ - \item{transform}{ - logical scalar; was the estimation done on the transformed scale? - } - \item{Nmif}{ - integer; number of MIF2 iterations that have been completed. - } - \item{perturb.fn}{ - function. - } - \item{conv.rec}{ - The \dQuote{convergence record}: a matrix containing a record of the parameter values, log likelihoods, and other pertinent information, with one row for each MIF2 iteration. - } - \item{pred.mean, pred.var, filter.mean, - eff.sample.size, cond.loglik, saved.states, saved.params, seed, - Np, tol, nfail, loglik, - data, times, t0, rprocess, dprocess, dmeasure, rmeasure, - skeleton.type, skeleton, initializer, states, params, - statenames, paramnames, covarnames, obsnames, tcovar, covar, - PACKAGE, userdata}{ - Inherited from the \code{pfilterd.pomp} class. - } - } -} -\section{Extends}{ - Class \code{pfilterd.pomp}, directly. - See \code{\link{pfilter}}. -} -\section{Methods}{ - See \code{\link{mif2}}, \link{mif2-methods}. -} -\author{Aaron A. King \email{kingaa at umich dot edu}} -\seealso{\code{\link[pomp]{mif}}, \link{mif2-methods}, \code{\link[pomp]{pomp}}, \link[pomp]{pomp-class}} -\keyword{models} -\keyword{ts} Modified: pkg/mif2/man/mif2.Rd =================================================================== --- pkg/mif2/man/mif2.Rd 2014-04-30 13:28:47 UTC (rev 942) +++ pkg/mif2/man/mif2.Rd 2014-05-01 12:51:37 UTC (rev 943) @@ -1,6 +1,7 @@ \name{mif2} \docType{methods} \alias{mif2} +\alias{mif2d.pomp-class} \alias{mif2,mif2d.pomp-method} \alias{mif2-mif2d.pomp} \alias{mif2,pfilterd.pomp-method} From noreply at r-forge.r-project.org Thu May 1 15:44:49 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 May 2014 15:44:49 +0200 (CEST) Subject: [Pomp-commits] r944 - pkg/mif2 Message-ID: <20140501134449.88A1E187034@r-forge.r-project.org> Author: kingaa Date: 2014-05-01 15:44:49 +0200 (Thu, 01 May 2014) New Revision: 944 Modified: pkg/mif2/DESCRIPTION Log: - bump version number Modified: pkg/mif2/DESCRIPTION =================================================================== --- pkg/mif2/DESCRIPTION 2014-05-01 12:51:37 UTC (rev 943) +++ pkg/mif2/DESCRIPTION 2014-05-01 13:44:49 UTC (rev 944) @@ -1,8 +1,8 @@ Package: mif2 Type: Package Title: Statistical inference for partially observed Markov processes -Version: 1.0-2 -Date: 2014-04-30 +Version: 1.0-3 +Date: 2014-05-01 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")), From noreply at r-forge.r-project.org Thu May 1 15:46:28 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 May 2014 15:46:28 +0200 (CEST) Subject: [Pomp-commits] r945 - in pkg/pompExamples: . R inst vignettes Message-ID: <20140501134628.2CB4A187084@r-forge.r-project.org> Author: kingaa Date: 2014-05-01 15:46:27 +0200 (Thu, 01 May 2014) New Revision: 945 Added: pkg/pompExamples/inst/NEWS.Rd Removed: pkg/pompExamples/data/ pkg/pompExamples/inst/ChangeLog pkg/pompExamples/inst/NEWS Modified: pkg/pompExamples/DESCRIPTION pkg/pompExamples/R/pertussis.R pkg/pompExamples/vignettes/budmoth-model.Rnw pkg/pompExamples/vignettes/pertussis-model.Rnw Log: - fix vignettes to work with new structure - fix pertussis models to work with pomp v. 0.50 - remove 'data' directory (finally) Modified: pkg/pompExamples/DESCRIPTION =================================================================== --- pkg/pompExamples/DESCRIPTION 2014-05-01 13:44:49 UTC (rev 944) +++ pkg/pompExamples/DESCRIPTION 2014-05-01 13:46:27 UTC (rev 945) @@ -16,7 +16,7 @@ person(given=c("Helen"),family="Wearing",role=c("ctb"))) URL: http://pomp.r-forge.r-project.org Description: More 'pomp' examples. -Depends: R(>= 3.0.0), stats, graphics, pomp(>= 0.45-4) +Depends: R(>= 3.0.0), stats, graphics, pomp(>= 0.49-1) Suggests: Rmpi,mpifarm,plyr,reshape2,ggplot2,xtable License: GPL (>= 2) LazyData: false Modified: pkg/pompExamples/R/pertussis.R =================================================================== --- pkg/pompExamples/R/pertussis.R 2014-05-01 13:44:49 UTC (rev 944) +++ pkg/pompExamples/R/pertussis.R 2014-05-01 13:46:27 UTC (rev 945) @@ -103,9 +103,10 @@ dmeasure = "negbin_dmeasure", parameter.inv.transform="pertussis_par_untrans", parameter.transform="pertussis_par_trans", - initializer = function (params, t0, statenames, comp.names, ivps, ...) { - states <- numeric(length(statenames)) - names(states) <- statenames + varnames=c("S","E","I","R1","R2","cases","W","err","simpop"), + initializer = function (params, t0, varnames, comp.names, ivps, ...) { + states <- numeric(length(varnames)) + names(states) <- varnames ## translate fractions into initial conditions frac <- params[ivps] states[comp.names] <- round(params['popsize']*frac/sum(frac)) Deleted: pkg/pompExamples/inst/ChangeLog =================================================================== --- pkg/pompExamples/inst/ChangeLog 2014-05-01 13:44:49 UTC (rev 944) +++ pkg/pompExamples/inst/ChangeLog 2014-05-01 13:46:27 UTC (rev 945) @@ -1,102 +0,0 @@ -2012-05-14 kingaa - - * [r723] DESCRIPTION, R, R/version.R: - add 'version' - * [r720] DESCRIPTION, inst/doc/budmoth-model-slices.rda, - inst/doc/budmoth-model-true-loglik.rda, - inst/doc/budmoth-model.pdf, - inst/doc/pertussis-model-true-loglik.rda, - inst/doc/pertussis-model.Rnw, inst/doc/pertussis-model.pdf: - - update vignettes - * [r719] DESCRIPTION, data/pertussis.sim.rda, tests/pertussis.R, - tests/pertussis.Rout.save: - update 'pertussis.sim' - -2012-05-12 kingaa - - * [r718] DESCRIPTION: - * [r717] inst/ChangeLog, inst/data-R/pertussis.sim.R, - src/pertussis.c: - move parameter transformations into C for the - pertussis example - -2012-05-08 kingaa - - * [r712] DESCRIPTION, tests/pertussis.Rout.save: - bring unit tests - up to date - * [r710] DESCRIPTION: - update version number - * [r709] inst/doc/budmoth-model.pdf, inst/doc/pertussis-model.pdf: - - update vignettes - * [r708] data/budmoth.sim.rda, data/pertussis.sim.rda: - update for - compatibility with pomp version 0.42-2 - -2012-04-21 kingaa - - * [r672] inst/ChangeLog: - add ChangeLog - * [r671] DESCRIPTION, data/budmoth.sim.rda, data/pertussis.sim.rda, - inst/NEWS, inst/data-R/budmoth.sim.R, - inst/doc/budmoth-model-slices.rda, - inst/doc/budmoth-model-true-loglik.rda, - inst/doc/pertussis-model-true-loglik.rda, src/budmoth.c, - tests/budmoth.Rout.save: - changed the budmoth model t0 to -1. - The data are changed as well. - -2012-04-18 kingaa - - * [r669] inst/doc/budmoth-model-slices.rda, - inst/doc/budmoth-model-true-loglik.rda, - inst/doc/pertussis-model-true-loglik.rda, src/budmoth.c: - remove - finiteness checks from budmoth model - * [r668] .Rbuildignore, .Rinstignore, data/pertussis.sim.rda, - inst/data-R/budmoth-params.rda, inst/data-R/budmoth.sim.R, - inst/data-R/pertussis-params.rda, inst/data-R/pertussis.sim.R, - inst/doc/budmoth-model-slices.rda, - inst/doc/budmoth-model-true-loglik.rda, - inst/doc/budmoth-model.pdf, - inst/doc/pertussis-model-true-loglik.rda, - inst/doc/pertussis-model.Rnw, inst/doc/pertussis-model.pdf, - src/pertussis.c, tests/pertussis.R, tests/pertussis.Rout.save: - - drop V from pertussis model - - drop finiteness checks in pertussis model - * [r667] .Rinstignore, DESCRIPTION, data/budmoth.sim.rda, - data/pertussis.sim.rda, inst/data-R/budmoth-params.rda, - inst/data-R/budmoth-simdata.rda, inst/data-R/budmoth.sim.R, - inst/data-R/pertussis-params.rda, - inst/data-R/pertussis-simdata.rda, inst/data-R/pertussis.sim.R, - inst/doc/budmoth-model-slices.rda, - inst/doc/budmoth-model-true-loglik.rda, - inst/doc/budmoth-model.Rnw, inst/doc/budmoth-model.pdf, - inst/doc/pertussis-model-true-loglik.rda, - inst/doc/pertussis-model.Rnw, inst/doc/pertussis-model.pdf, - tests/budmoth.Rout.save, tests/pertussis.R, - tests/pertussis.Rout.save: - new datasets - - revert dependence to R>2.14.2 - - add log likelihood calculation to pertussis vignette - - true parameters are included with pomps - -2012-04-17 kingaa - - * [r666] .Rinstignore, DESCRIPTION, NAMESPACE, - data/budmoth.sim.rda, data/pertussis.sim.rda, - inst/data-R/budmoth-params.csv, inst/data-R/budmoth-simdata.rda, - inst/data-R/budmoth.sim.R, inst/data-R/pertussis-params.csv, - inst/data-R/pertussis-simdata.rda, inst/data-R/pertussis.sim.R, - inst/doc/budmoth-model-slices.rda, - inst/doc/budmoth-model-true-loglik.rda, - inst/doc/budmoth-model.Rnw, inst/doc/budmoth-model.pdf, - inst/doc/pertussis-model.Rnw, inst/doc/pertussis-model.pdf, - man/budmoth.Rd, tests/budmoth.R, tests/pertussis.R: - fix loads - of bugs - * [r665] ., .Rbuildignore, .Rinstignore, DESCRIPTION, NAMESPACE, - data, data/budmoth.sim.rda, data/pertussis.sim.rda, inst, - inst/GPL, inst/LICENSE, inst/data-R, inst/data-R/Makefile, - inst/data-R/budmoth-params.csv, inst/data-R/budmoth-simdata.rda, - inst/data-R/budmoth.sim.R, inst/data-R/pertussis-params.csv, - inst/data-R/pertussis-simdata.rda, inst/data-R/pertussis.sim.R, - inst/doc, inst/doc/Makefile, inst/doc/budmoth-model-slices.rda, - inst/doc/budmoth-model-true-loglik.rda, - inst/doc/budmoth-model.Rnw, inst/doc/budmoth-model.pdf, - inst/doc/fullnat.bst, inst/doc/pertussis-model.Rnw, - inst/doc/pertussis-model.pdf, inst/doc/pomp.bib, man, - man/budmoth.Rd, man/pertussis.Rd, src, src/budmoth.c, - src/pertussis.c, tests, tests/budmoth.R, tests/budmoth.Rout.save, - tests/pertussis.R, tests/pertussis.Rout.save: - add pompExamples - package - Deleted: pkg/pompExamples/inst/NEWS =================================================================== --- pkg/pompExamples/inst/NEWS 2014-05-01 13:44:49 UTC (rev 944) +++ pkg/pompExamples/inst/NEWS 2014-05-01 13:46:27 UTC (rev 945) @@ -1,12 +0,0 @@ -NEWS -0.22-1 - o The pomp objects are no longer accessed using 'data'. - Instead, 'pertussis.sim' and 'budmoth.sim' are functions that return the pomp objects. - -0.21-1 - o Changed t0 for the budmoth model from 0 to -1. - The data are different as well. - -0.20-1 - o Ported these examples from 'pomp.devel'. - The data are not identical to those in 'pomp.devel', however. Copied: pkg/pompExamples/inst/NEWS.Rd (from rev 892, pkg/pompExamples/inst/NEWS) =================================================================== --- pkg/pompExamples/inst/NEWS.Rd (rev 0) +++ pkg/pompExamples/inst/NEWS.Rd 2014-05-01 13:46:27 UTC (rev 945) @@ -0,0 +1,25 @@ +\name{NEWS} +\title{News for Package 'pompExamples'} +\section{Changes in \pkg{pompExamples} version 0.23-2}{ + \itemize{ + \item Update for use with \pkg{pomp} version 0.50. + } +} +\section{Changes in \pkg{pompExamples} version 0.22-1}{ + \itemize{ + \item The pomp objects are no longer accessed using \code{data}. + Instead, \code{pertussis.sim} and \code{budmoth.sim} are functions that return the pomp objects. + } +} +\section{Changes in \pkg{pompExamples} version 0.21-1}{ + \itemize{ + \item Changed \code{t0} for the budmoth model from 0 to -1. + The data are different as well. + } +} +\section{Changes in \pkg{pompExamples} version 0.20-1}{ + \itemize{ + \item Ported these examples from \pkg{pomp.devel}. + The data are not identical to those in \pkg{pomp.devel}, however. + } +} Modified: pkg/pompExamples/vignettes/budmoth-model.Rnw =================================================================== --- pkg/pompExamples/vignettes/budmoth-model.Rnw 2014-05-01 13:44:49 UTC (rev 944) +++ pkg/pompExamples/vignettes/budmoth-model.Rnw 2014-05-01 13:46:27 UTC (rev 945) @@ -97,17 +97,27 @@ This model is implemented in the package and can be loaded with the command <<>>= -data(budmoth.sim) + +require(pompExamples) + +budmoth.sim() +bmPomps <- list( + tri=budmoth.sim(tri), + food=budmoth.sim(food), + para1=budmoth.sim(para1), + para2=budmoth.sim(para2) + ) + @ The object thereby loaded contains a named, length-\Sexpr{length(budmoth.sim)} list of pomp objects <<>>= -names(budmoth.sim) +names(bmPomps) @ There are three parameter regimes (``food'', ``para'', and ``tri'' representing a food-quality-dominated, a parasitoid-dominated, and true tritrophic dynamics, respectively). -In total, there are \Sexpr{length(budmoth.sim)} imulated data sets of length \Sexpr{diff(range(time(budmoth.sim[[1]])))+1} years. +In total, there are \Sexpr{length(bmPomps)} imulated data sets of length \Sexpr{diff(range(time(bmPomps[[1]])))+1} years. <>= -for (q in names(budmoth.sim)) { - time(budmoth.sim[[q]]) <- 1:60 +for (q in names(bmPomps)) { + time(bmPomps[[q]]) <- 1:60 } @ The process model is implemented using the \code{euler.simulate} plugin with step function \verb+budmoth_map+ defined in \code{src/budmoth.c} in the package source. @@ -116,11 +126,11 @@ and the likelihood is computed via \verb+budmoth_dmeasure+. Finally, the state process is initialized by <>= -budmoth.sim[[1]]@initializer +bmPomps[[1]]@initializer @ The parameters at which the simulated data are generated can be extracted via <>= -true.pars <- sapply(budmoth.sim[c("food","para1","para2","tri")],coef) +true.pars <- sapply(bmPomps[c("food","para1","para2","tri")],coef) @ and are displayed in Table~\ref{tab:sim-params}. @@ -161,8 +171,13 @@ require(plyr) require(reshape2) require(ggplot2) -data(budmoth.sim) -x <- ldply(budmoth.sim,as.data.frame) +bmPomps <- list( + tri=budmoth.sim(tri), + food=budmoth.sim(food), + para1=budmoth.sim(para1), + para2=budmoth.sim(para2) + ) +x <- ldply(bmPomps,as.data.frame) x <- rename(x,c(.id="dataset")) x <- melt(x,id.var=c("dataset","time")) x <- subset(x,variable%in%c("Qobs","Nobs","Sobs")) @@ -180,9 +195,14 @@ require(mpifarm) require(pompExamples) -data(budmoth.sim) +bmPomps <- list( + tri=budmoth.sim(tri), + food=budmoth.sim(food), + para1=budmoth.sim(para1), + para2=budmoth.sim(para2) + ) -ncpus <- length(budmoth.sim) +ncpus <- length(bmPomps) nrep <- 10 ### number of particle filters to run Np <- 10000 ### number of particles @@ -199,13 +219,13 @@ dlply( expand.grid( seed=seeds, - dataset=names(budmoth.sim) + dataset=names(bmPomps) ), ~dataset+seed ) }, common=list( - pomps=budmoth.sim, + pomps=bmPomps, Np=Np ), main={ @@ -303,16 +323,21 @@ Np <- 1000 ### number of particles per filter slice.length <- 100 ### number of points per slice -data(budmoth.sim) +bmPomps <- list( + tri=budmoth.sim(tri), + food=budmoth.sim(food), + para1=budmoth.sim(para1), + para2=budmoth.sim(para2) + ) -true.pars <- sapply(budmoth.sim,coef) +true.pars <- sapply(bmPomps,coef) estnames <- c("gam","lambda","g","delta","a","w") par.range <- t(apply(true.pars[estnames,],1,function(x)c(0.5*min(x),1.5*max(x)))) ncpus <- as.integer(Sys.getenv("PBS_NP")) slices <- lapply( - budmoth.sim, + bmPomps, function (po) { center <- coef(po) ranges <- lapply( @@ -347,7 +372,7 @@ for (j in seq_len(nrow(slices))) { ds <- slices$dataset[j] sl <- slices$slice[j] - paramnames <- names(coef(budmoth.sim[[ds]])) + paramnames <- names(coef(bmPomps[[ds]])) for (k in seq_len(nrep)) { s <- s+1 joblist[[s]] <- list( @@ -361,7 +386,7 @@ joblist }, common=list( - pomps=budmoth.sim, + pomps=bmPomps, Np=Np, estnames=estnames ), Modified: pkg/pompExamples/vignettes/pertussis-model.Rnw =================================================================== --- pkg/pompExamples/vignettes/pertussis-model.Rnw 2014-05-01 13:44:49 UTC (rev 944) +++ pkg/pompExamples/vignettes/pertussis-model.Rnw 2014-05-01 13:46:27 UTC (rev 945) @@ -280,11 +280,21 @@ The model above is implemented in the package and can be loaded with the command <<>>= -data(pertussis.sim) +pertussis.sim() +pertPomps <- list( + SEIR.small=pertussis.sim(SEIR.small), + SEIR.big=pertussis.sim(SEIR.big), + SEIRS.small=pertussis.sim(SEIRS.small), + SEIRS.big=pertussis.sim(SEIRS.big), + SEIRR.small=pertussis.sim(SEIRR.small), + SEIRR.big=pertussis.sim(SEIRR.big), + full.small=pertussis.sim(full.small), + full.big=pertussis.sim(full.big) + ) @ -The object thereby loaded contains a named length-\Sexpr{length(pertussis.sim)} list of pomp objects: +The object thereby loaded contains a named length-\Sexpr{length(pertPomps)} list of pomp objects: <<>>= -names(pertussis.sim) +names(pertPomps) @ There are three submodels (SEIR, SEIRS, SEIRR), representing a model with permanent immunity (SEIR), temporary immunity (SEIRS), and temporary immunity with boosting (SEIRR). The model labeled \code{full} is SEIRR but with polarizing immunity ($\phi>0$) and environmental stochasticity $\sigma_{\zeta}>0$. @@ -296,8 +306,17 @@ <>= require(pompExamples) require(plyr) -data(pertussis.sim) -true.pars <- sapply(pertussis.sim,coef) +pertPomps <- list( + SEIR.small=pertussis.sim(SEIR.small), + SEIR.big=pertussis.sim(SEIR.big), + SEIRS.small=pertussis.sim(SEIRS.small), + SEIRS.big=pertussis.sim(SEIRS.big), + SEIRR.small=pertussis.sim(SEIRR.small), + SEIRR.big=pertussis.sim(SEIRR.big), + full.small=pertussis.sim(full.small), + full.big=pertussis.sim(full.big) + ) +true.pars <- sapply(pertPomps,coef) params <- as.data.frame(true.pars) params$name <- rownames(params) params$math <- "" @@ -372,8 +391,17 @@ require(plyr) require(reshape2) require(pompExamples) -data(pertussis.sim) -x <- ldply(pertussis.sim,as.data.frame) +pertPomps <- list( + SEIR.small=pertussis.sim(SEIR.small), + SEIR.big=pertussis.sim(SEIR.big), + SEIRS.small=pertussis.sim(SEIRS.small), + SEIRS.big=pertussis.sim(SEIRS.big), + SEIRR.small=pertussis.sim(SEIRR.small), + SEIRR.big=pertussis.sim(SEIRR.big), + full.small=pertussis.sim(full.small), + full.big=pertussis.sim(full.big) + ) +x <- ldply(pertPomps,as.data.frame) x <- rename(x,c(.id="dataset")) x <- melt(x,id.var=c("dataset","time")) x <- subset(x,variable=="reports") @@ -405,7 +433,16 @@ require(mpifarm) require(pompExamples) -data(pertussis.sim) +pertPomps <- list( + SEIR.small=pertussis.sim(SEIR.small), + SEIR.big=pertussis.sim(SEIR.big), + SEIRS.small=pertussis.sim(SEIRS.small), + SEIRS.big=pertussis.sim(SEIRS.big), + SEIRR.small=pertussis.sim(SEIRR.small), + SEIRR.big=pertussis.sim(SEIRR.big), + full.small=pertussis.sim(full.small), + full.big=pertussis.sim(full.big) + ) ncpus <- as.integer(Sys.getenv("PBS_NP")) @@ -424,13 +461,13 @@ dlply( expand.grid( seed=seeds, - dataset=names(pertussis.sim) + dataset=names(pertPomps) ), ~dataset+seed ) }, common=list( - pomps=pertussis.sim, + pomps=pertPomps, Np=Np ), main={ @@ -590,8 +627,17 @@ <>= require(pompExamples) require(Rwave) -data(pertussis.sim) -x <- lapply(pertussis.sim,as,"data.frame") +pertPomps <- list( + SEIR.small=pertussis.sim(SEIR.small), + SEIR.big=pertussis.sim(SEIR.big), + SEIRS.small=pertussis.sim(SEIRS.small), + SEIRS.big=pertussis.sim(SEIRS.big), + SEIRR.small=pertussis.sim(SEIRR.small), + SEIRR.big=pertussis.sim(SEIRR.big), + full.small=pertussis.sim(full.small), + full.big=pertussis.sim(full.big) + ) +x <- lapply(pertPomps,as,"data.frame") x <- lapply(x,function(x)x[c("time","reports")]) for (n in names(x)) names(x[[n]])[2] <- n From noreply at r-forge.r-project.org Thu May 1 15:47:45 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 May 2014 15:47:45 +0200 (CEST) Subject: [Pomp-commits] r946 - pkg/pompExamples/inst Message-ID: <20140501134745.A837D1872AC@r-forge.r-project.org> Author: kingaa Date: 2014-05-01 15:47:45 +0200 (Thu, 01 May 2014) New Revision: 946 Added: pkg/pompExamples/inst/NEWS Log: Added: pkg/pompExamples/inst/NEWS =================================================================== --- pkg/pompExamples/inst/NEWS (rev 0) +++ pkg/pompExamples/inst/NEWS 2014-05-01 13:47:45 UTC (rev 946) @@ -0,0 +1,22 @@ +_N_e_w_s _f_o_r _P_a_c_k_a_g_e '_p_o_m_p_E_x_a_m_p_l_e_s' + +_C_h_a_n_g_e_s _i_n '_p_o_m_p_E_x_a_m_p_l_e_s' _v_e_r_s_i_o_n _0._2_3-_2: + + ? Update for use with ?pomp? version 0.50. + +_C_h_a_n_g_e_s _i_n '_p_o_m_p_E_x_a_m_p_l_e_s' _v_e_r_s_i_o_n _0._2_2-_1: + + ? The pomp objects are no longer accessed using ?data?. + Instead, ?pertussis.sim? and ?budmoth.sim? are functions that + return the pomp objects. + +_C_h_a_n_g_e_s _i_n '_p_o_m_p_E_x_a_m_p_l_e_s' _v_e_r_s_i_o_n _0._2_1-_1: + + ? Changed ?t0? for the budmoth model from 0 to -1. The data + are different as well. + +_C_h_a_n_g_e_s _i_n '_p_o_m_p_E_x_a_m_p_l_e_s' _v_e_r_s_i_o_n _0._2_0-_1: + + ? Ported these examples from ?pomp.devel?. The data are not + identical to those in ?pomp.devel?, however. + From noreply at r-forge.r-project.org Wed May 7 15:56:28 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 7 May 2014 15:56:28 +0200 (CEST) Subject: [Pomp-commits] r947 - in pkg/pomp: . man Message-ID: <20140507135628.2AB06187838@r-forge.r-project.org> Author: kingaa Date: 2014-05-07 15:56:27 +0200 (Wed, 07 May 2014) New Revision: 947 Modified: pkg/pomp/DESCRIPTION pkg/pomp/man/plugins.Rd pkg/pomp/man/pomp.Rd Log: - documentation fixes Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-05-01 13:47:45 UTC (rev 946) +++ pkg/pomp/DESCRIPTION 2014-05-07 13:56:27 UTC (rev 947) @@ -1,8 +1,8 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.50-3 -Date: 2014-04-30 +Version: 0.50-4 +Date: 2014-05-07 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/man/plugins.Rd =================================================================== --- pkg/pomp/man/plugins.Rd 2014-05-01 13:47:45 UTC (rev 946) +++ pkg/pomp/man/plugins.Rd 2014-05-07 13:56:27 UTC (rev 947) @@ -19,21 +19,28 @@ } \arguments{ \item{step.fun}{ - This can be either an \R function or the name of a compiled, dynamically loaded native function containing the model simulator. + This can be either an \R function, a \code{\link{Csnippet}}, or the name of a compiled, dynamically loaded native function containing the model simulator. It should be written to take a single Euler step from a single point in state space. - If it is an \R function, it should be of the form \code{step.fun(x,t,params,delta.t,...)}. + + If it is an \R function, it should have prototype \code{step.fun(x,t,params,delta.t,...)}. Here, \code{x} is a named numeric vector containing the value of the state process at time \code{t}, \code{params} is a named numeric vector containing parameters, and \code{delta.t} is the length of the Euler time-step. + + For examples on the use of \code{\link{Csnippet}} to write fast simulators easily, see the \dQuote{Introduction to \pkg{pomp}} document, included with the package. + If \code{step.fun} is the name of a native function, it must be of type \dQuote{pomp_onestep_sim} as defined in the header \dQuote{pomp.h}, which is included with the \pkg{pomp} package. For details on how to write such codes, see Details. } \item{rate.fun}{ - This can be either an \R function or the name of a compiled, dynamically loaded native function that computes the transition rates. + This can be either an \R function, a \code{\link{Csnippet}}, or the name of a compiled, dynamically loaded native function that computes the transition rates. If it is an \R function, it should be of the form \code{rate.fun(j,x,t,params,...)}. Here, \code{j} is the number of the event, \code{x} is a named numeric vector containing the value of the state process at time \code{t} and \code{params} is a named numeric vector containing parameters. + + For examples on the use of \code{\link{Csnippet}} to write fast simulators easily, see the \dQuote{Introduction to \pkg{pomp}} document, included with the package. + If \code{rate.fun} is a native function, it must be of type \dQuote{pomp_ssa_rate_fn} as defined in the header \dQuote{pomp.h}, which is included with the package. For details on how to write such codes, see Details. } @@ -46,10 +53,12 @@ \code{d[i,j]} will have value 1 if event rate \code{j} must be updated as a result of a change in state variable \code{i} and 0 otherwise } \item{dens.fun}{ - This can be either an R function or a compiled, dynamically loaded native function containing the model transition log probability density function. + This can be either an R function, a \code{\link{Csnippet}}, or a compiled, dynamically loaded native function containing the model transition log probability density function. + If it is an R function, it should be of the form \code{dens.fun(x1,x2,t1,t2,params,...)}. Here, \code{x1} and \code{x2} are named numeric vectors containing the values of the state process at times \code{t1} and \code{t2}, \code{params} is a named numeric vector containing parameters. + If \code{dens.fun} is the name of a native function, it should be of type \dQuote{pomp_onestep_pdf} as defined in the header \dQuote{pomp.h}, which is included with the \pkg{pomp} package. This function should return the log likelihood of a transition from \code{x1} at time \code{t1} to \code{x2} at time \code{t2}, assuming that no intervening transitions have occurred. For details on how to write such codes, see Details. @@ -60,6 +69,7 @@ \item{PACKAGE}{ an optional argument that specifies to which dynamically loaded library we restrict the search for the native routines. If this is \dQuote{base}, we search in the R executable itself. + This argument is ignored if \code{step.fun}, \code{rate.fn}, or \code{dens.fun} is provided as an \R function or a \code{\link{Csnippet}}. } } \details{ Modified: pkg/pomp/man/pomp.Rd =================================================================== --- pkg/pomp/man/pomp.Rd 2014-05-01 13:47:45 UTC (rev 946) +++ pkg/pomp/man/pomp.Rd 2014-05-07 13:56:27 UTC (rev 947) @@ -58,31 +58,33 @@ This must be no later than the time of the first observation, i.e., \code{t0 <= times[1]}. } \item{rprocess}{ - optional function; a function of prototype \code{rprocess(xstart,times,params,\dots)} that simulates from the unobserved process. + optional function; a function of prototype \preformatted{rprocess(xstart,times,params,\dots)} that simulates from the unobserved process. The easiest way to specify \code{rprocess} is to use one of the \code{\link{plugins}} provided as part of the \pkg{pomp} package. See below for details. } \item{dprocess}{ - optional function; a function of prototype \code{dprocess(x,times,params,log,\dots)} that evaluates the likelihood of a sequence of consecutive state transitions. + optional function; a function of prototype \preformatted{dprocess(x,times,params,log,\dots)} that evaluates the likelihood of a sequence of consecutive state transitions. The easiest way to specify \code{dprocess} is to use one of the \code{\link{plugins}} provided as part of the \pkg{pomp} package. It is not typically necessary (or even feasible) to define \code{dprocess}. See below for details. } \item{rmeasure}{ optional; the measurement model simulator. - This can be specified in one of three ways: - (1) as a function of prototype \code{rmeasure(x,t,params,\dots)} that makes a draw from the observation process given states \code{x}, time \code{t}, and parameters \code{params}. - (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_measure_model_simulator} as defined in the header file \dQuote{pomp.h}. + This can be specified in one of four ways: + (1) as a function of prototype \preformatted{rmeasure(x,t,params,\dots)} that makes a draw from the observation process given states \code{x}, time \code{t}, and parameters \code{params}. + (2) as a snippet of C code (via \code{\link{Csnippet}}) that draws from the observation process as above. + (3) as the name of a native (compiled) routine with prototype \dQuote{pomp_measure_model_simulator} as defined in the header file \dQuote{pomp.h}. In the above cases, if the measurement model depends on covariates, the optional argument \code{covars} will be filled with interpolated values at each call. - (3) using the formula-based \code{measurement.model} facility (see below). + (4) using the formula-based \code{measurement.model} facility (see below). } \item{dmeasure}{ optional; the measurement model probability density function. - This can be specified in one of three ways: - (1) as a function of prototype \code{dmeasure(y,x,t,params,log,\dots)} that computes the p.d.f. of \code{y} given \code{x}, \code{t}, and \code{params}. - (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_measure_model_density} as defined in the header file \dQuote{pomp.h}. + This can be specified in one of four ways: + (1) as a function of prototype \preformatted{dmeasure(y,x,t,params,log,\dots)} that computes the p.d.f. of \code{y} given \code{x}, \code{t}, and \code{params}. + (2) as a snippet of C code (via \code{\link{Csnippet}}) that computes the p.d.f. as above. + (3) as the name of a native (compiled) routine with prototype \dQuote{pomp_measure_model_density} as defined in the header file \dQuote{pomp.h}. In the above cases, if the measurement model depends on covariates, the optional argument \code{covars} will be filled with interpolated values at each call. - (3) using the formula-based \code{measurement.model} facility (see below). + (4) using the formula-based \code{measurement.model} facility (see below). As might be expected, if \code{log=TRUE}, this function should return the log likelihood. } \item{measurement.model}{ @@ -100,16 +102,17 @@ If we are dealing with a continuous-time Markov process, its deterministic skeleton is a vectorfield: indicate this by specifying \code{skeleton.type="vectorfield"}. - The skeleton function can be specified in one of two ways: - (1) as an \R function of prototype \code{skeleton(x,t,params,\dots)} that evaluates the deterministic skeleton at state \code{x} and time \code{t} given the parameters \code{params}, or - (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_skeleton} as defined in the header file \dQuote{pomp.h}. + The skeleton function can be specified in one of three ways: + (1) as an \R function of prototype \preformatted{skeleton(x,t,params,\dots)} that evaluates the deterministic skeleton at state \code{x} and time \code{t} given the parameters \code{params}, or + (2) as a snippet of C code (via \code{\link{Csnippet}}) that performs this evaluation. + (3) as the name of a native (compiled) routine with prototype \dQuote{pomp_skeleton} as defined in the header file \dQuote{pomp.h}. If the deterministic skeleton depends on covariates, the optional argument \code{covars} will be filled with interpolated values of the covariates at the time \code{t}. With a discrete-time skeleton, the default assumption is that time advances 1 unit per iteration of the map; to change this, set \code{skelmap.delta.t} to the appropriate time-step. } \item{initializer}{ - optional function of prototype \code{initializer(params,t0,\dots)} that yields initial conditions for the state process when given a vector, \code{params}, of parameters. + optional function of prototype \preformatted{initializer(params,t0,\dots)} that yields initial conditions for the state process when given a vector, \code{params}, of parameters. By default (i.e., if it is unspecified when \code{pomp} is called), the initializer assumes any parameters in \code{params} the names of which end in \dQuote{\code{.0}} are initial values. These are simply copied over as initial conditions when \code{init.state} is called (see \code{\link{init.state-pomp}}). @@ -117,15 +120,17 @@ } \item{rprior}{ optional; function drawing a sample from a prior distribution on parameters. - This can be specified in one of two ways: - (1) as an \R function of prototype \code{rprior(params,\dots)}, - (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_rprior} as defined in the header file \dQuote{pomp.h}. + This can be specified in one of three ways: + (1) as an \R function of prototype \preformatted{rprior(params,\dots)} that makes a draw from the prior distribution given \code{params}, + (2) as a snippet of C code (via \code{\link{Csnippet}}) that draws from the prior, + (3) as the name of a native (compiled) routine with prototype \dQuote{pomp_rprior} as defined in the header file \dQuote{pomp.h}. } \item{dprior}{ optional; function evaluating the prior distribution. - This can be specified in one of two ways: - (1) as an \R function of prototype \code{dprior(params,log=FALSE,\dots)}, - (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_dprior} as defined in the header file \dQuote{pomp.h}. + This can be specified in one of three ways: + (1) as an \R function of prototype \preformatted{dprior(params,log=FALSE,\dots)} that evaluates the prior probability density, + (2) as a snippet of C code (via \code{\link{Csnippet}}) that computes this p.d.f., + (3) as the name of a native (compiled) routine with prototype \dQuote{pomp_dprior} as defined in the header file \dQuote{pomp.h}. } \item{params}{ optional named numeric vector of parameters. @@ -145,8 +150,8 @@ } \item{obsnames, statenames, paramnames, covarnames}{ Optional character vectors specifying the names of observables, state variables, parameters, and covariates, respectively. - These are only used in the event that one or more of the basic functions (\code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}, \code{rprior}, \code{dprior}) are defined using native routines. - In that case, these name vectors are matched against the corresponding names and the indices of the names are passed to the native routines. + These are only used in the event that one or more of the basic functions (\code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}, \code{rprior}, \code{dprior}) are defined using \code{\link{Csnippet}} or native routines. + In these cases, these name vectors are matched against the corresponding names and the indices of the names are passed to the native routines. These vectors should list the parameters in the order that the native code expects them. Using this facility allows one to write one or more of the basic functions in native code in a way that does not depend on the order of states, parameters, and covariates at run time. See the \dQuote{Advanced topics in pomp} vignette for more on this topic, including examples. @@ -163,6 +168,7 @@ These functions must have arguments \code{params} and \code{\dots}. \code{parameter.transform} should transform parameters from the user's scale to the scale that \code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}, and \code{initializer} will use internally. \code{parameter.inv.transform} should be the inverse of \code{parameter.transform}. + The parameter transformations can be defined (as in the case of \code{rmeasure}, \code{dmeasure}, \code{skeleton}, \code{rprior}, \code{dprior} above) using \R functions, \code{\link{Csnippet}}s, or native routines. Note that it is the user's responsibility to make sure this holds. If \code{obj} is the constructed \code{pomp} object, and \code{coef(obj)} is non-empty, a simple check of this is @@ -179,7 +185,7 @@ } \item{globals}{ optional character; - C code that will be included in the source for the shared-object library created when the call to \code{pomp} uses \code{Csnippets}. + C code that will be included in the source for (and therefore hard-coded into) the shared-object library created when the call to \code{pomp} uses \code{Csnippets}. If no \code{Csnippets} are used, \code{globals} has no effect. } \item{\dots}{ From noreply at r-forge.r-project.org Wed May 7 16:01:12 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 7 May 2014 16:01:12 +0200 (CEST) Subject: [Pomp-commits] r948 - pkg/pomp/inst/doc Message-ID: <20140507140112.A7DF1187862@r-forge.r-project.org> Author: kingaa Date: 2014-05-07 16:01:12 +0200 (Wed, 07 May 2014) New Revision: 948 Modified: pkg/pomp/inst/doc/manual.pdf Log: update manual Modified: pkg/pomp/inst/doc/manual.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Tue May 13 14:31:28 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 13 May 2014 14:31:28 +0200 (CEST) Subject: [Pomp-commits] r949 - in pkg/pomp: . inst/doc Message-ID: <20140513123128.DE6E2186DF6@r-forge.r-project.org> Author: kingaa Date: 2014-05-13 14:31:28 +0200 (Tue, 13 May 2014) New Revision: 949 Modified: pkg/pomp/DESCRIPTION pkg/pomp/inst/doc/manual.pdf Log: small-kind Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-05-07 14:01:12 UTC (rev 948) +++ pkg/pomp/DESCRIPTION 2014-05-13 12:31:28 UTC (rev 949) @@ -1,8 +1,8 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.50-4 -Date: 2014-05-07 +Version: 0.50-5 +Date: 2014-05-13 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/inst/doc/manual.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Fri May 16 18:39:56 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 16 May 2014 18:39:56 +0200 (CEST) Subject: [Pomp-commits] r950 - in pkg/pomp: . R inst inst/doc man Message-ID: <20140516163957.01A4F180870@r-forge.r-project.org> Author: kingaa Date: 2014-05-16 18:39:56 +0200 (Fri, 16 May 2014) New Revision: 950 Removed: pkg/pomp/inst/doc/advanced_topics_in_pomp.pdf pkg/pomp/inst/doc/intro_to_pomp.pdf pkg/pomp/inst/doc/manual.pdf Modified: pkg/pomp/DESCRIPTION pkg/pomp/R/builder.R pkg/pomp/inst/NEWS pkg/pomp/inst/NEWS.Rd pkg/pomp/inst/doc/index.html pkg/pomp/man/basic-probes.Rd pkg/pomp/man/blowflies.Rd pkg/pomp/man/bsmc.Rd pkg/pomp/man/builder.Rd pkg/pomp/man/mif-methods.Rd pkg/pomp/man/mif.Rd pkg/pomp/man/nlf.Rd pkg/pomp/man/pfilter.Rd pkg/pomp/man/pmcmc.Rd pkg/pomp/man/pomp-package.Rd pkg/pomp/man/pomp.Rd pkg/pomp/man/prior-pomp.Rd pkg/pomp/man/ricker.Rd pkg/pomp/man/rw2.Rd pkg/pomp/man/sannbox.Rd pkg/pomp/man/simulate-pomp.Rd Log: - much editing of the help pages - remove tutorials and manuals from inst/doc, replace with links to pomp website - fix bug in 'pompCBuilder'. Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/DESCRIPTION 2014-05-16 16:39:56 UTC (rev 950) @@ -1,8 +1,8 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.50-5 -Date: 2014-05-13 +Version: 0.50-6 +Date: 2014-05-16 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/builder.R =================================================================== --- pkg/pomp/R/builder.R 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/R/builder.R 2014-05-16 16:39:56 UTC (rev 950) @@ -133,7 +133,8 @@ parameter.transform="\n}\n\n", parameter.inv.transform="\n}\n\n", rprior="\n}\n\n", - dprior="\n}\n\n" + dprior="\n}\n\n", + globals="\n" ) utility.fns <- list() @@ -192,7 +193,7 @@ cat(file=out,f) } - cat(file=out,globals) + cat(file=out,globals,footer$globals) ## variable/parameter/observations definitions for (v in seq_along(paramnames)) { Modified: pkg/pomp/inst/NEWS =================================================================== --- pkg/pomp/inst/NEWS 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/inst/NEWS 2014-05-16 16:39:56 UTC (rev 950) @@ -1,5 +1,14 @@ _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-_6: + + ? The package manual and tutorials are no longer included with + the package source. Instead, links are provided to the + ?pomp? website. + + ? The package help pages have been revisited for accuracy and + completeness. + _C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._5_0-_1: ? ?pomp? can now take snippets of C code directly as Modified: pkg/pomp/inst/NEWS.Rd =================================================================== --- pkg/pomp/inst/NEWS.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/inst/NEWS.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -1,5 +1,12 @@ \name{NEWS} \title{News for package `pomp'} +\section{Changes in \pkg{pomp} version 0.50-6}{ + \itemize{ + \item The package manual and tutorials are no longer included with the package source. + Instead, links are provided to the \pkg{pomp} website. + \item The package help pages have been revisited for accuracy and completeness. + } +} \section{Changes in \pkg{pomp} version 0.50-1}{ \itemize{ \item \code{pomp} can now take snippets of C code directly as definitions of the various basic functions. Deleted: pkg/pomp/inst/doc/advanced_topics_in_pomp.pdf =================================================================== (Binary files differ) Modified: pkg/pomp/inst/doc/index.html =================================================================== --- pkg/pomp/inst/doc/index.html 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/inst/doc/index.html 2014-05-16 16:39:56 UTC (rev 950) @@ -1,21 +1,29 @@ -pomp user guides and other documentation +pomp user guides and tutorials

pomp user guides and other documentation

-
-
intro_to_pomp.pdf:
-
Introduction to pomp
-
advanced_topics_in_pomp.pdf:
-
Advanced topics in pomp
-
manual.pdf:
-
pomp user manual
-
+ + + + + + + + + + + + + + + +
Introduction to pomp(PDF)(R code)
Advanced topics in pomp(PDF)(R code)
pomp package manual(PDF)
+

Back to pomp package index

Deleted: pkg/pomp/inst/doc/intro_to_pomp.pdf =================================================================== (Binary files differ) Deleted: pkg/pomp/inst/doc/manual.pdf =================================================================== (Binary files differ) Modified: pkg/pomp/man/basic-probes.Rd =================================================================== --- pkg/pomp/man/basic-probes.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/basic-probes.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -138,8 +138,7 @@ Aaron A. King (kingaa at umich dot edu) } \seealso{ - \link{pomp-class}, - \link{pomp-methods} + \link{pomp} } \keyword{models} \keyword{ts} Modified: pkg/pomp/man/blowflies.Rd =================================================================== --- pkg/pomp/man/blowflies.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/blowflies.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -37,7 +37,7 @@ to view the code that constructs these pomp objects. } -\seealso{\code{\link{pomp-class}} and the vignettes} +\seealso{\code{\link{pomp}}} \references{ A. J. Nicholson (1957) The self-adjustment of populations to change. Modified: pkg/pomp/man/bsmc.Rd =================================================================== --- pkg/pomp/man/bsmc.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/bsmc.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -107,14 +107,21 @@ There are two ways to specify the prior distribution of particles. If \code{params} is unspecified or is a named vector, \code{Np} draws are made from the prior distribution, as specified by \code{\link{rprior}}. Alternatively, \code{params} can be specified as an \code{npars} x \code{Np} matrix (with rownames). - } +} \author{ Michael Lavine (lavine at math dot umass dot edu), Matthew Ferrari (mferrari at psu dot edu), Aaron A. King } +\references{ + Liu, J. and M. West. + Combining Parameter and State Estimation in Simulation-Based Filtering. + In A. Doucet, N. de Freitas, and N. J. Gordon, editors, + Sequential Monte Carlo Methods in Practice, pages 197-224. + Springer, New York, 2001. +} \examples{ -## See the vignettes for examples. +## See the "Introducton to pomp" document for examples. } \seealso{\link{pomp-class}} \keyword{ts} Modified: pkg/pomp/man/builder.Rd =================================================================== --- pkg/pomp/man/builder.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/builder.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -2,7 +2,7 @@ \alias{pompBuilder} \title{Write, compile, link, and build a pomp object using native codes} \description{ - \code{pompBuilder} is an EXPERIMENTAL facility for producing compiled \code{pomp} objects. + \code{pompBuilder} is a facility for producing compiled \code{pomp} objects. } \usage{ pompBuilder(data, times, t0, name, statenames, paramnames, Modified: pkg/pomp/man/mif-methods.Rd =================================================================== --- pkg/pomp/man/mif-methods.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/mif-methods.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -51,6 +51,6 @@ } } \author{Aaron A. King \email{kingaa at umich dot edu}} -\seealso{\code{\link{mif}}, \code{\link{pomp}}, \code{\link{pomp-class}}, \code{\link{pfilter}}} +\seealso{\code{\link{mif}}, \code{\link{pomp}}, \code{\link{pfilter}}} \keyword{models} \keyword{ts} Modified: pkg/pomp/man/mif.Rd =================================================================== --- pkg/pomp/man/mif.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/mif.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -11,9 +11,9 @@ \alias{continue,mif-method} \alias{continue-mif} \alias{mif-class} -\title{The MIF algorithm} +\title{Iterated filtering} \description{ - The MIF algorithm for estimating the parameters of a partially-observed Markov process. + Iterated filtering algorithms for estimating the parameters of a partially-observed Markov process. } \usage{ mif(object, \dots) @@ -35,7 +35,7 @@ An object of class \code{pomp}. } \item{Nmif}{ - The number of MIF iterations to perform. + The number of filtering iterations to perform. } \item{start}{ named numerical vector; @@ -82,7 +82,7 @@ The \code{mif} update for initial-value parameters consists of replacing them by their filtering mean at time \code{times[ic.lag]}, where \code{times=time(object)}. It makes no sense to set \code{ic.lag>length(times)}; if it is so set, \code{ic.lag} is set to \code{length(times)} with a warning. - For \code{method='mif2'}, the default is \code{ic.lag=length(times)}. + For \code{method="mif2"}, the default is \code{ic.lag=length(times)}. } \item{var.factor}{ a positive number; @@ -103,7 +103,7 @@ \code{method="mif"} uses the iterated filtering update rule (Ionides 2006, 2011); \code{method="unweighted"} updates the parameter to the unweighted average of the filtering means of the parameters at each time; \code{method="fp"} updates the parameter to the filtering mean at the end of the time series. - \code{method="mif2"} [EXPLAIN] +% \code{method="mif2"} } \item{tol}{ See the description under \code{\link{pfilter}}. @@ -149,7 +149,7 @@ \code{Np} may be assumed to be a positive integer; \code{center} and \code{sd} will be named vectors of the same length. Additional arguments may be specified; - these will be filled with the elements of the \code{userdata} slot of the underlying \code{pomp} object (see \code{\link{pomp-class}}). + these will be filled with the elements of the \code{userdata} slot of the underlying \code{pomp} object (see \code{\link{pomp}}). \code{particles} returns a \code{length(center)} x \code{Np} matrix with rownames matching the names of \code{center} and \code{sd}. Each column represents a distinct particle. @@ -173,7 +173,7 @@ } \author{Aaron A. King \email{kingaa at umich dot edu}} \seealso{ - \code{\link{mif-methods}}, \code{\link{pomp}}, \code{\link{pomp-class}}, \code{\link{pfilter}}. + \code{\link{mif-methods}}, \code{\link{pomp}}, \code{\link{pfilter}}. See the \dQuote{intro_to_pomp} vignette for examples. } \keyword{ts} Modified: pkg/pomp/man/nlf.Rd =================================================================== --- pkg/pomp/man/nlf.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/nlf.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -110,12 +110,10 @@ Kendall, B. E., Briggs, C. J., Murdoch, W. W., Turchin, P., Ellner, S. P., McCauley, E., Nisbet, R. M. and Wood S. N. (1999) Why do populations cycle? A synthesis of statistical and mechanistic modeling approaches. \emph{Ecology} \bold{80}, 1789--1805. - Available online at \url{http://www2.bren.ucsb.edu/~kendall/pubs/1999Ecology.pdf} Kendall, B. E., Ellner, S. P., McCauley, E., Wood, S. N., Briggs, C. J., Murdoch, W. W. and Turchin, P. (2005) Population cycles in the pine looper moth (\emph{Bupalus piniarius}): dynamical tests of mechanistic hypotheses. \emph{Ecological Monographs} \bold{75}, 259--276. - Available online at \url{http://repositories.cdlib.org/postprints/818/} } \author{Stephen P. Ellner \email{spe2 at cornell dot edu} and Bruce E. Kendall \email{kendall at bren dot ucsb dot edu}} \keyword{models} Modified: pkg/pomp/man/pfilter.Rd =================================================================== --- pkg/pomp/man/pfilter.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/pfilter.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -133,6 +133,6 @@ IEEE Trans. Sig. Proc. 50:174--188, 2002. } \author{Aaron A. King \email{kingaa at umich dot edu}} -\seealso{\link{pomp-class}} +\seealso{\code{\link{pomp}}, \code{\link{mif}}, \code{\link{pmcmc}}, \code{\link{bsmc}}} \keyword{models} \keyword{ts} Modified: pkg/pomp/man/pmcmc.Rd =================================================================== --- pkg/pomp/man/pmcmc.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/pmcmc.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -73,18 +73,6 @@ } \value{ An object of class \code{pmcmc}. - This class inherits from class \code{\link[=pfilterd.pomp-class]{pfilterd.pomp}} and contains the following additional slots: - \describe{ - \item{pars, Nmcmc, dprior, hyperparams}{ - These slots hold the values of the corresponding arguments of the call to \code{pmcmc}. - } - \item{random.walk.sd}{ - a named numeric vector containing the random-walk variances used to parameterize a Gaussian random walk MCMC proposal. - } - \item{log.prior}{ - a numeric value containing the log of the prior density evaluated at the parameter vector in the params slot. - } - } } \section{Re-running PMCMC Iterations}{ To re-run a sequence of PMCMC iterations, one can use the \code{pmcmc} method on a \code{pmcmc} object. @@ -100,7 +88,7 @@ \section{Details}{ \code{pmcmc} implements an MCMC algorithm in which the true likelihood of the data is replaced by an unbiased estimate computed by a particle filter. This gives an asymptotically correct Bayesian procedure for parameter estimation (Andrieu and Roberts, 2009). - An extension to give a correct Bayesian posterior distribution of unobserved state variables (Andrieu et al, 2010) has not yet been implemented. + An extension to give a correct Bayesian posterior distribution of unobserved state variables (as in Andrieu et al, 2010) has not yet been implemented. } \references{ C. Andrieu, A. Doucet and R. Holenstein, Modified: pkg/pomp/man/pomp-package.Rd =================================================================== --- pkg/pomp/man/pomp-package.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/pomp-package.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -3,43 +3,47 @@ \alias{pomp-package} \title{Partially-observed Markov processes} \description{ -%% This is documentation for version \Sexpr[echo=F,stage=install,results=text]{packageDescription("pomp",fields="Version")} of \pkg{pomp}. - The \pkg{pomp} package provides facilities for inference on time series data using partially-observed Markov processes (AKA state-space models or nonlinear stochastic dynamical systems). One can use \pkg{pomp} to fit nonlinear, non-Gaussian dynamic models to time-series data. The first step in using \pkg{pomp} is to encode one's model and data in an object of class \code{pomp}. One does this via a call to \code{\link{pomp}}, which involves specifying the process and measurement components of the model in one or more of a variety of ways. - Details on this are given in the documentation for the \code{\link{pomp}} function and examples are given in the \sQuote{intro_to_pomp} vignette. + Details on this are given in the documentation for the \code{\link{pomp}} function. + Examples are given in the \sQuote{Introduction to \pkg{pomp}} document, in the demos (\code{demo(package='pomp')}), and via the \code{\link{pompExample}} function. - Currently, \pkg{pomp} provides algorithms for - (i) simulation of stochastic dynamical systems (see \code{\link[=simulate-pomp]{simulate}}), - (ii) particle filtering (AKA sequential Monte Carlo or sequential importance sampling), see \code{\link{pfilter}}), - (iii) the iterated filtering method of Ionides et al. (2006), see \code{\link{mif}}), - (iv) the nonlinear forecasting algorithm of Kendall et al. (2005), see \code{\link{nlf}}), - (v) the particle MCMC approach of Andrieu et al. (2010), see \code{\link{pmcmc}}, - (vi) basic trajectory matching, see \code{\link{traj.match}}, - (vi) the probe-matching method of Wood (2010) and Kendall et al. (1999), see \code{\link{probe.match}}, - (vii) a spectral probe-matching method (Reuman et al., 2006), see \code{\link{spect.match}}. - See the package website \url{http://pomp.r-forge.r-project.org} for these references. + \pkg{pomp} version \Sexpr[echo=F,stage=install,results=text]{packageDescription("pomp",fields="Version")} provides algorithms for + \enumerate{ + \item simulation of stochastic dynamical systems; see \code{\link[=simulate-pomp]{simulate}} + \item particle filtering (AKA sequential Monte Carlo or sequential importance sampling); see \code{\link{pfilter}} + \item the iterated filtering method of Ionides et al. (2006, 2011); see \code{\link{mif}} + \item the nonlinear forecasting algorithm of Kendall et al. (2005); see \code{\link{nlf}} + \item the particle MCMC approach of Andrieu et al. (2010); see \code{\link{pmcmc}} + \item the probe-matching method of Kendall et al. (1999, 2005); see \code{\link{probe.match}} + \item a spectral probe-matching method (Reuman et al. 2006, 2008); see \code{\link{spect.match}} + \item synthetic likelihood a la Wood (2010); see \code{\link{probe}} + \item approximate Bayesian computation (Toni et al. 2009); see \code{\link{abc}} + \item the approximate Bayesian sequential Monte Carlo scheme of Liu & West (2001); see \code{\link{bsmc}} + \item basic trajectory matching; see \code{\link{traj.match}}. + } The package also provides various tools for plotting and extracting information on models and data as well as an API for algorithm development. - Future support for additional algorithms in envisioned, and implementations of - the Bayesian sequential Monte Carlo approach of Liu \& West. - Much of the work in \pkg{pomp} has been done under the auspices of a working group of the National Center for Ecological Analysis and Synthesis (\acronym{NCEAS}), "Inference for Mechanistic Models". + Future support for additional algorithms in envisioned. + Much of the groundwork for \pkg{pomp} was laid by a working group of the National Center for Ecological Analysis and Synthesis (\acronym{NCEAS}), \dQuote{Inference for Mechanistic Models}. - The package is provided under the \acronym{GNU} Public License (\acronym{GPL}). - Contributions are welcome, as are comments, suggestions for improvements, and bug reports. - See the package website \url{http://pomp.r-forge.r-project.org} for more information, access to the package mailing list, links to the authors' websites, and references to the literature. + \pkg{pomp} is provided under the \acronym{GNU} Public License (\acronym{GPL}). + Contributions are welcome, as are comments, feature requests, and bug reports. + See the package website \url{http://pomp.r-forge.r-project.org} for more information, access to the package mailing list, links to the authors' websites, references to the literature, and up-to-date versions of the package source and documentation. } \section{Classes}{ \pkg{pomp} makes extensive use of S4 classes. The basic class, \code{\link{pomp}}, encodes a partially-observed Markov process together with a uni- or multi-variate data set and (possibly) parameters. } -\section{Vignettes}{ - The vignette \sQuote{Introduction to pomp} illustrates the facilities of the package using familiar stochastic processes. - Methods for accelerating your codes are discussed in the \sQuote{Advanced topics in pomp} vignette. - These vignettes are installed in the package \code{doc} directory and are accessible via the HTML documentation. - They can also be viewed at \url{http://pomp.r-forge.r-project.org}. +\section{Documentation}{ + The \href{http://pomp.r-forge.r-project.org/vignettes/index.html}{\sQuote{Introduction to \pkg{pomp}}} document illustrates the facilities of the package using familiar stochastic processes. + The \href{http://pomp.r-forge.r-project.org/vignettes/index.html}{\sQuote{Advanced topics in \pkg{pomp}}} document discusses the low-level interface and some more advanced modeling techniques. + These documents can be viewed at \url{http://pomp.r-forge.r-project.org}. } +\references{ + See the package website, \url{http://pomp.r-forge.r-project.org}, for the references. +} \author{Aaron A. King \email{kingaa at umich dot edu}} \seealso{ \code{\link{pomp}}, Modified: pkg/pomp/man/pomp.Rd =================================================================== --- pkg/pomp/man/pomp.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/pomp.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -91,7 +91,6 @@ optional; a formula or list of formulae, specifying the measurement model. These formulae are parsed internally to generate \code{rmeasure} and \code{dmeasure} functions. If \code{measurement.model} is given it overrides any specification of \code{rmeasure} or \code{dmeasure}. - See below for an example. \strong{NB:} This is a convenience function, primarily designed to facilitate exploration; it will typically be possible to acclerate measurement model computations by writing \code{dmeasure} and/or \code{rmeasure} functions directly. } @@ -103,8 +102,8 @@ indicate this by specifying \code{skeleton.type="vectorfield"}. The skeleton function can be specified in one of three ways: - (1) as an \R function of prototype \preformatted{skeleton(x,t,params,\dots)} that evaluates the deterministic skeleton at state \code{x} and time \code{t} given the parameters \code{params}, or - (2) as a snippet of C code (via \code{\link{Csnippet}}) that performs this evaluation. + (1) as an \R function of prototype \preformatted{skeleton(x,t,params,\dots)} that evaluates the deterministic skeleton at state \code{x} and time \code{t} given the parameters \code{params}, + (2) as a snippet of C code (via \code{\link{Csnippet}}) that performs this evaluation, or (3) as the name of a native (compiled) routine with prototype \dQuote{pomp_skeleton} as defined in the header file \dQuote{pomp.h}. If the deterministic skeleton depends on covariates, the optional argument \code{covars} will be filled with interpolated values of the covariates at the time \code{t}. @@ -122,7 +121,7 @@ optional; function drawing a sample from a prior distribution on parameters. This can be specified in one of three ways: (1) as an \R function of prototype \preformatted{rprior(params,\dots)} that makes a draw from the prior distribution given \code{params}, - (2) as a snippet of C code (via \code{\link{Csnippet}}) that draws from the prior, + (2) as a snippet of C code (via \code{\link{Csnippet}}) that draws from the prior, or (3) as the name of a native (compiled) routine with prototype \dQuote{pomp_rprior} as defined in the header file \dQuote{pomp.h}. } \item{dprior}{ @@ -301,8 +300,9 @@ } } \examples{ -## For examples, see the vignettes, the data()-loadable -## example \code{pomp} objects, and the provided example files. +## For examples, see the \dQuote{Introduction to \pkg{pomp}} +## and \dQuote{Advanced topics in \pkg{pomp}} documents, +## the demos, and the examples provided with the package, e.g.: \dontrun{ pompExample() pomp.home <- system.file("examples",package="pomp") Modified: pkg/pomp/man/prior-pomp.Rd =================================================================== --- pkg/pomp/man/prior-pomp.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/prior-pomp.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -30,6 +30,6 @@ For specifications on writing these functions, see \code{\link{pomp}}. } \author{Aaron A. King \email{kingaa at umich dot edu}} -\seealso{\code{\link{pomp-class}}, \code{\link{pomp}}} +\seealso{\code{\link{pomp}}} \keyword{models} \keyword{ts} Modified: pkg/pomp/man/ricker.Rd =================================================================== --- pkg/pomp/man/ricker.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/ricker.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -14,5 +14,5 @@ plot(ricker) coef(ricker) } -\seealso{\code{\link{pomp-class}} and the vignettes} +\seealso{\code{\link{pomp}} and the vignettes} \keyword{datasets} Modified: pkg/pomp/man/rw2.Rd =================================================================== --- pkg/pomp/man/rw2.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/rw2.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -14,5 +14,5 @@ x <- simulate(rw2,nsim=10,seed=20348585L,params=c(x1.0=0,x2.0=0,s1=1,s2=3,tau=1)) plot(x[[1]]) } -\seealso{\code{\link{pomp-class}} and the vignettes} +\seealso{\code{\link{pomp}} and the vignettes} \keyword{datasets} Modified: pkg/pomp/man/sannbox.Rd =================================================================== --- pkg/pomp/man/sannbox.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/sannbox.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -52,12 +52,12 @@ \item{\code{candidate.dist}}{ function to randomly select a new candidate parameter vector. This should be a function with three arguments, the first being the current parameter vector, the second the temperature, and the third the parameter scaling. - By default, \code{candidate.dist} is \code{function(par,temp,scale) rnorm(n=length(par),mean=par,sd=scale*temp)}. + By default, \code{candidate.dist} is \preformatted{function(par,temp,scale) rnorm(n=length(par),mean=par,sd=scale*temp)}. } \item{\code{sched}}{ cooling schedule. A function of a three arguments giving the temperature as a function of iteration number and the control parameters \code{temp} and \code{tmax}. - By default, \code{sched} is \code{function(k,temp,tmax) temp/log(((k-1)\%/\%tmax)*tmax+exp(1))}. + By default, \code{sched} is \preformatted{function(k,temp,tmax) temp/log(((k-1)\%/\%tmax)*tmax+exp(1))}. Alternatively, one can supply a numeric vector of temperatures. This must be of length at least \code{maxit}. Modified: pkg/pomp/man/simulate-pomp.Rd =================================================================== --- pkg/pomp/man/simulate-pomp.Rd 2014-05-13 12:31:28 UTC (rev 949) +++ pkg/pomp/man/simulate-pomp.Rd 2014-05-16 16:39:56 UTC (rev 950) @@ -66,6 +66,6 @@ x <- simulate(ou2,seed=3495485,nsim=10,states=TRUE,obs=TRUE) } \author{Aaron A. King \email{kingaa at umich dot edu}} -\seealso{\link{pomp-class}} +\seealso{\link{pomp}} \keyword{models} \keyword{ts} From noreply at r-forge.r-project.org Fri May 16 18:40:42 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 16 May 2014 18:40:42 +0200 (CEST) Subject: [Pomp-commits] r951 - in www: content vignettes Message-ID: <20140516164042.8C58E1844F2@r-forge.r-project.org> Author: kingaa Date: 2014-05-16 18:40:42 +0200 (Fri, 16 May 2014) New Revision: 951 Modified: www/content/NEWS.html www/content/vignettes.htm www/vignettes/advanced_topics_in_pomp.pdf www/vignettes/index.html www/vignettes/intro_to_pomp.R www/vignettes/intro_to_pomp.Rnw www/vignettes/intro_to_pomp.pdf www/vignettes/pomp.pdf Log: - bring everything up to date - minor changes in some of the pages Modified: www/content/NEWS.html =================================================================== --- www/content/NEWS.html 2014-05-16 16:39:56 UTC (rev 950) +++ www/content/NEWS.html 2014-05-16 16:40:42 UTC (rev 951) @@ -8,6 +8,20 @@

News for package ‘pomp’

+

Changes in pomp version 0.50-6

+ + +
    +
  • The package manual and tutorials are no longer included with the package source. +Instead, links are provided to the pomp website. +

    +
  • +
  • The package help pages have been revisited for accuracy and completeness. +

    +
+ + +

Changes in pomp version 0.50-1

Modified: www/content/vignettes.htm =================================================================== --- www/content/vignettes.htm 2014-05-16 16:39:56 UTC (rev 950) +++ www/content/vignettes.htm 2014-05-16 16:40:42 UTC (rev 951) @@ -1,4 +1,4 @@ -

Vignettes of package pomp

+

pomp user guides and tutorials

Modified: www/vignettes/advanced_topics_in_pomp.pdf =================================================================== (Binary files differ) Modified: www/vignettes/index.html =================================================================== --- www/vignettes/index.html 2014-05-16 16:39:56 UTC (rev 950) +++ www/vignettes/index.html 2014-05-16 16:40:42 UTC (rev 951) @@ -5,13 +5,23 @@ -

Vignettes of package pomp

-
-
intro_to_pomp.pdf:
-
Introduction to pomp
-
advanced_topics_in_pomp.pdf:
-
Advanced topics in pomp
-
+

pomp user guides and tutorials

+ +
+ + + + + + + + + + + + + + +
Introduction to pomp(PDF)(R code)
Advanced topics in pomp(PDF)(R code)
pomp package manual(PDF)
Modified: www/vignettes/intro_to_pomp.R =================================================================== --- www/vignettes/intro_to_pomp.R 2014-05-16 16:39:56 UTC (rev 950) +++ www/vignettes/intro_to_pomp.R 2014-05-16 16:40:42 UTC (rev 951) @@ -1386,7 +1386,7 @@ -## ----sir-step-R,keep.source=T-------------------------------------------- +## ----sir-step-R---------------------------------------------------------- require(pomp) Modified: www/vignettes/intro_to_pomp.Rnw =================================================================== --- www/vignettes/intro_to_pomp.Rnw 2014-05-16 16:39:56 UTC (rev 950) +++ www/vignettes/intro_to_pomp.Rnw 2014-05-16 16:40:42 UTC (rev 951) @@ -1766,7 +1766,7 @@ The help (\code{?euler.sim}) informs us that to use \code{euler.sim}, we need to specify a function that advances the states from $t$ to $t+{\delta}t$. The function \code{sir.step}, defined here, does this. -<>= +<>= require(pomp) Modified: www/vignettes/intro_to_pomp.pdf =================================================================== (Binary files differ) Modified: www/vignettes/pomp.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Fri May 16 19:03:44 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 16 May 2014 19:03:44 +0200 (CEST) Subject: [Pomp-commits] r952 - pkg/pomp/R Message-ID: <20140516170344.75B131873BB@r-forge.r-project.org> Author: kingaa Date: 2014-05-16 19:03:44 +0200 (Fri, 16 May 2014) New Revision: 952 Modified: pkg/pomp/R/abc-methods.R Log: - fix xlabel Modified: pkg/pomp/R/abc-methods.R =================================================================== --- pkg/pomp/R/abc-methods.R 2014-05-16 16:40:42 UTC (rev 951) +++ pkg/pomp/R/abc-methods.R 2014-05-16 17:03:44 UTC (rev 952) @@ -19,7 +19,7 @@ if (scatter) { pairs(conv.rec(x, pars)) } else { - plot.ts(conv.rec(x,pars),...) + plot.ts(conv.rec(x,pars),xlab="iteration",...) } } ) From noreply at r-forge.r-project.org Fri May 16 22:24:51 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 16 May 2014 22:24:51 +0200 (CEST) Subject: [Pomp-commits] r953 - www Message-ID: <20140516202451.F0BCA186CB7@r-forge.r-project.org> Author: kingaa Date: 2014-05-16 22:24:51 +0200 (Fri, 16 May 2014) New Revision: 953 Modified: www/index.php Log: - fix bug Modified: www/index.php =================================================================== --- www/index.php 2014-05-16 17:03:44 UTC (rev 952) +++ www/index.php 2014-05-16 20:24:51 UTC (rev 953) @@ -10,7 +10,7 @@ $cranversion = $matches[1]; $rforgepage = file_get_contents($rforgepkgs); preg_match("/Rev\.: (.+?)<\/b>/",$rforgepage,$matches); -$svnrevision = $matches[1]; +$svnrevision = $matches[2]; echo ''; ?> Author: kingaa Date: 2014-05-17 16:05:42 +0200 (Sat, 17 May 2014) New Revision: 954 Modified: pkg/pomp/DESCRIPTION pkg/pomp/R/mif-methods.R pkg/pomp/man/abc-methods.Rd pkg/pomp/man/pmcmc-methods.Rd Log: - minor fixes to documentation - small change to 'conv.rec' for 'mif' Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-05-16 20:24:51 UTC (rev 953) +++ pkg/pomp/DESCRIPTION 2014-05-17 14:05:42 UTC (rev 954) @@ -1,8 +1,8 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.50-6 -Date: 2014-05-16 +Version: 0.50-7 +Date: 2014-05-17 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/mif-methods.R =================================================================== --- pkg/pomp/R/mif-methods.R 2014-05-16 20:24:51 UTC (rev 953) +++ pkg/pomp/R/mif-methods.R 2014-05-17 14:05:42 UTC (rev 954) @@ -47,8 +47,8 @@ ## extract the convergence record conv.rec.internal <- function (object, pars, transform = FALSE, ...) { if (transform) { - pars.improper <- c("loglik","nfail") - pars.proper <- setdiff(colnames(object at conv.rec),pars.improper) + pars.proper <- names(coef(object)) + pars.improper <- setdiff(colnames(object at conv.rec),pars.proper) retval <- cbind( t( partrans( Modified: pkg/pomp/man/abc-methods.Rd =================================================================== --- pkg/pomp/man/abc-methods.Rd 2014-05-16 20:24:51 UTC (rev 953) +++ pkg/pomp/man/abc-methods.Rd 2014-05-17 14:05:42 UTC (rev 954) @@ -1,8 +1,6 @@ \name{abc-methods} \docType{methods} \alias{abc-methods} -\alias{dprior,abc-method} -\alias{dprior-abc} \alias{conv.rec,abc-method} \alias{conv.rec-abc} \alias{plot-abc} @@ -12,17 +10,16 @@ \usage{ \S4method{conv.rec}{abc}(object, pars, \dots) \S4method{plot}{abc}(x, y, pars, scatter = FALSE, \dots) -\S4method{dprior}{abc}(object, params, log = FALSE, \dots) } \arguments{ \item{object, x}{The \code{abc} object.} \item{pars}{Names of parameters.} \item{y}{Ignored.} - \item{scatter}{WHAT DOES THIS DO?} - \item{params}{ - Named vector of parameters. + \item{scatter}{ + optional logical; + If \code{TRUE}, draw scatterplots. + If \code{FALSE}, draw traceplots. } - \item{log}{if TRUE, log probabilities are returned.} \item{\dots}{ Further arguments (either ignored or passed to underlying functions). } @@ -30,7 +27,7 @@ \section{Methods}{ \describe{ \item{conv.rec}{ - \code{conv.rec(object, pars = NULL)} returns the columns of the convergence-record matrix corresponding to the names in \code{pars}. + \code{conv.rec(object, pars)} returns the columns of the convergence-record matrix corresponding to the names in \code{pars}. By default, all rows are returned. } \item{plot}{ Modified: pkg/pomp/man/pmcmc-methods.Rd =================================================================== --- pkg/pomp/man/pmcmc-methods.Rd 2014-05-16 20:24:51 UTC (rev 953) +++ pkg/pomp/man/pmcmc-methods.Rd 2014-05-17 14:05:42 UTC (rev 954) @@ -31,7 +31,7 @@ \section{Methods}{ \describe{ \item{conv.rec}{ - \code{conv.rec(object, pars = NULL)} returns the columns of the convergence-record matrix corresponding to the names in \code{pars}. + \code{conv.rec(object, pars)} returns the columns of the convergence-record matrix corresponding to the names in \code{pars}. By default, all rows are returned. } \item{logLik}{ From noreply at r-forge.r-project.org Sat May 17 16:06:11 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sat, 17 May 2014 16:06:11 +0200 (CEST) Subject: [Pomp-commits] r955 - www/vignettes Message-ID: <20140517140611.0EA1A1874DE@r-forge.r-project.org> Author: kingaa Date: 2014-05-17 16:06:10 +0200 (Sat, 17 May 2014) New Revision: 955 Modified: www/vignettes/pomp.pdf Log: - update manual Modified: www/vignettes/pomp.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Sat May 17 17:51:26 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sat, 17 May 2014 17:51:26 +0200 (CEST) Subject: [Pomp-commits] r956 - in www: . vignettes Message-ID: <20140517155126.D5D18186EE8@r-forge.r-project.org> Author: kingaa Date: 2014-05-17 17:51:26 +0200 (Sat, 17 May 2014) New Revision: 956 Modified: www/index.php www/vignettes/Makefile www/vignettes/advanced_topics_in_pomp.pdf 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/pomp.pdf Log: - fix bugs with NLF in intro vignette Modified: www/index.php =================================================================== --- www/index.php 2014-05-17 14:06:10 UTC (rev 955) +++ www/index.php 2014-05-17 15:51:26 UTC (rev 956) @@ -9,8 +9,8 @@ preg_match("/Version:<\/td>\\n(.+?)<\/td>/",$crancontents,$matches); $cranversion = $matches[1]; $rforgepage = file_get_contents($rforgepkgs); -preg_match("/Rev\.: (.+?)<\/b>/",$rforgepage,$matches); -$svnrevision = $matches[2]; +preg_match_all("/Rev\.: (.+?)<\/b>/",$rforgepage,&$matches); +$svnrevision = $matches[1][1]; echo ''; ?> >= +<>= pompExample(gompertz) out <- nlf( gompertz, start=c(r=1,K=2,sigma=0.5,tau=0.5,X.0=1), - partrans=TRUE, + transform.params=TRUE, est=c("K","r"), lags=c(1,2) ) 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/pomp.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Sat May 17 23:23:27 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sat, 17 May 2014 23:23:27 +0200 (CEST) Subject: [Pomp-commits] r957 - in pkg/pomp: . R inst man Message-ID: <20140517212327.91F99186D43@r-forge.r-project.org> Author: kingaa Date: 2014-05-17 23:23:27 +0200 (Sat, 17 May 2014) New Revision: 957 Removed: pkg/pomp/R/compare-mif.R pkg/pomp/R/compare-pmcmc.R Modified: pkg/pomp/DESCRIPTION pkg/pomp/NAMESPACE pkg/pomp/R/abc-methods.R pkg/pomp/R/mif-methods.R pkg/pomp/R/pmcmc-methods.R pkg/pomp/inst/NEWS pkg/pomp/inst/NEWS.Rd pkg/pomp/man/abc-methods.Rd Log: - add compare.abc and compare.pmcmc methods Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-05-17 15:51:26 UTC (rev 956) +++ pkg/pomp/DESCRIPTION 2014-05-17 21:23:27 UTC (rev 957) @@ -1,7 +1,7 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.50-7 +Version: 0.50-8 Date: 2014-05-17 Authors at R: c(person(given=c("Aaron","A."),family="King", role=c("aut","cre"),email="kingaa at umich.edu"), @@ -35,8 +35,8 @@ dprior-pomp.R rprior-pomp.R simulate-pomp.R trajectory-pomp.R plot-pomp.R pfilter.R pfilter-methods.R minim.R traj-match.R bsmc.R - mif.R mif-methods.R compare-mif.R - pmcmc.R pmcmc-methods.R compare-pmcmc.R + mif.R mif-methods.R + pmcmc.R pmcmc-methods.R nlf-funcs.R nlf-guts.R nlf-objfun.R nlf.R probe.R probe-match.R basic-probes.R spect.R spect-match.R abc.R abc-methods.R Modified: pkg/pomp/NAMESPACE =================================================================== --- pkg/pomp/NAMESPACE 2014-05-17 15:51:26 UTC (rev 956) +++ pkg/pomp/NAMESPACE 2014-05-17 21:23:27 UTC (rev 957) @@ -87,7 +87,7 @@ profileDesign, bspline.basis, periodic.bspline.basis, - compare.mif, + compare.mif,compare.pmcmc,compare.abc, nlf, parmat, logmeanexp, Modified: pkg/pomp/R/abc-methods.R =================================================================== --- pkg/pomp/R/abc-methods.R 2014-05-17 15:51:26 UTC (rev 956) +++ pkg/pomp/R/abc-methods.R 2014-05-17 21:23:27 UTC (rev 957) @@ -23,3 +23,56 @@ } } ) + +compare.abc <- function (z) { + ## assumes that z is a list of abcs with identical structure + if (!is.list(z)) z <- list(z) + if (!all(sapply(z,function(x)is(x,'abc')))) + stop("compare.abc 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 pmcmc convergence diagnostics + other.diagnostics <- c() + plotnames <- c(other.diagnostics,estnames) + nplots <- length(plotnames) + n.per.page <- min(nplots,10) + nc <- if (n.per.page<=4) 1 else 2 + nr <- ceiling(n.per.page/nc) + 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 Nabc) + while (hi0) filtnames[-match(unestnames,filtnames)] else 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 (hi0) 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 (hi0) filtnames[-match(unestnames,filtnames)] else 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 (hi0) 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 Author: kingaa Date: 2014-05-18 16:51:39 +0200 (Sun, 18 May 2014) New Revision: 958 Modified: www/content/NEWS.html www/vignettes/advanced_topics_in_pomp.pdf www/vignettes/intro_to_pomp.pdf www/vignettes/pomp.pdf Log: - update Modified: www/content/NEWS.html =================================================================== --- www/content/NEWS.html 2014-05-17 21:23:27 UTC (rev 957) +++ www/content/NEWS.html 2014-05-18 14:51:39 UTC (rev 958) @@ -8,6 +8,16 @@

News for package ‘pomp’

+

Changes in pomp version 0.50-8

+ + +
    +
  • Introduced new compare.pmcmc and compare.abc functions, comparable to compare.mif. +

    +
+ + +

Changes in pomp version 0.50-6

Modified: www/vignettes/advanced_topics_in_pomp.pdf =================================================================== (Binary files differ) Modified: www/vignettes/intro_to_pomp.pdf =================================================================== (Binary files differ) Modified: www/vignettes/pomp.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Sun May 18 18:10:46 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 18 May 2014 18:10:46 +0200 (CEST) Subject: [Pomp-commits] r959 - in pkg/pomp: . R inst Message-ID: <20140518161046.235F918045C@r-forge.r-project.org> 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 Author: kingaa Date: 2014-05-19 22:45:32 +0200 (Mon, 19 May 2014) New Revision: 960 Modified: www/content/NEWS.html www/index.php Log: - fix bug - update NEWS Modified: www/content/NEWS.html =================================================================== --- www/content/NEWS.html 2014-05-18 16:10:45 UTC (rev 959) +++ www/content/NEWS.html 2014-05-19 20:45:32 UTC (rev 960) @@ -8,6 +8,16 @@

News for package ‘pomp’

+

Changes in pomp version 0.50-9

+ + +
    +
  • Fix bug in compare.pmcmc. +

    +
+ + +

Changes in pomp version 0.50-8

Modified: www/index.php =================================================================== --- www/index.php 2014-05-18 16:10:45 UTC (rev 959) +++ www/index.php 2014-05-19 20:45:32 UTC (rev 960) @@ -6,7 +6,7 @@ $tracker = "http://r-forge.r-project.org/tracker/?group_id=214"; $cranpage = "http://cran.at.r-project.org/web/packages/pomp/"; $crancontents = file_get_contents($cranpage); -preg_match("/Version:<\/td>\\n(.+?)<\/td>/",$crancontents,$matches); +preg_match("/Version:<\/td>\\n(.+?)<\/td><\/tr>/",$crancontents,$matches); $cranversion = $matches[1]; $rforgepage = file_get_contents($rforgepkgs); preg_match_all("/Rev\.: (.+?)<\/b>/",$rforgepage,&$matches); From noreply at r-forge.r-project.org Fri May 23 18:23:09 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 23 May 2014 18:23:09 +0200 (CEST) Subject: [Pomp-commits] r961 - in pkg/pomp: . R man src tests Message-ID: <20140523162310.0DF5A186DA7@r-forge.r-project.org> Author: kingaa Date: 2014-05-23 18:23:09 +0200 (Fri, 23 May 2014) New Revision: 961 Modified: pkg/pomp/DESCRIPTION pkg/pomp/NAMESPACE pkg/pomp/R/abc-methods.R pkg/pomp/R/pmcmc-methods.R pkg/pomp/R/pomp-methods.R pkg/pomp/man/pmcmc-methods.Rd pkg/pomp/src/Makevars pkg/pomp/tests/ou2-pmcmc.R pkg/pomp/tests/ou2-pmcmc.Rout.save pkg/pomp/tests/rw2.Rout.save pkg/pomp/tests/sir.Rout.save Log: - change 'show' method for 'pomp' objects to be somewhat less verbose - add 'pmcmcList' class and associated methods to facilitate multiple-chain algorithms Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-05-19 20:45:32 UTC (rev 960) +++ pkg/pomp/DESCRIPTION 2014-05-23 16:23:09 UTC (rev 961) @@ -1,8 +1,8 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.50-9 -Date: 2014-05-18 +Version: 0.51-1 +Date: 2014-05-21 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")), @@ -18,7 +18,7 @@ ) URL: http://pomp.r-forge.r-project.org Description: Inference methods for partially-observed Markov processes -Depends: R(>= 3.0.0), stats, graphics, methods, mvtnorm, subplex, nloptr, deSolve +Depends: R(>= 3.0.0), stats, graphics, methods, mvtnorm, subplex, nloptr, deSolve, coda Suggests: knitr License: GPL(>= 2) LazyData: true Modified: pkg/pomp/NAMESPACE =================================================================== --- pkg/pomp/NAMESPACE 2014-05-19 20:45:32 UTC (rev 960) +++ pkg/pomp/NAMESPACE 2014-05-23 16:23:09 UTC (rev 961) @@ -38,12 +38,13 @@ importFrom(subplex,subplex) importFrom(deSolve,ode) importFrom(nloptr,nloptr) +importFrom(coda,mcmc,mcmc.list) exportClasses( pomp, pfilterd.pomp, mif, - pmcmc, + pmcmc,pmcmcList, traj.matched.pomp, probed.pomp,probe.matched.pomp, spect.pomp,spect.matched.pomp, @@ -87,7 +88,7 @@ profileDesign, bspline.basis, periodic.bspline.basis, - compare.mif,compare.pmcmc,compare.abc, + compare.mif, nlf, parmat, logmeanexp, Modified: pkg/pomp/R/abc-methods.R =================================================================== --- pkg/pomp/R/abc-methods.R 2014-05-19 20:45:32 UTC (rev 960) +++ pkg/pomp/R/abc-methods.R 2014-05-23 16:23:09 UTC (rev 961) @@ -6,18 +6,18 @@ 'abc', function (object, pars, ...) { if (missing(pars)) pars <- colnames(object at conv.rec) - object at conv.rec[,pars] + coda::mcmc(object at conv.rec[,pars]) } ) -## plot pmcmc object +## plot abc object setMethod( "plot", "abc", function (x, y, pars, scatter = FALSE, ...) { if (missing(pars)) pars <- x at pars if (scatter) { - pairs(conv.rec(x, pars)) + pairs(as.matrix(conv.rec(x, pars))) } else { plot.ts(conv.rec(x,pars),xlab="iteration",...) } Modified: pkg/pomp/R/pmcmc-methods.R =================================================================== --- pkg/pomp/R/pmcmc-methods.R 2014-05-19 20:45:32 UTC (rev 960) +++ pkg/pomp/R/pmcmc-methods.R 2014-05-23 16:23:09 UTC (rev 961) @@ -3,41 +3,133 @@ ## extract the estimated log likelihood setMethod('logLik','pmcmc',function(object,...)object at loglik) -## extract the filtering means -setMethod( - 'filter.mean', - 'pmcmc', - function (object, pars, ...) { - if (missing(pars)) pars <- rownames(object at filter.mean) - object at filter.mean[pars,] - } - ) - ## extract the convergence record setMethod( 'conv.rec', - 'pmcmc', + signature=signature(object='pmcmc'), function (object, pars, ...) { if (missing(pars)) pars <- colnames(object at conv.rec) - object at conv.rec[,pars] + coda::mcmc(object at conv.rec[,pars]) } ) ## plot pmcmc object setMethod( "plot", - "pmcmc", + signature=signature(x='pmcmc'), function (x, y = NULL, ...) { - compare.pmcmc(x) + pmcmc.diagnostics(list(x)) } ) -compare.pmcmc <- function (z) { + +## pmcmcList class +setClass( + 'pmcmcList', + slots=c( + list = 'list' + ), + prototype=prototype( + list = list() + ), + validity=function (object) { + if (!all(sapply(object at list,is,'pmcmc'))) { + retval <- paste0( + "error in ",sQuote("c"), + ": dissimilar objects cannot be combined" + ) + return(retval) + } + d <- sapply(object at list,function(x)dim(x at conv.rec)) + if (!all(apply(d,1,diff)==0)) { + retval <- paste0( + "error in ",sQuote("c"), + ": to be combined, ",sQuote("pmcmc"), + " objects must have chains of equal length" + ) + return(retval) + } + TRUE + } + ) + +setMethod( + 'c', + signature=signature(x='pmcmc'), + definition=function (x, ...) { + y <- list(...) + if (length(y)==0) { + new("pmcmcList",list=list(x)) + } else { + p <- sapply(y,is,'pmcmc') + q <- sapply(y,is,'pmcmcList') + if (any(!(p||q))) + stop("cannot mix ",sQuote("pmcmc"), + " and non-",sQuote("pmcmc")," objects") + y[p] <- lapply(y[p],list) + y[q] <- lapply(y[q],slot,"list") + new("pmcmcList",list=c(list(x),y,recursive=TRUE)) + } + } + ) + +setMethod( + 'c', + signature=signature(x='pmcmcList'), + definition=function (x, ...) { + y <- list(...) + if (length(y)==0) { + x + } else { + x <- x at list + p <- sapply(y,is,'pmcmc') + pl <- sapply(y,is,'pmcmcList') + if (any(!(p||pl))) + stop("cannot mix ",sQuote("pmcmc"), + " and non-",sQuote("pmcmc")," objects") + y[p] <- lapply(y[p],list) + y[pl] <- lapply(y[pl],slot,"list") + new("pmcmcList",list=c(x,y,recursive=TRUE)) + } + } + ) + +setMethod( + "[", + signature=signature(x="pmcmcList"), + definition=function(x, i, ...) { + y <- x + y at list <- x at list[i] + y + } + ) + +setMethod( + "[[", + signature=signature(x="pmcmcList"), + definition=function(x, i, ...) { + x at list[[i]] + } + ) + +setMethod( + 'conv.rec', + signature=signature(object='pmcmcList'), + definition=function (object, ...) { + coda::mcmc.list(lapply(object at list,conv.rec,...)) + } + ) + +setMethod( + "plot", + signature=signature(x='pmcmcList'), + definition=function (x, y = NULL, ...) { + pmcmc.diagnostics(x at list) + } + ) + +pmcmc.diagnostics <- function (z) { ## 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) mar.multi <- c(0,5.1,0,2.1) oma.multi <- c(6,0,5,0) xx <- z[[1]] @@ -81,3 +173,13 @@ } invisible(NULL) } + +compare.pmcmc <- function (z) { + 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) + warning(sQuote("compare.pmcmc")," is deprecated.\n", + "Use ",sQuote("diagnostics")," instead.",call.=FALSE) + pmcmc.diagnostics(z) +} Modified: pkg/pomp/R/pomp-methods.R =================================================================== --- pkg/pomp/R/pomp-methods.R 2014-05-19 20:45:32 UTC (rev 960) +++ pkg/pomp/R/pomp-methods.R 2014-05-23 16:23:09 UTC (rev 961) @@ -243,7 +243,7 @@ "print", "pomp", function (x, ...) { - cat("data and states:\n") + cat("data, states, and covariates:\n") print(as(x,"data.frame")) invisible(x) } @@ -253,13 +253,20 @@ "show", "pomp", function (object) { - print(object) + cat(length(object at times),"records of", + nrow(obs(object)),"observables,", + "recorded from t =", + min(object at times),"to",max(object at times),"\n") + cat("summary of data:\n") + print(summary(as.data.frame(t(obs(object))))) cat("zero time, t0 = ",object at t0,"\n",sep="") - if (length(coef(object))>0) { - cat("parameter(s):\n") - print(coef(object)) - } else { - cat ("parameter(s) unspecified\n"); + if (length(object at tcovar)>0) { + cat(nrow(object at covar),"records of", + ncol(object at covar),"covariates,", + "recorded from t =",min(object at tcovar), + "to",max(object at tcovar),"\n") + cat("summary of covariates:\n") + print(summary(as.data.frame(object at covar))) } cat("process model simulator, rprocess = \n") show(object at rprocess) @@ -283,6 +290,12 @@ show(object at par.trans) cat("parameter inverse transform function = \n") show(object at par.untrans) + if (length(coef(object))>0) { + cat("parameter(s):\n") + print(coef(object)) + } else { + cat ("parameter(s) unspecified\n"); + } if (length(object at userdata)>0) { cat("userdata = \n") show(object at userdata) Modified: pkg/pomp/man/pmcmc-methods.Rd =================================================================== --- pkg/pomp/man/pmcmc-methods.Rd 2014-05-19 20:45:32 UTC (rev 960) +++ pkg/pomp/man/pmcmc-methods.Rd 2014-05-23 16:23:09 UTC (rev 961) @@ -5,25 +5,35 @@ \alias{logLik-pmcmc} \alias{conv.rec,pmcmc-method} \alias{conv.rec-pmcmc} -\alias{filter.mean,pmcmc-method} -\alias{filter.mean-pmcmc} +\alias{conv.rec,pmcmcList-method} +\alias{conv.rec-pmcmcList} \alias{plot-pmcmc} \alias{plot,pmcmc-method} -\alias{compare.pmcmc} +\alias{plot-pmcmcList} +\alias{plot,pmcmcList-method} +\alias{pmcmcList-class} +\alias{c-pmcmc} +\alias{c,pmcmc-method} +\alias{c-pmcmcList} +\alias{c,pmcmcList-method} +\alias{[-pmcmcList} +\alias{[,pmcmcList-method} +\alias{[[-pmcmcList} +\alias{[[,pmcmcList-method} \title{Methods of the "pmcmc" class} \description{Methods of the "pmcmc" class.} \usage{ \S4method{logLik}{pmcmc}(object, \dots) \S4method{conv.rec}{pmcmc}(object, pars, \dots) -\S4method{filter.mean}{pmcmc}(object, pars, \dots) +\S4method{conv.rec}{pmcmcList}(object, \dots) \S4method{plot}{pmcmc}(x, y = NULL, \dots) -compare.pmcmc(z) +\S4method{c}{pmcmc}(x, \dots, recursive = FALSE) +\S4method{c}{pmcmcList}(x, \dots, recursive = FALSE) } \arguments{ - \item{object, x}{The \code{pmcmc} object.} + \item{object, x}{The \code{pmcmc} or \code{pmcmcList} object.} \item{pars}{Names of parameters.} - \item{y}{Ignored.} - \item{z}{A \code{pmcmc} object or list of \code{pmcmc} objects.} + \item{y, recursive}{Ignored.} \item{\dots}{ Further arguments (either ignored or passed to underlying functions). } @@ -31,36 +41,18 @@ \section{Methods}{ \describe{ \item{conv.rec}{ - \code{conv.rec(object, pars)} returns the columns of the convergence-record matrix corresponding to the names in \code{pars}. - By default, all rows are returned. + \code{conv.rec(object, pars)} returns the columns of the convergence-record matrix corresponding to the names in \code{pars} as an object of class \code{\link[coda]{mcmc}} or \code{\link[coda]{mcmc.list}}. } + \item{plot}{ + Plots density- and trace-plots. + This uses package \pkg{coda}'s default plots. + } \item{logLik}{ Returns the value in the \code{loglik} slot. } - \item{pmcmc}{ - Re-runs the PMCMC iterations. - See the documentation for \code{\link{pmcmc}}. + \item{c}{ + Concatenates \code{pmcmc} objects into a \code{pmcmcList}. } - \item{compare.pmcmc}{ - Given a \code{pmcmc} object or a list of \code{pmcmc} objects, \code{compare.pmcmc} produces a set of diagnostic plots. - } - \item{plot}{ - Plots a series of diagnostic plots. - When \code{x} is a \code{pmcmc} object, \code{plot(x)} is equivalent to \code{compare.pmcmc(list(x))}. - } - \item{filter.mean}{ - \code{filter.mean(object, pars = NULL)} returns the rows of the filtering-mean matrix corresponding to the names in \code{pars}. - By default, all rows are returned. - } - \item{print}{ - Prints a summary of the \code{pmcmc} object. - } - \item{show}{ - Displays the \code{pmcmc} object. - } - \item{pfilter}{ - See \code{\link{pfilter}}. - } } } \references{ Property changes on: pkg/pomp/src/Makevars ___________________________________________________________________ Deleted: svn:executable - * Modified: pkg/pomp/tests/ou2-pmcmc.R =================================================================== --- pkg/pomp/tests/ou2-pmcmc.R 2014-05-19 20:45:32 UTC (rev 960) +++ pkg/pomp/tests/ou2-pmcmc.R 2014-05-23 16:23:09 UTC (rev 961) @@ -17,7 +17,7 @@ max.fail=100, verbose=FALSE ) -f1 <- continue(f1,Nmcmc=200,max.fail=100) +f1 <- continue(f1,Nmcmc=20,max.fail=100) plot(f1) ff <- pfilter(f1) @@ -29,44 +29,55 @@ verbose=FALSE ) -f3 <- pmcmc( - ff, - Nmcmc=20, - transform=TRUE, - rw.sd=c(alpha.2=0.01,alpha.3=0.01), - max.fail=100, - verbose=FALSE - ) -f4 <- pmcmc(f3) -f4 <- continue(f4,Nmcmc=100) +f3 <- pmcmc(f2) +f4 <- continue(f3,Nmcmc=20) -if (FALSE) { - f2 <- pmcmc( - f1,Nmcmc=1000,Np=500,max.fail=100, - verbose=FALSE - ) - plot(f2) - runs <- rle(conv.rec(f2)[,'loglik'])$lengths - plot(runs) - acf(conv.rec(f2)[,c("alpha.2","alpha.3")]) -} +plot(c(f2,f3)) -dprior.ou2 <- function (params, log, ...) { - f <- sum(dnorm(params,mean=coef(ou2),sd=1,log=TRUE)) - if (log) f else exp(f) +try(ff <- c(f3,f4)) + +if (Sys.getenv("POMP_FULL_TESTS")=="yes") { + f2a <- pmcmc( + f1,Nmcmc=1000,Np=100,max.fail=100, + verbose=FALSE + ) + plot(f2a) + runs <- rle(as.numeric(conv.rec(f2a,'loglik')))$lengths + plot(sort(runs)) + acf(conv.rec(f2a,c("alpha.2","alpha.3"))) } f5 <- pmcmc( - ou2, - start=coef(ou2), + pomp(ou2, + dprior=function (params, log, ...) { + f <- sum(dnorm(params,mean=coef(ou2),sd=1,log=TRUE)) + if (log) f else exp(f) + } + ), Nmcmc=20, rw.sd=c(alpha.2=0.001,alpha.3=0.001), Np=100, max.fail=100, verbose=FALSE ) -f5 <- continue(f5,Nmcmc=200,max.fail=100) -plot(f5) +f6 <- continue(f5,Nmcmc=20,max.fail=100) +plot(f6) +ff <- c(f4,f6) +plot(ff) +plot(conv.rec(ff,c("alpha.2","alpha.3","loglik"))) + +ff <- c(f2,f3) + +try(ff <- c(ff,f4,f6)) +try(ff <- c(f4,ou2)) +try(ff <- c(ff,ou2)) + +plot(ff <- c(ff,f5)) +plot(conv.rec(c(f2,ff),c("alpha.2","alpha.3"))) +plot(conv.rec(ff[2],c("alpha.2"))) +plot(conv.rec(ff[2:3],c("alpha.3"))) +plot(conv.rec(ff[[3]],c("alpha.3"))) + dev.off() Modified: pkg/pomp/tests/ou2-pmcmc.Rout.save =================================================================== --- pkg/pomp/tests/ou2-pmcmc.Rout.save 2014-05-19 20:45:32 UTC (rev 960) +++ pkg/pomp/tests/ou2-pmcmc.Rout.save 2014-05-23 16:23:09 UTC (rev 961) @@ -1,5 +1,5 @@ -R version 3.0.3 (2014-03-06) -- "Warm Puppy" +R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) @@ -20,6 +20,8 @@ Loading required package: subplex Loading required package: nloptr Loading required package: deSolve +Loading required package: coda +Loading required package: lattice > > pompExample(ou2) newly created pomp object(s): @@ -40,7 +42,7 @@ + max.fail=100, + verbose=FALSE + ) -> f1 <- continue(f1,Nmcmc=200,max.fail=100) +> f1 <- continue(f1,Nmcmc=20,max.fail=100) > plot(f1) > > ff <- pfilter(f1) @@ -52,45 +54,62 @@ + verbose=FALSE + ) > -> f3 <- pmcmc( -+ ff, -+ Nmcmc=20, -+ transform=TRUE, -+ rw.sd=c(alpha.2=0.01,alpha.3=0.01), -+ max.fail=100, -+ verbose=FALSE -+ ) -> f4 <- pmcmc(f3) -> f4 <- continue(f4,Nmcmc=100) +> f3 <- pmcmc(f2) +> f4 <- continue(f3,Nmcmc=20) > -> if (FALSE) { -+ f2 <- pmcmc( -+ f1,Nmcmc=1000,Np=500,max.fail=100, -+ verbose=FALSE -+ ) -+ plot(f2) -+ runs <- rle(conv.rec(f2)[,'loglik'])$lengths -+ plot(runs) -+ acf(conv.rec(f2)[,c("alpha.2","alpha.3")]) -+ } +> plot(c(f2,f3)) > -> dprior.ou2 <- function (params, log, ...) { -+ f <- sum(dnorm(params,mean=coef(ou2),sd=1,log=TRUE)) -+ if (log) f else exp(f) +> try(ff <- c(f3,f4)) +Error in validObject(.Object) : + invalid class "pmcmcList" object: error in 'c': to be combined, 'pmcmc' objects must have chains of equal length +> +> if (Sys.getenv("POMP_FULL_TESTS")=="yes") { ++ f2a <- pmcmc( ++ f1,Nmcmc=1000,Np=100,max.fail=100, ++ verbose=FALSE ++ ) ++ plot(f2a) ++ runs <- rle(as.numeric(conv.rec(f2a,'loglik')))$lengths ++ plot(sort(runs)) ++ acf(conv.rec(f2a,c("alpha.2","alpha.3"))) + } > > f5 <- pmcmc( -+ ou2, -+ start=coef(ou2), ++ pomp(ou2, ++ dprior=function (params, log, ...) { ++ f <- sum(dnorm(params,mean=coef(ou2),sd=1,log=TRUE)) ++ if (log) f else exp(f) ++ } ++ ), + Nmcmc=20, + rw.sd=c(alpha.2=0.001,alpha.3=0.001), + Np=100, + max.fail=100, + verbose=FALSE + ) -> f5 <- continue(f5,Nmcmc=200,max.fail=100) -> plot(f5) +> f6 <- continue(f5,Nmcmc=20,max.fail=100) +> plot(f6) > +> ff <- c(f4,f6) +> plot(ff) +> plot(conv.rec(ff,c("alpha.2","alpha.3","loglik"))) +> +> ff <- c(f2,f3) +> +> try(ff <- c(ff,f4,f6)) +Error in validObject(.Object) : + invalid class "pmcmcList" object: error in 'c': to be combined, 'pmcmc' objects must have chains of equal length +> try(ff <- c(f4,ou2)) +Error in c(f4, ou2) : cannot mix 'pmcmc' and non-'pmcmc' objects +> try(ff <- c(ff,ou2)) +Error in c(ff, ou2) : cannot mix 'pmcmc' and non-'pmcmc' objects +> +> plot(ff <- c(ff,f5)) +> plot(conv.rec(c(f2,ff),c("alpha.2","alpha.3"))) +> plot(conv.rec(ff[2],c("alpha.2"))) +> plot(conv.rec(ff[2:3],c("alpha.3"))) +> plot(conv.rec(ff[[3]],c("alpha.3"))) +> > dev.off() null device 1 @@ -98,4 +117,4 @@ > > proc.time() user system elapsed - 13.904 0.052 14.145 + 23.369 0.040 23.847 Modified: pkg/pomp/tests/rw2.Rout.save =================================================================== --- pkg/pomp/tests/rw2.Rout.save 2014-05-19 20:45:32 UTC (rev 960) +++ pkg/pomp/tests/rw2.Rout.save 2014-05-23 16:23:09 UTC (rev 961) @@ -1,5 +1,5 @@ -R version 3.0.3 (2014-03-06) -- "Warm Puppy" +R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) @@ -20,6 +20,8 @@ Loading required package: subplex Loading required package: nloptr Loading required package: deSolve +Loading required package: coda +Loading required package: lattice > > set.seed(45768683) > @@ -113,110 +115,16 @@ + ) > > invisible(show(rw2)) -data and states: - time y1 y2 -1 1 0 0 -2 2 0 0 -3 3 0 0 -4 4 0 0 -5 5 0 0 -6 6 0 0 -7 7 0 0 -8 8 0 0 -9 9 0 0 -10 10 0 0 -11 11 0 0 -12 12 0 0 -13 13 0 0 -14 14 0 0 -15 15 0 0 -16 16 0 0 -17 17 0 0 -18 18 0 0 -19 19 0 0 -20 20 0 0 -21 21 0 0 -22 22 0 0 -23 23 0 0 -24 24 0 0 -25 25 0 0 -26 26 0 0 -27 27 0 0 -28 28 0 0 -29 29 0 0 -30 30 0 0 -31 31 0 0 -32 32 0 0 -33 33 0 0 -34 34 0 0 -35 35 0 0 -36 36 0 0 -37 37 0 0 -38 38 0 0 -39 39 0 0 -40 40 0 0 -41 41 0 0 -42 42 0 0 -43 43 0 0 -44 44 0 0 -45 45 0 0 -46 46 0 0 -47 47 0 0 -48 48 0 0 -49 49 0 0 -50 50 0 0 -51 51 0 0 -52 52 0 0 -53 53 0 0 -54 54 0 0 -55 55 0 0 -56 56 0 0 -57 57 0 0 -58 58 0 0 -59 59 0 0 -60 60 0 0 -61 61 0 0 -62 62 0 0 -63 63 0 0 -64 64 0 0 -65 65 0 0 -66 66 0 0 -67 67 0 0 -68 68 0 0 -69 69 0 0 -70 70 0 0 -71 71 0 0 -72 72 0 0 -73 73 0 0 -74 74 0 0 -75 75 0 0 -76 76 0 0 -77 77 0 0 -78 78 0 0 -79 79 0 0 -80 80 0 0 -81 81 0 0 -82 82 0 0 -83 83 0 0 -84 84 0 0 -85 85 0 0 -86 86 0 0 -87 87 0 0 -88 88 0 0 -89 89 0 0 -90 90 0 0 -91 91 0 0 -92 92 0 0 -93 93 0 0 -94 94 0 0 -95 95 0 0 -96 96 0 0 -97 97 0 0 -98 98 0 0 -99 99 0 0 -100 100 0 0 +100 records of 2 observables, recorded from t = 1 to 100 +summary of data: + y1 y2 + Min. :0 Min. :0 + 1st Qu.:0 1st Qu.:0 + Median :0 Median :0 + Mean :0 Mean :0 + 3rd Qu.:0 3rd Qu.:0 + Max. :0 Max. :0 zero time, t0 = 0 -parameter(s) unspecified process model simulator, rprocess = function (params, xstart, times, ...) { @@ -260,7 +168,7 @@ } y } - + measurement model density, dmeasure = function (y, x, t, params, log, covars, ...) { @@ -273,7 +181,7 @@ f else exp(f) } - + prior simulator, rprior = function not specified prior density, dprior = @@ -291,6 +199,7 @@ function not specified parameter inverse transform function = function not specified +parameter(s) unspecified userdata = $useless [1] 23 @@ -401,7 +310,7 @@ > invisible(timezero(new)) > timezero(new) <- 19 > print(simulate(new)) -data and states: +data, states, and covariates: time y1 y2 x1 x2 1 20 0.2438664 3.1093573 0.5247663 5.0741536 2 21 -2.4324990 4.5669427 -2.2582676 4.2250510 @@ -437,4 +346,4 @@ > > proc.time() user system elapsed - 0.944 0.076 1.040 + 0.968 0.064 1.059 Modified: pkg/pomp/tests/sir.Rout.save =================================================================== --- pkg/pomp/tests/sir.Rout.save 2014-05-19 20:45:32 UTC (rev 960) +++ pkg/pomp/tests/sir.Rout.save 2014-05-23 16:23:09 UTC (rev 961) @@ -20,6 +20,8 @@ Loading required package: subplex Loading required package: nloptr Loading required package: deSolve +Loading required package: coda +Loading required package: lattice > > tbasis <- seq(0,25,by=1/52) > basis <- periodic.bspline.basis(tbasis,nbasis=3,names="seas%d") @@ -166,222 +168,25 @@ + ) > > show(po) -data and states: - time reports seas1 seas2 seas3 -1 0.01923077 0 0.66343428 0.19708101 0.13948471 -2 0.03846154 0 0.65412115 0.23024769 0.11563116 -3 0.05769231 0 0.63930336 0.26559063 0.09510602 -4 0.07692308 0 0.61955697 0.30253376 0.07790927 -5 0.09615385 0 0.59545806 0.34050101 0.06404093 -6 0.11538462 0 0.56758269 0.37891633 0.05350099 -7 0.13461538 0 0.53650693 0.41720362 0.04628945 -8 0.15384615 0 0.50280686 0.45478683 0.04240631 -9 0.17307692 0 0.46705854 0.49108989 0.04185158 -10 0.19230769 0 0.42983804 0.52553672 0.04462525 -11 0.21153846 0 0.39172143 0.55755125 0.05072732 -12 0.23076923 0 0.35328478 0.58655743 0.06015779 -13 0.25000000 0 0.31510417 0.61197917 0.07291667 -14 0.26923077 0 0.27775565 0.63324040 0.08900394 -15 0.28846154 0 0.24181531 0.64976507 0.10841963 -16 0.30769231 0 0.20785920 0.66097709 0.13116371 -17 0.32692308 0 0.17646341 0.66630040 0.15723619 -18 0.34615385 0 0.14817554 0.66521582 0.18660863 -19 0.36538462 0 0.12321252 0.65786560 0.21892187 -20 0.38461538 0 0.10157791 0.64481869 0.25360340 -21 0.40384615 0 0.08327170 0.62665116 0.29007714 -22 0.42307692 0 0.06829389 0.60393908 0.32776703 -23 0.44230769 0 0.05664448 0.57725852 0.36609700 -24 0.46153846 0 0.04832347 0.54718556 0.40449097 -25 0.48076923 0 0.04333087 0.51429625 0.44237289 -26 0.50000000 0 0.04166667 0.47916667 0.47916667 -27 0.51923077 0 0.04333087 0.44237289 0.51429625 -28 0.53846154 0 0.04832347 0.40449097 0.54718556 -29 0.55769231 0 0.05664448 0.36609700 0.57725852 -30 0.57692308 0 0.06829389 0.32776703 0.60393908 -31 0.59615385 0 0.08327170 0.29007714 0.62665116 -32 0.61538462 0 0.10157791 0.25360340 0.64481869 -33 0.63461538 0 0.12321252 0.21892187 0.65786560 -34 0.65384615 0 0.14817554 0.18660863 0.66521582 -35 0.67307692 0 0.17646341 0.15723619 0.66630040 -36 0.69230769 0 0.20785920 0.13116371 0.66097709 -37 0.71153846 0 0.24181531 0.10841963 0.64976507 -38 0.73076923 0 0.27775565 0.08900394 0.63324040 -39 0.75000000 0 0.31510417 0.07291667 0.61197917 -40 0.76923077 0 0.35328478 0.06015779 0.58655743 -41 0.78846154 0 0.39172143 0.05072732 0.55755125 -42 0.80769231 0 0.42983804 0.04462525 0.52553672 -43 0.82692308 0 0.46705854 0.04185158 0.49108989 -44 0.84615385 0 0.50280686 0.04240631 0.45478683 -45 0.86538462 0 0.53650693 0.04628945 0.41720362 -46 0.88461538 0 0.56758269 0.05350099 0.37891633 -47 0.90384615 0 0.59545806 0.06404093 0.34050101 -48 0.92307692 0 0.61955697 0.07790927 0.30253376 -49 0.94230769 0 0.63930336 0.09510602 0.26559063 -50 0.96153846 0 0.65412115 0.11563116 0.23024769 -51 0.98076923 0 0.66343428 0.13948471 0.19708101 -52 1.00000000 0 0.66666667 0.16666667 0.16666667 -53 1.01923077 0 0.66343428 0.19708101 0.13948471 -54 1.03846154 0 0.65412115 0.23024769 0.11563116 -55 1.05769231 0 0.63930336 0.26559063 0.09510602 -56 1.07692308 0 0.61955697 0.30253376 0.07790927 -57 1.09615385 0 0.59545806 0.34050101 0.06404093 -58 1.11538462 0 0.56758269 0.37891633 0.05350099 -59 1.13461538 0 0.53650693 0.41720362 0.04628945 -60 1.15384615 0 0.50280686 0.45478683 0.04240631 -61 1.17307692 0 0.46705854 0.49108989 0.04185158 -62 1.19230769 0 0.42983804 0.52553672 0.04462525 -63 1.21153846 0 0.39172143 0.55755125 0.05072732 -64 1.23076923 0 0.35328478 0.58655743 0.06015779 -65 1.25000000 0 0.31510417 0.61197917 0.07291667 -66 1.26923077 0 0.27775565 0.63324040 0.08900394 -67 1.28846154 0 0.24181531 0.64976507 0.10841963 -68 1.30769231 0 0.20785920 0.66097709 0.13116371 -69 1.32692308 0 0.17646341 0.66630040 0.15723619 -70 1.34615385 0 0.14817554 0.66521582 0.18660863 -71 1.36538462 0 0.12321252 0.65786560 0.21892187 -72 1.38461538 0 0.10157791 0.64481869 0.25360340 -73 1.40384615 0 0.08327170 0.62665116 0.29007714 -74 1.42307692 0 0.06829389 0.60393908 0.32776703 -75 1.44230769 0 0.05664448 0.57725852 0.36609700 -76 1.46153846 0 0.04832347 0.54718556 0.40449097 -77 1.48076923 0 0.04333087 0.51429625 0.44237289 -78 1.50000000 0 0.04166667 0.47916667 0.47916667 -79 1.51923077 0 0.04333087 0.44237289 0.51429625 -80 1.53846154 0 0.04832347 0.40449097 0.54718556 -81 1.55769231 0 0.05664448 0.36609700 0.57725852 -82 1.57692308 0 0.06829389 0.32776703 0.60393908 -83 1.59615385 0 0.08327170 0.29007714 0.62665116 -84 1.61538462 0 0.10157791 0.25360340 0.64481869 -85 1.63461538 0 0.12321252 0.21892187 0.65786560 -86 1.65384615 0 0.14817554 0.18660863 0.66521582 -87 1.67307692 0 0.17646341 0.15723619 0.66630040 -88 1.69230769 0 0.20785920 0.13116371 0.66097709 -89 1.71153846 0 0.24181531 0.10841963 0.64976507 -90 1.73076923 0 0.27775565 0.08900394 0.63324040 -91 1.75000000 0 0.31510417 0.07291667 0.61197917 -92 1.76923077 0 0.35328478 0.06015779 0.58655743 -93 1.78846154 0 0.39172143 0.05072732 0.55755125 -94 1.80769231 0 0.42983804 0.04462525 0.52553672 -95 1.82692308 0 0.46705854 0.04185158 0.49108989 -96 1.84615385 0 0.50280686 0.04240631 0.45478683 -97 1.86538462 0 0.53650693 0.04628945 0.41720362 -98 1.88461538 0 0.56758269 0.05350099 0.37891633 -99 1.90384615 0 0.59545806 0.06404093 0.34050101 -100 1.92307692 0 0.61955697 0.07790927 0.30253376 -101 1.94230769 0 0.63930336 0.09510602 0.26559063 -102 1.96153846 0 0.65412115 0.11563116 0.23024769 -103 1.98076923 0 0.66343428 0.13948471 0.19708101 -104 2.00000000 0 0.66666667 0.16666667 0.16666667 -105 2.01923077 0 0.66343428 0.19708101 0.13948471 -106 2.03846154 0 0.65412115 0.23024769 0.11563116 -107 2.05769231 0 0.63930336 0.26559063 0.09510602 -108 2.07692308 0 0.61955697 0.30253376 0.07790927 -109 2.09615385 0 0.59545806 0.34050101 0.06404093 -110 2.11538462 0 0.56758269 0.37891633 0.05350099 -111 2.13461538 0 0.53650693 0.41720362 0.04628945 -112 2.15384615 0 0.50280686 0.45478683 0.04240631 -113 2.17307692 0 0.46705854 0.49108989 0.04185158 -114 2.19230769 0 0.42983804 0.52553672 0.04462525 -115 2.21153846 0 0.39172143 0.55755125 0.05072732 -116 2.23076923 0 0.35328478 0.58655743 0.06015779 -117 2.25000000 0 0.31510417 0.61197917 0.07291667 -118 2.26923077 0 0.27775565 0.63324040 0.08900394 -119 2.28846154 0 0.24181531 0.64976507 0.10841963 -120 2.30769231 0 0.20785920 0.66097709 0.13116371 -121 2.32692308 0 0.17646341 0.66630040 0.15723619 -122 2.34615385 0 0.14817554 0.66521582 0.18660863 -123 2.36538462 0 0.12321252 0.65786560 0.21892187 -124 2.38461538 0 0.10157791 0.64481869 0.25360340 -125 2.40384615 0 0.08327170 0.62665116 0.29007714 -126 2.42307692 0 0.06829389 0.60393908 0.32776703 -127 2.44230769 0 0.05664448 0.57725852 0.36609700 -128 2.46153846 0 0.04832347 0.54718556 0.40449097 -129 2.48076923 0 0.04333087 0.51429625 0.44237289 -130 2.50000000 0 0.04166667 0.47916667 0.47916667 -131 2.51923077 0 0.04333087 0.44237289 0.51429625 -132 2.53846154 0 0.04832347 0.40449097 0.54718556 -133 2.55769231 0 0.05664448 0.36609700 0.57725852 -134 2.57692308 0 0.06829389 0.32776703 0.60393908 -135 2.59615385 0 0.08327170 0.29007714 0.62665116 -136 2.61538462 0 0.10157791 0.25360340 0.64481869 -137 2.63461538 0 0.12321252 0.21892187 0.65786560 -138 2.65384615 0 0.14817554 0.18660863 0.66521582 -139 2.67307692 0 0.17646341 0.15723619 0.66630040 -140 2.69230769 0 0.20785920 0.13116371 0.66097709 -141 2.71153846 0 0.24181531 0.10841963 0.64976507 -142 2.73076923 0 0.27775565 0.08900394 0.63324040 -143 2.75000000 0 0.31510417 0.07291667 0.61197917 -144 2.76923077 0 0.35328478 0.06015779 0.58655743 -145 2.78846154 0 0.39172143 0.05072732 0.55755125 -146 2.80769231 0 0.42983804 0.04462525 0.52553672 -147 2.82692308 0 0.46705854 0.04185158 0.49108989 -148 2.84615385 0 0.50280686 0.04240631 0.45478683 -149 2.86538462 0 0.53650693 0.04628945 0.41720362 -150 2.88461538 0 0.56758269 0.05350099 0.37891633 -151 2.90384615 0 0.59545806 0.06404093 0.34050101 -152 2.92307692 0 0.61955697 0.07790927 0.30253376 -153 2.94230769 0 0.63930336 0.09510602 0.26559063 -154 2.96153846 0 0.65412115 0.11563116 0.23024769 -155 2.98076923 0 0.66343428 0.13948471 0.19708101 -156 3.00000000 0 0.66666667 0.16666667 0.16666667 -157 3.01923077 0 0.66343428 0.19708101 0.13948471 -158 3.03846154 0 0.65412115 0.23024769 0.11563116 -159 3.05769231 0 0.63930336 0.26559063 0.09510602 -160 3.07692308 0 0.61955697 0.30253376 0.07790927 -161 3.09615385 0 0.59545806 0.34050101 0.06404093 -162 3.11538462 0 0.56758269 0.37891633 0.05350099 -163 3.13461538 0 0.53650693 0.41720362 0.04628945 -164 3.15384615 0 0.50280686 0.45478683 0.04240631 -165 3.17307692 0 0.46705854 0.49108989 0.04185158 -166 3.19230769 0 0.42983804 0.52553672 0.04462525 -167 3.21153846 0 0.39172143 0.55755125 0.05072732 -168 3.23076923 0 0.35328478 0.58655743 0.06015779 -169 3.25000000 0 0.31510417 0.61197917 0.07291667 -170 3.26923077 0 0.27775565 0.63324040 0.08900394 -171 3.28846154 0 0.24181531 0.64976507 0.10841963 -172 3.30769231 0 0.20785920 0.66097709 0.13116371 [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/pomp -r 961 From noreply at r-forge.r-project.org Fri May 23 18:23:12 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 23 May 2014 18:23:12 +0200 (CEST) Subject: [Pomp-commits] r962 - in pkg: . pomp Message-ID: <20140523162312.51B08186DBF@r-forge.r-project.org> Author: kingaa Date: 2014-05-23 18:23:12 +0200 (Fri, 23 May 2014) New Revision: 962 Added: pkg/Makefile Modified: pkg/pomp/DESCRIPTION Log: - add Makefile for package building and testing Added: pkg/Makefile =================================================================== --- pkg/Makefile (rev 0) +++ pkg/Makefile 2014-05-23 16:23:12 UTC (rev 962) @@ -0,0 +1,176 @@ +REPOS=/var/www/html/R/ +SRCREPOS=src/contrib +WINREPOS=bin/windows/contrib/3.1 +DOCREPOS=doc/packages +ARCHIVE=./dists +INSTALL_DIR=./library + +REXE = R --vanilla +RCMD = $(REXE) CMD +RSCRIPT = Rscript --vanilla + +PDFLATEX = pdflatex +BIBTEX = bibtex +MAKEIDX = makeindex + +RM = rm -f +CP = cp +TOUCH = touch +INSTALL = install + +default: + +.PHONY: + +pomp.dist: pomp/inst/include/pomp.h + +pomp/inst/include/pomp.h: pomp/src/pomp.h + $(CP) $^ $@ + +pompweb.vignettes: export POMP_BUILD_VIGNETTES=yes +%.dist %.manual %.vignettes: export R_QPDF=qpdf +%.dist %.manual %.vignettes: export R_GSCMD=gs +%.dist %.manual %.vignettes: export GS_QUALITY=ebook +%.dist %.manual %.vignettes: export R_HOME=$(shell $(REXE) RHOME) +%.check %.crancheck: export _R_CHECK_ALL_NON_ISO_C_=TRUE +%.check %.crancheck: export _R_CHECK_WALL_FORTRAN_=TRUE +%.check %.xcheck: export POMP_FULL_TESTS=yes +%.vignettes %.data: export R_LIBS=$(CURDIR)/library +%.bin %.check %.qcheck %.qqcheck %.xcheck %.crancheck %.upload %.publish %.clean %.install %.win: PKG = $*_$(shell perl -ne 'print $$1 if /Version:\s+(\d+\.\d+-\d+)/;' $*/DESCRIPTION) + +pompweb.vignettes: pomp.install pomp.manual + (cd pompweb/vignettes; make) + cp pomp.pdf pompweb/vignettes + $(RCMD) Rdconv -t html pomp/inst/NEWS.Rd -o pompweb/content/NEWS.html + +%.vignettes: %.install + cd $*/vignettes; make + +%.data: %.install + cd $*/inst/data-R; make + +%.win: %.dist + ncftpput -v win-builder.r-project.org R-release $(PKG).tar.gz + $(TOUCH) $@ + +%.upload: %.dist + ncftpput -v cran.r-project.org incoming $(PKG).tar.gz + $(TOUCH) $@ + +%.crandist: %.cransrc + $(RCMD) build --resave-data --compact-vignettes --md5 cran/$* + $(TOUCH) $@ + +%.crancheck: %.crandist + $(RCMD) check --as-cran --library=check $(PKG).tar.gz + $(TOUCH) $@ + +%.cransrc: + $(RM) -r cran + mkdir -p cran + svn export $* cran/$* + $(RM) -r cran/$*/tests + $(TOUCH) $@ + +%.xcheck: %.dist + $(RCMD) check --use-gct --use-valgrind --timings --library=check $(PKG).tar.gz + $(TOUCH) $@ + +%.check: %.dist + $(RCMD) check --library=check $(PKG).tar.gz + $(TOUCH) $@ + +%.qcheck: %.dist + $(RCMD) check --library=check --no-vignettes --no-tests $(PKG).tar.gz + $(TOUCH) $@ + +%.qqcheck: %.dist + $(RCMD) check --library=check --no-codoc --no-examples --no-vignettes --no-manual --no-tests $(PKG).tar.gz + $(TOUCH) $@ + +%.changelog: + $(SVN) update $* + $(SVN2CL) --include-rev --group-by-day -o $*/inst/ChangeLog $* + $(SVN) info $* | perl -ne "print if /Revision|Date/;" > $*/inst/SVN-REVISION + $(TOUCH) $@ + +%.manual: + $(RM) $*.pdf + $(RCMD) Rd2pdf --no-preview --pdf $* + $(RSCRIPT) -e "tools::compactPDF(\"$*.pdf\")"; + $(TOUCH) $@ + +%.included_manual: %.manual + $(CP) $*.pdf $*/inst/doc/manual.pdf + $(TOUCH) $@ + +%.dist: %.manual + -$(RCMD) Rdconv -t txt $*/inst/NEWS.Rd -o $*/inst/NEWS + $(RCMD) build --force --no-manual --resave-data --compact-vignettes=both $* + $(TOUCH) $@ + +%.bin: %.dist + $(RCMD) build --force --binary $(PKG).tar.gz + $(TOUCH) $@ + +%.clean: clean + $(RM) $*.dist $*.check $*.qcheck $*.qqcheck $*.crancheck $*.manual $*.cransrc + $(RM) -r $*.Rcheck check/$* cran/$* + $(RM) $*/src/*.o $*/src/*.so $*/src/symbols.rds $*/vignettes/Rplots.* + $(RM) $(PKG).tar.gz $(PKG).zip $*.pdf + +%.distclean: %.clean + $(RM) $*.win $*.upload $*.bin $*.changelog $*.crandist $*.included_manual + +%.install: %.dist + mkdir -p $(INSTALL_DIR) + $(RCMD) INSTALL --library=$(INSTALL_DIR) $(PKG).tar.gz + $(TOUCH) $@ + +%.remove: + $(RCMD) REMOVE --library=$(INSTALL_DIR) $* + $(RM) $*.install + +%.publish: %.dist %.manual + mkdir -m0755 -p $(REPOS)/$(WINREPOS) + mkdir -m0755 -p $(REPOS)/$(SRCREPOS) + mkdir -m0755 -p $(REPOS)/$(DOCREPOS) + (cd $(REPOS)/$(WINREPOS); $(RM) $*_*.zip) + (cd $(REPOS)/$(SRCREPOS); $(RM) $*_*.tar.gz) + (cd $(REPOS)/$(DOCREPOS); $(RM) $*.pdf) + -$(INSTALL) -m0644 $(PKG).zip $(REPOS)/$(WINREPOS) + -$(INSTALL) -m0644 $(PKG).tar.gz $(REPOS)/$(SRCREPOS) + -$(INSTALL) -m0644 $*.pdf $(REPOS)/$(DOCREPOS) + $(RSCRIPT) pkgindex.R winrepos="\"$(REPOS)/$(WINREPOS)\"" srcrepos="\"$(REPOS)/$(SRCREPOS)\"" + mkdir -p $(ARCHIVE) + -$(INSTALL) -m0644 $(PKG).zip $(ARCHIVE) + -$(INSTALL) -m0644 $(PKG).tar.gz $(ARCHIVE) + -$(INSTALL) -m0644 $*.pdf $(ARCHIVE) + $(RSCRIPT) pkgindex.R + +%.tex: %.Rnw + $(RCMD) Sweave $* + +%.R: %.Rnw + $(RCMD) Stangle $* + +%.pdf: %.tex + $(PDFLATEX) $* + -$(BIBTEX) $* + $(PDFLATEX) $* + $(PDFLATEX) $* + +%.bbl: %.tex + -$(PDFLATEX) $* + $(BIBTEX) $* + +%.idx: %.tex + -$(PDFLATEX) $* + +%.ind: %.idx + $(MAKEIDX) $* + +clean: + $(RM) *.o *.so *.tex *.log *.aux *.out *.nav *.snm *.toc *-???.pdf Rplots.ps Rplots.pdf + +.SECONDARY: Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2014-05-23 16:23:09 UTC (rev 961) +++ pkg/pomp/DESCRIPTION 2014-05-23 16:23:12 UTC (rev 962) @@ -2,7 +2,7 @@ Type: Package Title: Statistical inference for partially observed Markov processes Version: 0.51-1 -Date: 2014-05-21 +Date: 2014-05-23 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")), From noreply at r-forge.r-project.org Sat May 24 03:19:37 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sat, 24 May 2014 03:19:37 +0200 (CEST) Subject: [Pomp-commits] r963 - pkg Message-ID: <20140524011937.AAAD51849A4@r-forge.r-project.org> Author: kingaa Date: 2014-05-24 03:19:36 +0200 (Sat, 24 May 2014) New Revision: 963 Modified: pkg/Makefile Log: - small fixes Modified: pkg/Makefile =================================================================== --- pkg/Makefile 2014-05-23 16:23:12 UTC (rev 962) +++ pkg/Makefile 2014-05-24 01:19:36 UTC (rev 963) @@ -27,7 +27,7 @@ pomp/inst/include/pomp.h: pomp/src/pomp.h $(CP) $^ $@ -pompweb.vignettes: export POMP_BUILD_VIGNETTES=yes +../www.vignettes: export POMP_BUILD_VIGNETTES=yes %.dist %.manual %.vignettes: export R_QPDF=qpdf %.dist %.manual %.vignettes: export R_GSCMD=gs %.dist %.manual %.vignettes: export GS_QUALITY=ebook @@ -38,10 +38,10 @@ %.vignettes %.data: export R_LIBS=$(CURDIR)/library %.bin %.check %.qcheck %.qqcheck %.xcheck %.crancheck %.upload %.publish %.clean %.install %.win: PKG = $*_$(shell perl -ne 'print $$1 if /Version:\s+(\d+\.\d+-\d+)/;' $*/DESCRIPTION) -pompweb.vignettes: pomp.install pomp.manual - (cd pompweb/vignettes; make) - cp pomp.pdf pompweb/vignettes - $(RCMD) Rdconv -t html pomp/inst/NEWS.Rd -o pompweb/content/NEWS.html +../www.vignettes: pomp.install pomp.manual + (cd ../www/vignettes; make) + cp pomp.pdf ../www/vignettes + $(RCMD) Rdconv -t html pomp/inst/NEWS.Rd -o ../www/content/NEWS.html %.vignettes: %.install cd $*/vignettes; make @@ -73,27 +73,25 @@ $(TOUCH) $@ %.xcheck: %.dist + mkdir -p check $(RCMD) check --use-gct --use-valgrind --timings --library=check $(PKG).tar.gz $(TOUCH) $@ %.check: %.dist + mkdir -p check $(RCMD) check --library=check $(PKG).tar.gz $(TOUCH) $@ %.qcheck: %.dist + mkdir -p check $(RCMD) check --library=check --no-vignettes --no-tests $(PKG).tar.gz $(TOUCH) $@ %.qqcheck: %.dist + mkdir -p check $(RCMD) check --library=check --no-codoc --no-examples --no-vignettes --no-manual --no-tests $(PKG).tar.gz $(TOUCH) $@ -%.changelog: - $(SVN) update $* - $(SVN2CL) --include-rev --group-by-day -o $*/inst/ChangeLog $* - $(SVN) info $* | perl -ne "print if /Revision|Date/;" > $*/inst/SVN-REVISION - $(TOUCH) $@ - %.manual: $(RM) $*.pdf $(RCMD) Rd2pdf --no-preview --pdf $* From noreply at r-forge.r-project.org Sat May 24 03:20:10 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sat, 24 May 2014 03:20:10 +0200 (CEST) Subject: [Pomp-commits] r964 - www/vignettes Message-ID: <20140524012010.ABD161849A4@r-forge.r-project.org> Author: kingaa Date: 2014-05-24 03:20:10 +0200 (Sat, 24 May 2014) New Revision: 964 Modified: www/vignettes/advanced_topics_in_pomp.pdf 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-trajmatch.rda www/vignettes/intro_to_pomp.R www/vignettes/intro_to_pomp.Rnw www/vignettes/intro_to_pomp.pdf www/vignettes/plugin-C-code.rda www/vignettes/plugin-R-code.rda www/vignettes/pomp.pdf 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 www/vignettes/vectorized-C-code.rda www/vignettes/vectorized-R-code.rda Log: - redo most of the vignette computations - change the way 'mif' is demonstrated in the intro vignette Modified: www/vignettes/advanced_topics_in_pomp.pdf =================================================================== (Binary files differ) 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-trajmatch.rda =================================================================== (Binary files differ) Modified: www/vignettes/intro_to_pomp.R =================================================================== --- www/vignettes/intro_to_pomp.R 2014-05-24 01:19:36 UTC (rev 963) +++ www/vignettes/intro_to_pomp.R 2014-05-24 01:20:10 UTC (rev 964) @@ -430,113 +430,137 @@ ## ----gompertz-multi-mif-calc,eval=F,echo=T------------------------------- ## estpars <- c("r","sigma","tau") -## replicate( -## n=10, -## { -## theta.guess <- theta.true -## theta.guess[estpars] <- rlnorm( -## n=length(estpars), -## meanlog=log(theta.guess[estpars]), -## sdlog=1 -## ) -## mif( -## gompertz, -## Nmif=100, -## start=theta.guess, -## transform=TRUE, -## pars=estpars, -## rw.sd=c(r=0.02,sigma=0.02,tau=0.05), -## Np=2000, -## var.factor=4, -## ic.lag=10, -## cooling.type="geometric", -## cooling.fraction=0.95, -## max.fail=10 -## ) -## } -## ) -> mf +## mf <- foreach(i=1:10, +## .inorder=FALSE, +## .options.multicore=list(set.seed=TRUE) +## ) %dopar% +## { +## theta.guess <- theta.true +## theta.guess[estpars] <- rlnorm( +## n=length(estpars), +## meanlog=log(theta.guess[estpars]), +## sdlog=1 +## ) +## m1 <- mif( +## gompertz, +## Nmif=50, +## start=theta.guess, +## transform=TRUE, +## rw.sd=c(r=0.02,sigma=0.02,tau=0.05), +## Np=2000, +## var.factor=4, +## ic.lag=10, +## cooling.type="geometric", +## cooling.fraction=0.95 +## ) +## m1 <- continue(m1,Nmif=50,cooling.fraction=0.8) +## m1 <- continue(m1,Nmif=50,cooling.fraction=0.6) +## m1 <- continue(m1,Nmif=50,cooling.fraction=0.2) +## ll <- replicate(n=10,logLik(pfilter(m1,Np=10000))) +## list(mif=m1,ll=ll) +## } ## ----gompertz-post-mif,eval=F,echo=F------------------------------------- ## theta.true <- coef(gompertz) -## theta.mif <- apply(sapply(mf,coef),1,mean) -## loglik.mif <- replicate(n=10,logLik(pfilter(mf[[1]],params=theta.mif,Np=10000))) -## loglik.mif.est <- logmeanexp(loglik.mif,se=TRUE) -## loglik.true <- replicate(n=10,logLik(pfilter(gompertz,params=theta.true,Np=10000))) -## loglik.true.est <- logmeanexp(loglik.true,se=TRUE) +## loglik.true <- replicate(n=10,logLik(pfilter(gompertz,Np=10000))) +## loglik.true <- logmeanexp(loglik.true,se=TRUE) +## theta.mif <- t(sapply(mf,function(x)coef(x$mif))) +## loglik.mif <- t(sapply(mf,function(x)logmeanexp(x$ll,se=TRUE))) +## best <- which.max(loglik.mif[,1]) +## theta.mif <- theta.mif[best,] +## loglik.mif <- loglik.mif[best,] ## ----gompertz-multi-mif-eval,echo=F,results='hide'----------------------- -set.seed(334388458L) binary.file <- "gompertz-multi-mif.rda" if (file.exists(binary.file)) { load(binary.file) } else { + + require(foreach) + require(doMC) + registerDoMC() + + save.seed <- .Random.seed + set.seed(334388458L,kind="L'Ecuyer") + tic <- Sys.time() estpars <- c("r","sigma","tau") -replicate( - n=10, - { - theta.guess <- theta.true - theta.guess[estpars] <- rlnorm( - n=length(estpars), - meanlog=log(theta.guess[estpars]), - sdlog=1 - ) - mif( - gompertz, - Nmif=100, - start=theta.guess, - transform=TRUE, - pars=estpars, - rw.sd=c(r=0.02,sigma=0.02,tau=0.05), - Np=2000, - var.factor=4, - ic.lag=10, - cooling.type="geometric", - cooling.fraction=0.95, - max.fail=10 - ) - } - ) -> mf -theta.true <- coef(gompertz) -theta.mif <- apply(sapply(mf,coef),1,mean) -loglik.mif <- replicate(n=10,logLik(pfilter(mf[[1]],params=theta.mif,Np=10000))) -loglik.mif.est <- logmeanexp(loglik.mif,se=TRUE) -loglik.true <- replicate(n=10,logLik(pfilter(gompertz,params=theta.true,Np=10000))) -loglik.true.est <- logmeanexp(loglik.true,se=TRUE) +mf <- foreach(i=1:10, + .inorder=FALSE, + .options.multicore=list(set.seed=TRUE) + ) %dopar% +{ + theta.guess <- theta.true + theta.guess[estpars] <- rlnorm( + n=length(estpars), + meanlog=log(theta.guess[estpars]), + sdlog=1 + ) + m1 <- mif( + gompertz, + Nmif=50, + start=theta.guess, + transform=TRUE, + rw.sd=c(r=0.02,sigma=0.02,tau=0.05), + Np=2000, + var.factor=4, + ic.lag=10, + cooling.type="geometric", + cooling.fraction=0.95 + ) + m1 <- continue(m1,Nmif=50,cooling.fraction=0.8) + m1 <- continue(m1,Nmif=50,cooling.fraction=0.6) + m1 <- continue(m1,Nmif=50,cooling.fraction=0.2) + ll <- replicate(n=10,logLik(pfilter(m1,Np=10000))) + list(mif=m1,ll=ll) +} toc <- Sys.time() etime <- toc-tic + .Random.seed <<- save.seed + +theta.true <- coef(gompertz) +loglik.true <- replicate(n=10,logLik(pfilter(gompertz,Np=10000))) +loglik.true <- logmeanexp(loglik.true,se=TRUE) +theta.mif <- t(sapply(mf,function(x)coef(x$mif))) +loglik.mif <- t(sapply(mf,function(x)logmeanexp(x$ll,se=TRUE))) +best <- which.max(loglik.mif[,1]) +theta.mif <- theta.mif[best,] +loglik.mif <- loglik.mif[best,] + save( mf,estpars, theta.mif,theta.true, - loglik.mif.est,loglik.true.est, + loglik.mif,loglik.true, etime, file=binary.file, compress="xz" ) } rbind( - mle=c(signif(theta.mif[estpars],3),loglik=round(loglik.mif.est,2)), - truth=c(signif(theta.true[estpars],3),loglik=round(loglik.true.est,2)) + mle=c(signif(theta.mif[estpars],3),loglik=round(loglik.mif,2)), + truth=c(signif(theta.true[estpars],3),loglik=round(loglik.true,2)) ) -> results.table ## ----eval=F-------------------------------------------------------------- ## theta.true <- coef(gompertz) -## theta.mif <- apply(sapply(mf,coef),1,mean) -## loglik.mif <- replicate(n=10,logLik(pfilter(mf[[1]],params=theta.mif,Np=10000))) -## loglik.mif.est <- logmeanexp(loglik.mif,se=TRUE) -## loglik.true <- replicate(n=10,logLik(pfilter(gompertz,params=theta.true,Np=10000))) -## loglik.true.est <- logmeanexp(loglik.true,se=TRUE) +## loglik.true <- replicate(n=10,logLik(pfilter(gompertz,Np=10000))) +## loglik.true <- logmeanexp(loglik.true,se=TRUE) +## theta.mif <- t(sapply(mf,function(x)coef(x$mif))) +## loglik.mif <- t(sapply(mf,function(x)logmeanexp(x$ll,se=TRUE))) +## best <- which.max(loglik.mif[,1]) +## theta.mif <- theta.mif[best,] +## loglik.mif <- loglik.mif[best,] ## ----multi-mif-plot,echo=F,eval=F---------------------------------------- ## op <- par(mfrow=c(4,1),mar=c(3,3,0,0),mgp=c(2,1,0),bty='l') -## loglik <- sapply(mf,function(x)conv.rec(x,"loglik")) -## log.r <- sapply(mf,function(x)conv.rec(x,"r")) -## log.sigma <- sapply(mf,function(x)conv.rec(x,"sigma")) -## log.tau <- sapply(mf,function(x)conv.rec(x,"tau")) +## loglik <- sapply(mf,function(x)conv.rec(x$mif,"loglik")) +## log.r <- sapply(mf,function(x)conv.rec(x$mif,"r")) +## log.sigma <- sapply(mf,function(x)conv.rec(x$mif,"sigma")) +## log.tau <- sapply(mf,function(x)conv.rec(x$mif,"tau")) ## matplot(loglik,type='l',lty=1,xlab="",ylab=expression(log~L),xaxt='n',ylim=max(loglik,na.rm=T)+c(-12,3)) ## matplot(log.r,type='l',lty=1,xlab="",ylab=expression(log~r),xaxt='n') ## matplot(log.sigma,type='l',lty=1,xlab="",ylab=expression(log~sigma),xaxt='n') @@ -546,10 +570,10 @@ ## ----mif-plot,echo=F----------------------------------------------------- op <- par(mfrow=c(4,1),mar=c(3,3,0,0),mgp=c(2,1,0),bty='l') -loglik <- sapply(mf,function(x)conv.rec(x,"loglik")) -log.r <- sapply(mf,function(x)conv.rec(x,"r")) -log.sigma <- sapply(mf,function(x)conv.rec(x,"sigma")) -log.tau <- sapply(mf,function(x)conv.rec(x,"tau")) +loglik <- sapply(mf,function(x)conv.rec(x$mif,"loglik")) +log.r <- sapply(mf,function(x)conv.rec(x$mif,"r")) +log.sigma <- sapply(mf,function(x)conv.rec(x$mif,"sigma")) +log.tau <- sapply(mf,function(x)conv.rec(x$mif,"tau")) matplot(loglik,type='l',lty=1,xlab="",ylab=expression(log~L),xaxt='n',ylim=max(loglik,na.rm=T)+c(-12,3)) matplot(log.r,type='l',lty=1,xlab="",ylab=expression(log~r),xaxt='n') matplot(log.sigma,type='l',lty=1,xlab="",ylab=expression(log~sigma),xaxt='n') Modified: www/vignettes/intro_to_pomp.Rnw =================================================================== --- www/vignettes/intro_to_pomp.Rnw 2014-05-24 01:19:36 UTC (rev 963) +++ www/vignettes/intro_to_pomp.Rnw 2014-05-24 01:20:10 UTC (rev 964) @@ -742,31 +742,35 @@ @ <>= estpars <- c("r","sigma","tau") -replicate( - n=10, - { - theta.guess <- theta.true - theta.guess[estpars] <- rlnorm( - n=length(estpars), - meanlog=log(theta.guess[estpars]), - sdlog=1 - ) - mif( - gompertz, - Nmif=100, - start=theta.guess, - transform=TRUE, - pars=estpars, - rw.sd=c(r=0.02,sigma=0.02,tau=0.05), - Np=2000, - var.factor=4, - ic.lag=10, - cooling.type="geometric", - cooling.fraction=0.95, - max.fail=10 - ) - } - ) -> mf +mf <- foreach(i=1:10, + .inorder=FALSE, + .options.multicore=list(set.seed=TRUE) + ) %dopar% +{ + theta.guess <- theta.true + theta.guess[estpars] <- rlnorm( + n=length(estpars), + meanlog=log(theta.guess[estpars]), + sdlog=1 + ) + m1 <- mif( + gompertz, + Nmif=50, + start=theta.guess, + transform=TRUE, + rw.sd=c(r=0.02,sigma=0.02,tau=0.05), + Np=2000, + var.factor=4, + ic.lag=10, + cooling.type="geometric", + cooling.fraction=0.95 + ) + m1 <- continue(m1,Nmif=50,cooling.fraction=0.8) + m1 <- continue(m1,Nmif=50,cooling.fraction=0.6) + m1 <- continue(m1,Nmif=50,cooling.fraction=0.2) + ll <- replicate(n=10,logLik(pfilter(m1,Np=10000))) + list(mif=m1,ll=ll) +} @ Note that we've set \code{transform=TRUE} in the above. @@ -774,36 +778,48 @@ <>= theta.true <- coef(gompertz) -theta.mif <- apply(sapply(mf,coef),1,mean) -loglik.mif <- replicate(n=10,logLik(pfilter(mf[[1]],params=theta.mif,Np=10000))) -loglik.mif.est <- logmeanexp(loglik.mif,se=TRUE) -loglik.true <- replicate(n=10,logLik(pfilter(gompertz,params=theta.true,Np=10000))) -loglik.true.est <- logmeanexp(loglik.true,se=TRUE) +loglik.true <- replicate(n=10,logLik(pfilter(gompertz,Np=10000))) +loglik.true <- logmeanexp(loglik.true,se=TRUE) +theta.mif <- t(sapply(mf,function(x)coef(x$mif))) +loglik.mif <- t(sapply(mf,function(x)logmeanexp(x$ll,se=TRUE))) +best <- which.max(loglik.mif[,1]) +theta.mif <- theta.mif[best,] +loglik.mif <- loglik.mif[best,] @ <>= -set.seed(334388458L) binary.file <- "gompertz-multi-mif.rda" if (file.exists(binary.file)) { load(binary.file) } else { + + require(foreach) + require(doMC) + registerDoMC() + + save.seed <- .Random.seed + set.seed(334388458L,kind="L'Ecuyer") + tic <- Sys.time() <> -<> toc <- Sys.time() etime <- toc-tic + .Random.seed <<- save.seed + +<> + save( mf,estpars, theta.mif,theta.true, - loglik.mif.est,loglik.true.est, + loglik.mif,loglik.true, etime, file=binary.file, compress="xz" ) } rbind( - mle=c(signif(theta.mif[estpars],3),loglik=round(loglik.mif.est,2)), - truth=c(signif(theta.true[estpars],3),loglik=round(loglik.true.est,2)) + mle=c(signif(theta.mif[estpars],3),loglik=round(loglik.mif,2)), + truth=c(signif(theta.true[estpars],3),loglik=round(loglik.true,2)) ) -> results.table @ @@ -818,10 +834,10 @@ <>= op <- par(mfrow=c(4,1),mar=c(3,3,0,0),mgp=c(2,1,0),bty='l') -loglik <- sapply(mf,function(x)conv.rec(x,"loglik")) -log.r <- sapply(mf,function(x)conv.rec(x,"r")) -log.sigma <- sapply(mf,function(x)conv.rec(x,"sigma")) -log.tau <- sapply(mf,function(x)conv.rec(x,"tau")) +loglik <- sapply(mf,function(x)conv.rec(x$mif,"loglik")) +log.r <- sapply(mf,function(x)conv.rec(x$mif,"r")) +log.sigma <- sapply(mf,function(x)conv.rec(x$mif,"sigma")) +log.tau <- sapply(mf,function(x)conv.rec(x$mif,"tau")) matplot(loglik,type='l',lty=1,xlab="",ylab=expression(log~L),xaxt='n',ylim=max(loglik,na.rm=T)+c(-12,3)) matplot(log.r,type='l',lty=1,xlab="",ylab=expression(log~r),xaxt='n') matplot(log.sigma,type='l',lty=1,xlab="",ylab=expression(log~sigma),xaxt='n') Modified: www/vignettes/intro_to_pomp.pdf =================================================================== (Binary files differ) Modified: www/vignettes/plugin-C-code.rda =================================================================== (Binary files differ) Modified: www/vignettes/plugin-R-code.rda =================================================================== (Binary files differ) Modified: www/vignettes/pomp.pdf =================================================================== (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) Modified: www/vignettes/vectorized-C-code.rda =================================================================== (Binary files differ) Modified: www/vignettes/vectorized-R-code.rda =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Sat May 24 17:59:16 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sat, 24 May 2014 17:59:16 +0200 (CEST) Subject: [Pomp-commits] r965 - pkg/pomp/inst www/content www/vignettes Message-ID: <20140524155916.9823418770E@r-forge.r-project.org> Author: kingaa Date: 2014-05-24 17:59:16 +0200 (Sat, 24 May 2014) New Revision: 965 Modified: pkg/pomp/inst/NEWS.Rd www/content/NEWS.html www/vignettes/pomp.pdf Log: - update NEWS files Modified: pkg/pomp/inst/NEWS.Rd =================================================================== --- pkg/pomp/inst/NEWS.Rd 2014-05-24 01:20:10 UTC (rev 964) +++ pkg/pomp/inst/NEWS.Rd 2014-05-24 15:59:16 UTC (rev 965) @@ -1,5 +1,17 @@ \name{NEWS} \title{News for package `pomp'} +\section{Changes in \pkg{pomp} version 0.51-1}{ + \itemize{ + \item Package 'coda' is now a dependency of 'pomp'. + This package provides various generic MCMC diagnostics. + \item Features that facilitate multiple PMCMC chains have been added. + There is a 'c' method to combine 'pmcmc' objects into a 'pmcmcList' object. + Running 'conv.rec' on a 'pmcmc' or 'pmcmcList' object now produces 'coda' 'mcmc' and 'mcmc.list' objects, respectively. + Diagnostic plots are produced by running 'plot' on such objects. + \item The 'compare.pmcmc' and 'compare.abc' methods have been removed. + They are superceded by these diagnostic plots. + } +} \section{Changes in \pkg{pomp} version 0.50-9}{ \itemize{ \item Fix bug in \code{compare.pmcmc}. Modified: www/content/NEWS.html =================================================================== --- www/content/NEWS.html 2014-05-24 01:20:10 UTC (rev 964) +++ www/content/NEWS.html 2014-05-24 15:59:16 UTC (rev 965) @@ -8,6 +8,27 @@

News for package ‘pomp’

+

Changes in pomp version 0.51-1

+ + +
    +
  • Package 'coda' is now a dependency of 'pomp'. +This package provides various generic MCMC diagnostics. +

    +
  • +
  • Features that facilitate multiple PMCMC chains have been added. +There is a 'c' method to combine 'pmcmc' objects into a 'pmcmcList' object. +Running 'conv.rec' on a 'pmcmc' or 'pmcmcList' object now produces 'coda' 'mcmc' and 'mcmc.list' objects, respectively. +Diagnostic plots are produced by running 'plot' on such objects. +

    +
  • +
  • The 'compare.pmcmc' and 'compare.abc' methods have been removed. +They are superceded by these diagnostic plots. +

    +
+ + +

Changes in pomp version 0.50-9

Modified: www/vignettes/pomp.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Sat May 24 17:59:19 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sat, 24 May 2014 17:59:19 +0200 (CEST) Subject: [Pomp-commits] r966 - pkg pkg/pomp/inst www/vignettes Message-ID: <20140524155919.F086018770E@r-forge.r-project.org> Author: kingaa Date: 2014-05-24 17:59:19 +0200 (Sat, 24 May 2014) New Revision: 966 Modified: pkg/Makefile pkg/pomp/inst/NEWS www/vignettes/pomp.pdf Log: - finish updating Modified: pkg/Makefile =================================================================== --- pkg/Makefile 2014-05-24 15:59:16 UTC (rev 965) +++ pkg/Makefile 2014-05-24 15:59:19 UTC (rev 966) @@ -38,14 +38,11 @@ %.vignettes %.data: export R_LIBS=$(CURDIR)/library %.bin %.check %.qcheck %.qqcheck %.xcheck %.crancheck %.upload %.publish %.clean %.install %.win: PKG = $*_$(shell perl -ne 'print $$1 if /Version:\s+(\d+\.\d+-\d+)/;' $*/DESCRIPTION) -../www.vignettes: pomp.install pomp.manual +pomp.vignettes: pomp.install pomp.manual (cd ../www/vignettes; make) cp pomp.pdf ../www/vignettes $(RCMD) Rdconv -t html pomp/inst/NEWS.Rd -o ../www/content/NEWS.html -%.vignettes: %.install - cd $*/vignettes; make - %.data: %.install cd $*/inst/data-R; make Modified: pkg/pomp/inst/NEWS =================================================================== --- pkg/pomp/inst/NEWS 2014-05-24 15:59:16 UTC (rev 965) +++ pkg/pomp/inst/NEWS 2014-05-24 15:59:19 UTC (rev 966) @@ -1,5 +1,20 @@ _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_1-_1: + + ? Package 'coda' is now a dependency of 'pomp'. This package + provides various generic MCMC diagnostics. + + ? Features that facilitate multiple PMCMC chains have been + added. There is a 'c' method to combine 'pmcmc' objects into + a 'pmcmcList' object. Running 'conv.rec' on a 'pmcmc' or + 'pmcmcList' object now produces 'coda' 'mcmc' and 'mcmc.list' + objects, respectively. Diagnostic plots are produced by + running 'plot' on such objects. + + ? The 'compare.pmcmc' and 'compare.abc' methods have been + removed. They are superceded by these diagnostic plots. + _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?. Modified: www/vignettes/pomp.pdf =================================================================== (Binary files differ)