From noreply at r-forge.r-project.org Tue Nov 5 15:05:35 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 5 Nov 2013 15:05:35 +0100 (CET) Subject: [Pomp-commits] r864 - in branches/mif2: . R inst inst/include man src tests Message-ID: <20131105140535.1EBAB185AC9@r-forge.r-project.org> Author: kingaa Date: 2013-11-05 15:05:32 +0100 (Tue, 05 Nov 2013) New Revision: 864 Added: branches/mif2/src/SSA.f90 Removed: branches/mif2/inst/LICENSE branches/mif2/src/SSA.f Modified: branches/mif2/.Rbuildignore branches/mif2/DESCRIPTION branches/mif2/NAMESPACE branches/mif2/R/builder.R branches/mif2/R/mif.R branches/mif2/R/pfilter-methods.R branches/mif2/R/pfilter.R branches/mif2/R/profile-design.R branches/mif2/inst/NEWS branches/mif2/inst/include/pomp.h branches/mif2/man/pfilter-methods.Rd branches/mif2/man/profile-design.Rd branches/mif2/src/SSA_wrapper.c branches/mif2/src/eulermultinom.c branches/mif2/src/lookup_table.c branches/mif2/src/pomp.h branches/mif2/tests/ou2-mif.Rout.save branches/mif2/tests/pfilter.R branches/mif2/tests/pfilter.Rout.save Log: - bring mif2 branch up to date with changes to trunk Modified: branches/mif2/.Rbuildignore =================================================================== --- branches/mif2/.Rbuildignore 2013-06-11 16:28:47 UTC (rev 863) +++ branches/mif2/.Rbuildignore 2013-11-05 14:05:32 UTC (rev 864) @@ -2,5 +2,3 @@ inst/doc/(.+?)\.bst$ inst/doc/(.+?)\.R$ inst/doc/(.+?)\.png$ -^.*\.Rproj$ -^\.Rproj\.user$ Modified: branches/mif2/DESCRIPTION =================================================================== --- branches/mif2/DESCRIPTION 2013-06-11 16:28:47 UTC (rev 863) +++ branches/mif2/DESCRIPTION 2013-11-05 14:05:32 UTC (rev 864) @@ -1,27 +1,28 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.44-1 -Date: 2013-03-26 -Author: Aaron A. King, Edward L. Ionides, Carles Breto, Steve Ellner, Bruce Kendall, Dao Nguyen, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman -Maintainer: Aaron A. King -Author at R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa at umich.edu"), +Version: 0.46-1 +Date: 2013-10-30 +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")), person(given=c("Carles"),family="Breto",role=c("aut")), person(given=c("Stephen","P."),family="Ellner",role=c("ctb")), person(given=c("Matthew","J."),family="Ferrari",role=c("ctb")), person(given=c("Bruce","E."),family="Kendall",role=c("ctb")), person(given=c("Michael"),family="Lavine",role=c("ctb")), - person(given=c("Dao"),family="Nguyen",role=c("ctb")), person(given=c("Daniel","C."),family="Reuman",role=c("ctb")), person(given=c("Helen"),family="Wearing",role=c("ctb")), - person(given=c("Simon","N."),family="Wood",role=c("ctb"))) + person(given=c("Simon","N."),family="Wood",role=c("ctb")), + person(given="Dao",family="Nguyen",role=c("ctb")) ) +Maintainer: Aaron A. King +Author: Aaron A. King, Edward L. Ionides, Carles Breto, Steve Ellner, Bruce Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman, Simon N. Wood, Dao Nguyen URL: http://pomp.r-forge.r-project.org Description: Inference methods for partially-observed Markov processes -Depends: R(>= 2.14.1), stats, methods, graphics, mvtnorm, subplex, deSolve +Depends: R(>= 2.14.1), stats, graphics, mvtnorm, subplex, deSolve +Imports: methods License: GPL(>= 2) -LazyLoad: true -LazyData: false +LazyLoad: yes +LazyData: no BuildVignettes: no Collate: aaa.R authors.R version.R eulermultinom.R plugins.R parmat.R slice-design.R profile-design.R sobol.R bsplines.R sannbox.R Modified: branches/mif2/NAMESPACE =================================================================== --- branches/mif2/NAMESPACE 2013-06-11 16:28:47 UTC (rev 863) +++ branches/mif2/NAMESPACE 2013-11-05 14:05:32 UTC (rev 864) @@ -62,6 +62,7 @@ export( as.data.frame.pomp, + as.data.frame.pfilterd.pomp, reulermultinom, deulermultinom, rgammawn, Modified: branches/mif2/R/builder.R =================================================================== --- branches/mif2/R/builder.R 2013-06-11 16:28:47 UTC (rev 863) +++ branches/mif2/R/builder.R 2013-11-05 14:05:32 UTC (rev 864) @@ -107,7 +107,6 @@ decl <- list( periodic_bspline_basis_eval="\tvoid (*periodic_bspline_basis_eval)(double,double,int,int,double*);\nperiodic_bspline_basis_eval = (void (*)(double,double,int,int,double*)) R_GetCCallable(\"pomp\",\"periodic_bspline_basis_eval\");\n", - reulermultinom="\tvoid (*reulermultinom)(int,double,double*,double,double*);\nreulermultinom = (void (*)(int,double,double*,double,double*)) R_GetCCallable(\"pomp\",\"reulermultinom\");\n", get_pomp_userdata="\tconst SEXP (*get_pomp_userdata)(const char *);\npomp_get_userdata = (const SEXP (*)(const char*)) R_GetCCallable(\"pomp\",\"get_pomp_userdata\");\n", get_pomp_userdata_int="\tconst int * (*get_pomp_userdata_int)(const char *);\npomp_get_userdata_int = (const int *(*)(const char*)) R_GetCCallable(\"pomp\",\"get_pomp_userdata_int\");\n", get_pomp_userdata_double="\tconst double * (*get_pomp_userdata_double)(const char *);\npomp_get_userdata_double = (const double *(*)(const char*)) R_GetCCallable(\"pomp\",\"get_pomp_userdata_double\");\n" Modified: branches/mif2/R/mif.R =================================================================== --- branches/mif2/R/mif.R 2013-06-11 16:28:47 UTC (rev 863) +++ branches/mif2/R/mif.R 2013-11-05 14:05:32 UTC (rev 864) @@ -2,55 +2,55 @@ default.pomp.particles.fun <- function (Np, center, sd, ...) { matrix( - data=rnorm( - n=Np*length(center), - mean=center, - sd=sd - ), - nrow=length(center), - ncol=Np, - dimnames=list( - names(center), - NULL - ) - ) + data=rnorm( + n=Np*length(center), + mean=center, + sd=sd + ), + nrow=length(center), + ncol=Np, + dimnames=list( + names(center), + NULL + ) + ) } cooling.function <- function (type, perobs, fraction, ntimes) { switch( - type, - geometric={ - factor <- fraction^(1/50) - if (perobs) { - function (nt, m) { - alpha <- factor^(nt/ntimes+m-1) - list(alpha=alpha,gamma=alpha^2) - } - } else { - function (nt, m) { - alpha <- factor^(m-1) - list(alpha=alpha,gamma=alpha^2) - } - } - }, - hyperbolic={ - if (perobs) { - scal <- (50*ntimes*fraction-1)/(1-fraction) - function (nt, m) { - alpha <- (1+scal)/(scal+nt+ntimes*(m-1)) - list(alpha=alpha,gamma=alpha^2) - } - } else { - scal <- (50*fraction-1)/(1-fraction) - function (nt, m) { - alpha <- (1+scal)/(scal+m-1) - list(alpha=alpha,gamma=alpha^2) - } - - } - }, - stop("unrecognized cooling schedule type ",sQuote(type)) - ) + type, + geometric={ + factor <- fraction^(1/50) + if (perobs) { + function (nt, m) { + alpha <- factor^(nt/ntimes+m-1) + list(alpha=alpha,gamma=alpha^2) + } + } else { + function (nt, m) { + alpha <- factor^(m-1) + list(alpha=alpha,gamma=alpha^2) + } + } + }, + hyperbolic={ + if (perobs) { + scal <- (50*ntimes*fraction-1)/(1-fraction) + function (nt, m) { + alpha <- (1+scal)/(scal+nt+ntimes*(m-1)) + list(alpha=alpha,gamma=alpha^2) + } + } else { + scal <- (50*fraction-1)/(1-fraction) + function (nt, m) { + alpha <- (1+scal)/(scal+m-1) + list(alpha=alpha,gamma=alpha^2) + } + + } + }, + stop("unrecognized cooling schedule type ",sQuote(type)) + ) } mif.cooling <- function (factor, n) { # default geometric cooling schedule @@ -95,10 +95,10 @@ if (length(start)==0) stop( - "mif error: ",sQuote("start")," must be specified if ", - sQuote("coef(object)")," is NULL", - call.=FALSE - ) + "mif error: ",sQuote("start")," must be specified if ", + sQuote("coef(object)")," is NULL", + call.=FALSE + ) if (transform) start <- partrans(object,start,dir="inverse") @@ -112,7 +112,7 @@ stop("mif error: ",sQuote("rw.sd")," must be a named non-negative numerical vector",call.=FALSE) if (!all(rw.names%in%start.names)) stop("mif error: all the names of ",sQuote("rw.sd")," must be names of ",sQuote("start"),call.=FALSE) - #rw.names <- names(rw.sd[rw.sd>0]) + #rw.names <- names(rw.sd[rw.sd>0]) if (length(rw.names) == 0) stop("mif error: ",sQuote("rw.sd")," must have one positive entry for each parameter to be estimated",call.=FALSE) @@ -120,7 +120,7 @@ if (missing(ivps)) stop("mif error: ",sQuote("ivps")," must be specified",call.=FALSE) if ( - !is.character(pars) || + !is.character(pars) || !is.character(ivps) || !all(pars%in%start.names) || !all(ivps%in%start.names) || @@ -128,32 +128,32 @@ any(ivps%in%pars) || !all(pars%in%rw.names) || !all(ivps%in%rw.names) - ) + ) stop( - "mif error: ", - sQuote("pars")," and ",sQuote("ivps"), - " must be mutually disjoint subsets of ", - sQuote("names(start)"), - " and must have a positive random-walk SDs specified in ", - sQuote("rw.sd"), - call.=FALSE - ) + "mif error: ", + sQuote("pars")," and ",sQuote("ivps"), + " must be mutually disjoint subsets of ", + sQuote("names(start)"), + " and must have a positive random-walk SDs specified in ", + sQuote("rw.sd"), + call.=FALSE + ) if (!all(rw.names%in%c(pars,ivps))) { extra.rws <- rw.names[!(rw.names%in%c(pars,ivps))] warning( - ngettext(length(extra.rws),"mif warning: the variable ", - "mif warning: the variables "), - paste(sQuote(extra.rws),collapse=", "), - ngettext(length(extra.rws)," has positive random-walk SD specified, but is included in neither ", - " have positive random-walk SDs specified, but are included in neither "), - sQuote("pars")," nor ",sQuote("ivps"), - ngettext(length(extra.rws),". This random walk SD will be ignored.", - ". These random walk SDs will be ignored."), - call.=FALSE - ) + ngettext(length(extra.rws),"mif warning: the variable ", + "mif warning: the variables "), + paste(sQuote(extra.rws),collapse=", "), + ngettext(length(extra.rws)," has positive random-walk SD specified, but is included in neither ", + " have positive random-walk SDs specified, but are included in neither "), + sQuote("pars")," nor ",sQuote("ivps"), + ngettext(length(extra.rws),". This random walk SD will be ignored.", + ". These random walk SDs will be ignored."), + call.=FALSE + ) } - #rw.sd <- rw.sd[c(pars,ivps)] + #rw.sd <- rw.sd[c(pars,ivps)] rw.names <- colnames(rw.sd) rwsdMat <-rw.sd if (missing(particles)) @@ -163,9 +163,9 @@ if (missing(Np)) stop("mif error: ",sQuote("Np")," must be specified",call.=FALSE) if (is.function(Np)) { Np <- try( - vapply(seq.int(from=0,to=ntimes,by=1),Np,numeric(1)), - silent=FALSE - ) + vapply(seq.int(from=0,to=ntimes,by=1),Np,numeric(1)), + silent=FALSE + ) if (inherits(Np,"try-error")) stop("if ",sQuote("Np")," is a function, it must return a single positive integer") } @@ -185,20 +185,20 @@ stop("mif error: ",sQuote("ic.lag")," must be a positive integer",call.=FALSE) if (ic.lag>ntimes) { warning( - "mif warning: ",sQuote("ic.lag")," = ",ic.lag," > ",ntimes, - " = length(time(",sQuote("object"),"))", - " is nonsensical. Setting ",sQuote("ic.lag")," = ",ntimes,".", - call.=FALSE - ) + "mif warning: ",sQuote("ic.lag")," = ",ic.lag," > ",ntimes, + " = length(time(",sQuote("object"),"))", + " is nonsensical. Setting ",sQuote("ic.lag")," = ",ntimes,".", + call.=FALSE + ) ic.lag <- length(time(object)) } if ((length(pars)==0)&&(ic.lag0] + pars <- rw.names[!(rw.names%in%ivps)] + } + for (i in 1:length(rw.names)) + { if (rw.names[i] %in% ivps) + { + rwsdMat[1,rw.names[i]] <- rw.sd[rw.names[i]] + + } + else if (rw.names[i] %in% pars) + { + rwsdMat[,rw.names[i]] <- rep(rw.sd[rw.names[i]],(ntimes+1)) + } + + } + + + + } + + + + if (missing(Np)) + stop("mif error: ",sQuote("Np")," must be specified",call.=FALSE) + if (missing(ic.lag) && length(ivps)>0) + stop("mif error: ",sQuote("ic.lag")," must be specified if ",sQuote("ivps")," are",call.=FALSE) + if (missing(var.factor)) + stop("mif error: ",sQuote("var.factor")," must be specified",call.=FALSE) + + cooling.type <- match.arg(cooling.type) + + if (missing(particles)) { # use default: normal distribution + particles <- default.pomp.particles.fun + } else { + particles <- match.fun(particles) + if (!all(c('Np','center','sd','...')%in%names(formals(particles)))) + stop( + "mif error: ", + sQuote("particles"), + " must be a function of prototype ", + sQuote("particles(Np,center,sd,...)"), + call.=FALSE + ) + } + + mif.internal( + object=object, + Nmif=Nmif, + start=start, + pars=pars, + ivps=ivps, + particles=particles, + rw.sd=rwsdMat, + Np=Np, + cooling.type=cooling.type, + cooling.factor=cooling.factor, + cooling.fraction=cooling.fraction, + var.factor=var.factor, + ic.lag=ic.lag, + method=method, + tol=tol, + max.fail=max.fail, + verbose=verbose, + transform=transform + ) + } - } - - } - - } - else if (is.vector(rw.sd)) - { - if (missing(pars)) { - rw.names <- names(rw.sd)[rw.sd>0] - pars <- rw.names[!(rw.names%in%ivps)] - } - for (i in 1:length(rw.names)) - { if (rw.names[i] %in% ivps) - { - rwsdMat[1,rw.names[i]] <- rw.sd[rw.names[i]] - - } - else if (rw.names[i] %in% pars) - { - rwsdMat[,rw.names[i]] <- rep(rw.sd[rw.names[i]],(ntimes+1)) - } - - } - - - - } - - - - if (missing(Np)) - stop("mif error: ",sQuote("Np")," must be specified",call.=FALSE) - if (missing(ic.lag) && length(ivps)>0) - stop("mif error: ",sQuote("ic.lag")," must be specified if ",sQuote("ivps")," are",call.=FALSE) - if (missing(var.factor)) - stop("mif error: ",sQuote("var.factor")," must be specified",call.=FALSE) - - cooling.type <- match.arg(cooling.type) - - if (missing(particles)) { # use default: normal distribution - particles <- default.pomp.particles.fun - } else { - particles <- match.fun(particles) - if (!all(c('Np','center','sd','...')%in%names(formals(particles)))) - stop( - "mif error: ", - sQuote("particles"), - " must be a function of prototype ", - sQuote("particles(Np,center,sd,...)"), - call.=FALSE - ) - } - - mif.internal( - object=object, - Nmif=Nmif, - start=start, - pars=pars, - ivps=ivps, - particles=particles, - rw.sd=rwsdMat, - Np=Np, - cooling.type=cooling.type, - cooling.factor=cooling.factor, - cooling.fraction=cooling.fraction, - var.factor=var.factor, - ic.lag=ic.lag, - method=method, - tol=tol, - max.fail=max.fail, - verbose=verbose, - transform=transform - ) - - } -) + ) setMethod( - "mif", - signature=signature(object="pfilterd.pomp"), - function (object, Nmif = 1, Np, tol, - ...) { - - if (missing(Np)) Np <- object at Np - if (missing(tol)) tol <- object at tol - - mif( - object=as(object,"pomp"), - Nmif=Nmif, - Np=Np, - tol=tol, - ... - ) - } -) + "mif", + signature=signature(object="pfilterd.pomp"), + function (object, Nmif = 1, Np, tol, + ...) { + + if (missing(Np)) Np <- object at Np + if (missing(tol)) tol <- object at tol + + mif( + object=as(object,"pomp"), + Nmif=Nmif, + Np=Np, + tol=tol, + ... + ) + } + ) setMethod( - "mif", - signature=signature(object="mif"), - function (object, Nmif, - start, - pars, ivps, - particles, rw.sd, - Np, ic.lag, var.factor, - cooling.type, cooling.fraction, - method, - tol, - transform, - ...) { - - if (missing(Nmif)) Nmif <- object at Nmif - if (missing(start)) start <- coef(object) - if (missing(pars)) pars <- object at pars - if (missing(ivps)) ivps <- object at ivps - if (missing(particles)) particles <- object at particles - if (missing(rw.sd)) rw.sd <- object at random.walk.sd - if (missing(ic.lag)) ic.lag <- object at ic.lag - if (missing(var.factor)) var.factor <- object at var.factor - if (missing(cooling.type)) cooling.type <- object at cooling.type - if (missing(cooling.fraction)) cooling.fraction <- object at cooling.fraction - if (missing(method)) method <- object at method - if (missing(transform)) transform <- object at transform - transform <- as.logical(transform) - - if (missing(Np)) Np <- object at Np - if (missing(tol)) tol <- object at tol - - mif( - object=as(object,"pomp"), - Nmif=Nmif, - start=start, - pars=pars, - ivps=ivps, - particles=particles, - rw.sd=rw.sd, - Np=Np, - cooling.type=cooling.type, - cooling.fraction=cooling.fraction, - var.factor=var.factor, - ic.lag=ic.lag, - method=method, - tol=tol, - transform=transform, - ... - ) - } -) + "mif", + signature=signature(object="mif"), + function (object, Nmif, + start, + pars, ivps, + particles, rw.sd, + Np, ic.lag, var.factor, + cooling.type, cooling.fraction, + method, + tol, + transform, + ...) { + + if (missing(Nmif)) Nmif <- object at Nmif + if (missing(start)) start <- coef(object) + if (missing(pars)) pars <- object at pars + if (missing(ivps)) ivps <- object at ivps + if (missing(particles)) particles <- object at particles + if (missing(rw.sd)) rw.sd <- object at random.walk.sd + if (missing(ic.lag)) ic.lag <- object at ic.lag + if (missing(var.factor)) var.factor <- object at var.factor + if (missing(cooling.type)) cooling.type <- object at cooling.type + if (missing(cooling.fraction)) cooling.fraction <- object at cooling.fraction + if (missing(method)) method <- object at method + if (missing(transform)) transform <- object at transform + transform <- as.logical(transform) + + if (missing(Np)) Np <- object at Np + if (missing(tol)) tol <- object at tol + + mif( + object=as(object,"pomp"), + Nmif=Nmif, + start=start, + pars=pars, + ivps=ivps, + particles=particles, + rw.sd=rw.sd, + Np=Np, + cooling.type=cooling.type, + cooling.fraction=cooling.fraction, + var.factor=var.factor, + ic.lag=ic.lag, + method=method, + tol=tol, + transform=transform, + ... + ) + } + ) setMethod( - 'continue', - signature=signature(object='mif'), - function (object, Nmif = 1, - ...) { - - ndone <- object at Nmif - - obj <- mif( [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/pomp -r 864 From noreply at r-forge.r-project.org Tue Nov 5 18:22:33 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 5 Nov 2013 18:22:33 +0100 (CET) Subject: [Pomp-commits] r865 - in pkg/pompExamples: . inst vignettes Message-ID: <20131105172233.6B619184724@r-forge.r-project.org> Author: kingaa Date: 2013-11-05 18:22:33 +0100 (Tue, 05 Nov 2013) New Revision: 865 Added: pkg/pompExamples/vignettes/ Removed: pkg/pompExamples/inst/LICENSE pkg/pompExamples/inst/doc/ Modified: pkg/pompExamples/.Rbuildignore pkg/pompExamples/DESCRIPTION pkg/pompExamples/NAMESPACE pkg/pompExamples/vignettes/budmoth-model.Rnw pkg/pompExamples/vignettes/budmoth-model.pdf pkg/pompExamples/vignettes/pertussis-model.Rnw pkg/pompExamples/vignettes/pertussis-model.pdf Log: - changes to bring 'pompExamples' up to date with the package building and checking process - vignettes are now rebuilt Modified: pkg/pompExamples/.Rbuildignore =================================================================== --- pkg/pompExamples/.Rbuildignore 2013-11-05 14:05:32 UTC (rev 864) +++ pkg/pompExamples/.Rbuildignore 2013-11-05 17:22:33 UTC (rev 865) @@ -1,6 +1,3 @@ -inst/doc/Makefile +vignettes/Makefile inst/data-R/Makefile -inst/doc/(.+?)\.bst$ -inst/doc/(.+?)\.R$ -inst/doc/(.+?)\.png$ -inst/doc/(.+?)\.pbs$ +vignettes/(.+?)\.pbs$ Modified: pkg/pompExamples/DESCRIPTION =================================================================== --- pkg/pompExamples/DESCRIPTION 2013-11-05 14:05:32 UTC (rev 864) +++ pkg/pompExamples/DESCRIPTION 2013-11-05 17:22:33 UTC (rev 865) @@ -1,23 +1,24 @@ Package: pompExamples Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.21-3 -Date: 2013-06-11 +Version: 0.21-4 +Date: 2013-11-05 Maintainer: Aaron A. King 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")), person(given=c("Carles"),family="Breto",role=c("aut")), person(given=c("Stephen","P."),family="Ellner",role=c("ctb")), + person(given=c("Bruce","E."),family="Kendall",role=c("ctb")), + person(given=c("Helen"),family="Wearing",role=c("ctb")), person(given=c("Matthew","J."),family="Ferrari",role=c("ctb")), - person(given=c("Bruce","E."),family="Kendall",role=c("ctb")), person(given=c("Michael"),family="Lavine",role=c("ctb")), - person(given=c("Daniel","C."),family="Reuman",role=c("ctb")), - person(given=c("Helen"),family="Wearing",role=c("ctb"))) + person(given=c("Daniel","C."),family="Reuman",role=c("ctb"))) +Maintainer: Aaron A. King URL: http://pomp.r-forge.r-project.org Description: More 'pomp' examples. -Depends: R(>= 3.0.0), stats, methods, graphics, pomp(>= 0.45-4) +Depends: R(>= 3.0.0), stats, graphics, pomp(>= 0.45-4) +Suggests: Rmpi,mpifarm,plyr,reshape2,ggplot2,xtable License: GPL (>= 2) -LazyLoad: true LazyData: false -BuildVignettes: no +BuildVignettes: true Collate: version.R budmoth.R pertussis.R Modified: pkg/pompExamples/NAMESPACE =================================================================== --- pkg/pompExamples/NAMESPACE 2013-11-05 14:05:32 UTC (rev 864) +++ pkg/pompExamples/NAMESPACE 2013-11-05 17:22:33 UTC (rev 865) @@ -1,3 +1,3 @@ useDynLib(pompExamples) -importFrom(pomp) +import(pomp) export(pertussis.sim,budmoth.sim) Deleted: pkg/pompExamples/inst/LICENSE =================================================================== --- pkg/pompExamples/inst/LICENSE 2013-11-05 14:05:32 UTC (rev 864) +++ pkg/pompExamples/inst/LICENSE 2013-11-05 17:22:33 UTC (rev 865) @@ -1,16 +0,0 @@ -The POMP package: Inference for partially-observed Markov processes - -This package is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or (at -your option) any later version. - -This package is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave., Cambridge, MA 02139 USA. - Modified: pkg/pompExamples/vignettes/budmoth-model.Rnw =================================================================== --- pkg/pompExamples/inst/doc/budmoth-model.Rnw 2013-11-05 14:05:32 UTC (rev 864) +++ pkg/pompExamples/vignettes/budmoth-model.Rnw 2013-11-05 17:22:33 UTC (rev 865) @@ -24,7 +24,7 @@ \newcommand\logit{{\mathrm{logit}}} \newcommand\expit{{\mathrm{expit}}} -\SweaveOpts{echo=T,results=verbatim,print=F,eps=F,pdf=F,png=T,keep.source=T,split=T,prefix=T,prefix.string=budmoth-model,resolution=150} +\SweaveOpts{echo=T,results=verbatim,print=F,eps=F,pdf=F,png=T,keep.source=T,split=F,prefix=T,prefix.string=budmoth-model,resolution=150} \title{Larch Budmoth State-Space Model} \author{AAK, ELI, SPE, KBN} @@ -159,7 +159,7 @@ <>= require(pompExamples) require(plyr) -require(reshape) +require(reshape2) require(ggplot2) data(budmoth.sim) x <- ldply(budmoth.sim,as.data.frame) @@ -429,9 +429,11 @@ <>= require(ggplot2) require(plyr) -require(reshape) -x <- melt(slices,id.vars=c(".id","dataset","slice","loglik","nfail","etime")) -x$.id <- NULL +require(reshape2) +slices$.id <- NULL +slices$etime <- NULL +slices$nfail <- NULL +x <- melt(slices,id.vars=c("dataset","slice","loglik")) x$slice <- factor(x$slice,levels=levels(x$variable)) x <- subset(x,slice==variable) x <- ddply(x,~dataset+slice,subset,loglik>max(loglik)-50) Modified: pkg/pompExamples/vignettes/budmoth-model.pdf =================================================================== (Binary files differ) Modified: pkg/pompExamples/vignettes/pertussis-model.Rnw =================================================================== --- pkg/pompExamples/inst/doc/pertussis-model.Rnw 2013-11-05 14:05:32 UTC (rev 864) +++ pkg/pompExamples/vignettes/pertussis-model.Rnw 2013-11-05 17:22:33 UTC (rev 865) @@ -370,7 +370,7 @@ <>= require(ggplot2) require(plyr) -require(reshape) +require(reshape2) require(pompExamples) data(pertussis.sim) x <- ldply(pertussis.sim,as.data.frame) Modified: pkg/pompExamples/vignettes/pertussis-model.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Tue Nov 5 18:47:53 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 5 Nov 2013 18:47:53 +0100 (CET) Subject: [Pomp-commits] r866 - in pkg/pomp: . inst Message-ID: <20131105174753.B7F3C184F3E@r-forge.r-project.org> Author: kingaa Date: 2013-11-05 18:47:53 +0100 (Tue, 05 Nov 2013) New Revision: 866 Added: pkg/pomp/vignettes/ Removed: pkg/pomp/inst/LICENSE pkg/pomp/inst/doc/ Modified: pkg/pomp/DESCRIPTION pkg/pomp/NAMESPACE Log: - keeping up with changes to the package build and check processes Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2013-11-05 17:22:33 UTC (rev 865) +++ pkg/pomp/DESCRIPTION 2013-11-05 17:47:53 UTC (rev 866) @@ -1,9 +1,8 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.45-4 -Date: 2013-06-06 -Maintainer: Aaron A. King +Version: 0.45-5 +Date: 2013-11-05 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")), person(given=c("Carles"),family="Breto",role=c("aut")), @@ -15,13 +14,14 @@ person(given=c("Helen"),family="Wearing",role=c("ctb")), person(given=c("Simon","N."),family="Wood",role=c("ctb")), person(given="Dao",family="Nguyen",role=c("ctb")) ) +Maintainer: Aaron A. King +Author: Aaron A. King, Edward L. Ionides, Carles Breto, Steve Ellner, Bruce Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman, Simon N. Wood, Dao Nguyen URL: http://pomp.r-forge.r-project.org Description: Inference methods for partially-observed Markov processes -Depends: R(>= 2.14.1), stats, methods, graphics, mvtnorm, subplex, deSolve +Depends: R(>= 2.14.1), stats, graphics, methods, mvtnorm, subplex, deSolve License: GPL(>= 2) -LazyLoad: true -LazyData: false -BuildVignettes: no +LazyData: true +BuildVignettes: true Collate: aaa.R authors.R version.R eulermultinom.R plugins.R parmat.R slice-design.R profile-design.R sobol.R bsplines.R sannbox.R pomp-fun.R pomp-class.R pomp.R pomp-methods.R Modified: pkg/pomp/NAMESPACE =================================================================== --- pkg/pomp/NAMESPACE 2013-11-05 17:22:33 UTC (rev 865) +++ pkg/pomp/NAMESPACE 2013-11-05 17:47:53 UTC (rev 866) @@ -29,6 +29,7 @@ do_init_state ) +import(methods) importFrom(graphics,plot) importFrom(stats,simulate,time,coef,logLik,window) importFrom(mvtnorm,dmvnorm,rmvnorm) Deleted: pkg/pomp/inst/LICENSE =================================================================== --- pkg/pomp/inst/LICENSE 2013-11-05 17:22:33 UTC (rev 865) +++ pkg/pomp/inst/LICENSE 2013-11-05 17:47:53 UTC (rev 866) @@ -1,16 +0,0 @@ -The POMP package: Inference for partially-observed Markov processes - -This package is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or (at -your option) any later version. - -This package is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave., Cambridge, MA 02139 USA. - From noreply at r-forge.r-project.org Tue Nov 5 23:58:31 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 5 Nov 2013 23:58:31 +0100 (CET) Subject: [Pomp-commits] r867 - www/vignettes Message-ID: <20131105225831.87959184FD6@r-forge.r-project.org> Author: kingaa Date: 2013-11-05 23:58:31 +0100 (Tue, 05 Nov 2013) New Revision: 867 Modified: www/vignettes/advanced_topics_in_pomp.pdf www/vignettes/intro_to_pomp.pdf Log: - update vignettes Modified: www/vignettes/advanced_topics_in_pomp.pdf =================================================================== (Binary files differ) Modified: www/vignettes/intro_to_pomp.pdf =================================================================== (Binary files differ) From noreply at r-forge.r-project.org Mon Nov 11 02:28:49 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 11 Nov 2013 02:28:49 +0100 (CET) Subject: [Pomp-commits] r868 - in pkg/pomp: . R inst man Message-ID: <20131111012849.294E21853F5@r-forge.r-project.org> Author: kingaa Date: 2013-11-11 02:28:48 +0100 (Mon, 11 Nov 2013) New Revision: 868 Added: pkg/pomp/R/logmeanexp.R pkg/pomp/man/logmeanexp.Rd Modified: pkg/pomp/DESCRIPTION pkg/pomp/NAMESPACE pkg/pomp/R/builder.R pkg/pomp/inst/NEWS pkg/pomp/man/builder.Rd Log: - add 'logmeanexp' - fix 'pompBuilder' codes for windows Modified: pkg/pomp/DESCRIPTION =================================================================== --- pkg/pomp/DESCRIPTION 2013-11-05 22:58:31 UTC (rev 867) +++ pkg/pomp/DESCRIPTION 2013-11-11 01:28:48 UTC (rev 868) @@ -1,21 +1,24 @@ Package: pomp Type: Package Title: Statistical inference for partially observed Markov processes -Version: 0.45-5 -Date: 2013-11-05 -Authors at R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa at umich.edu"), +Version: 0.45-6 +Date: 2013-11-10 +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")), person(given=c("Carles"),family="Breto",role=c("aut")), person(given=c("Stephen","P."),family="Ellner",role=c("ctb")), person(given=c("Matthew","J."),family="Ferrari",role=c("ctb")), person(given=c("Bruce","E."),family="Kendall",role=c("ctb")), person(given=c("Michael"),family="Lavine",role=c("ctb")), + person(given="Dao",family="Nguyen",role=c("ctb")), person(given=c("Daniel","C."),family="Reuman",role=c("ctb")), person(given=c("Helen"),family="Wearing",role=c("ctb")), - person(given=c("Simon","N."),family="Wood",role=c("ctb")), - person(given="Dao",family="Nguyen",role=c("ctb")) ) + person(given=c("Simon","N."),family="Wood",role=c("ctb")) + ) Maintainer: Aaron A. King -Author: Aaron A. King, Edward L. Ionides, Carles Breto, Steve Ellner, Bruce Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman, Simon N. Wood, Dao Nguyen +Author: Aaron A. King, Edward L. Ionides, Carles Breto, Stephen P. Ellner, Matthew J. Ferrari, Bruce E. Kendall, Michael Lavine, Dao Nguyen, Daniel C. Reuman, Helen Wearing, Simon N. Wood URL: http://pomp.r-forge.r-project.org Description: Inference methods for partially-observed Markov processes Depends: R(>= 2.14.1), stats, graphics, methods, mvtnorm, subplex, deSolve @@ -23,7 +26,8 @@ LazyData: true BuildVignettes: true Collate: aaa.R authors.R version.R eulermultinom.R plugins.R - parmat.R slice-design.R profile-design.R sobol.R bsplines.R sannbox.R + parmat.R logmeanexp.R slice-design.R + profile-design.R sobol.R bsplines.R sannbox.R pomp-fun.R pomp-class.R pomp.R pomp-methods.R rmeasure-pomp.R rprocess-pomp.R init-state-pomp.R dmeasure-pomp.R dprocess-pomp.R skeleton-pomp.R simulate-pomp.R trajectory-pomp.R plot-pomp.R Modified: pkg/pomp/NAMESPACE =================================================================== --- pkg/pomp/NAMESPACE 2013-11-05 22:58:31 UTC (rev 867) +++ pkg/pomp/NAMESPACE 2013-11-11 01:28:48 UTC (rev 868) @@ -81,6 +81,7 @@ compare.mif, nlf, parmat, + logmeanexp, probe.mean, probe.median, probe.var, Modified: pkg/pomp/R/builder.R =================================================================== --- pkg/pomp/R/builder.R 2013-11-05 22:58:31 UTC (rev 867) +++ pkg/pomp/R/builder.R 2013-11-11 01:28:48 UTC (rev 868) @@ -96,7 +96,7 @@ ) header <- list( - file="/* pomp model file: {%name%} */\n\n#include \n#include \n\n", + file="/* pomp model file: {%name%} */\n\n#include <{%pompheader%}>\n#include \n\n", rmeasure="\nvoid {%name%}_rmeasure (double *__y, double *__x, double *__p, int *__obsindex, int *__stateindex, int *__parindex, int *__covindex, int __ncovars, double *__covars, double t)\n{\n", dmeasure= "\nvoid {%name%}_dmeasure (double *__lik, double *__y, double *__x, double *__p, int give_log, int *__obsindex, int *__stateindex, int *__parindex, int *__covindex, int __ncovars, double *__covars, double t)\n{\n", step.fn="\nvoid {%name%}_stepfn (double *__x, const double *__p, const int *__stateindex, const int *__parindex, const int *__covindex, int __covdim, const double *__covars, double t, double dt)\n{\n", @@ -148,10 +148,15 @@ modelfile <- paste0(name,".c") solib <- paste0(name,.Platform$dynlib.ext) - + if (.Platform$OS.type=="unix") { + pompheader <- "pomp.h" + } else { + pompheader <- system.file("include/pomp.h",package="pomp") + } + out <- file(description=modelfile,open="w") - cat(file=out,render(header$file,name=name)) + cat(file=out,render(header$file,name=name,pompheader=pompheader)) for (f in utility.fns) { cat(file=out,f) Added: pkg/pomp/R/logmeanexp.R =================================================================== --- pkg/pomp/R/logmeanexp.R (rev 0) +++ pkg/pomp/R/logmeanexp.R 2013-11-11 01:28:48 UTC (rev 868) @@ -0,0 +1,4 @@ +logmeanexp <- function (x) { + mx <- max(x) + mx+log(mean(exp(x-mx))) +} Modified: pkg/pomp/inst/NEWS =================================================================== --- pkg/pomp/inst/NEWS 2013-11-05 22:58:31 UTC (rev 867) +++ pkg/pomp/inst/NEWS 2013-11-11 01:28:48 UTC (rev 868) @@ -1,4 +1,9 @@ NEWS +0.45-5 + o a fix so that 'pompBuilder' will find 'pomp.h' header file on Windows machines. Thanks to Dave Hayman for finding the problem. + + o some reorganization of the source package structure. + 0.45-4 o changes in the way 'reulermultinom', 'deulermultinom', 'dot_product' are exported to other packages. Rather than just being exported as linkables, these are now also defined as static inline functions in the 'pomp.h' header. Modified: pkg/pomp/man/builder.Rd =================================================================== --- pkg/pomp/man/builder.Rd 2013-11-05 22:58:31 UTC (rev 867) +++ pkg/pomp/man/builder.Rd 2013-11-11 01:28:48 UTC (rev 868) @@ -55,12 +55,20 @@ } \value{ The constructed \code{pomp} object. - A side-effect is the writing and compilation of a C code into a shared-object library. + A side-effect is the writing and compilation of a C code into a dynamics shared object. These files will reside in the current working directory (see \code{\link{getwd}}). - If \code{pompBuilder} has been called with \code{link=FALSE}, this shared-object library must be linked (see \code{\link{dyn.load}}) before the \code{pomp} object can be used. + If \code{pompBuilder} has been called with \code{link=FALSE}, this dynamic shared object must be linked (see \code{\link{dyn.load}}) before the \code{pomp} object can be used. + + \strong{Parallel computing caution:} + note that, since a side-effect of running \code{pompBuilder} is the writing and compilation of a file, caution must be used when running parallel computations. + Simultaneous execution of \code{pompBuilder} on nodes sharing a common disk will cause all nodes to attempt to write the same file at the same time; + the results will be undefined. + If multiple nodes are to work on the same \code{pomp} object built by \code{pompBuilder}, first run \code{pompBuilder} once (perhaps with \code{link=FALSE}) to write the C file and compile it into a dynamic shared object file. + The \code{pomp} object returned by \code{pompBuilder} can then be shared with all worker nodes. + Note, however, that all worker nodes must dynamically load (using \code{\link{dyn.load}}) the dynamic shared object file before anything can be done with the \code{pomp} object. } \details{ - \code{pompBuilder} assumes that files can be written to the current working directory and that shared-object libraries can be compiled and linked, i.e., that \code{R CMD SHLIB} will work. + \code{pompBuilder} assumes that files can be written to the current working directory and that dynamic shared objects can be compiled and linked, i.e., that \code{R CMD SHLIB} will work. This will not typically be the case in out-of-the-box Windows installations. } \seealso{ Added: pkg/pomp/man/logmeanexp.Rd =================================================================== --- pkg/pomp/man/logmeanexp.Rd (rev 0) +++ pkg/pomp/man/logmeanexp.Rd 2013-11-11 01:28:48 UTC (rev 868) @@ -0,0 +1,23 @@ +\name{logmeanexp} +\alias{logmeanexp} +\title{The log-mean-exp trick} +\description{ + \code{logmeanexp} computes the log-mean-exp of a set of numbers. +} +\usage{ +logmeanexp(x) +} +\arguments{ + \item{x}{numeric} +} +\value{ + \code{log(mean(exp(x)))} computed so as to avoid over- or underflow. +} +\author{Aaron A. King \email{kingaa at umich dot edu}} +\examples{ + ## generate a bifurcation diagram for the Ricker map + pompExample(ricker) + ll <- replicate(n=5,logLik(pfilter(ricker,Np=1000))) + ## an estimate of the log likelihood: + logmeanexp(ll) +} From noreply at r-forge.r-project.org Mon Nov 11 02:43:33 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 11 Nov 2013 02:43:33 +0100 (CET) Subject: [Pomp-commits] r869 - www/vignettes Message-ID: <20131111014333.B36831853F5@r-forge.r-project.org> Author: kingaa Date: 2013-11-11 02:43:33 +0100 (Mon, 11 Nov 2013) New Revision: 869 Modified: www/vignettes/advanced_topics_in_pomp.pdf www/vignettes/intro_to_pomp.pdf www/vignettes/pomp.bib Log: - update vignettes 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.bib =================================================================== --- www/vignettes/pomp.bib 2013-11-11 01:28:48 UTC (rev 868) +++ www/vignettes/pomp.bib 2013-11-11 01:43:33 UTC (rev 869) @@ -478,8 +478,7 @@ journal = {Proceedings of the National Academy of Sciences of the U.S.A.}, year = {2006}, volume = {103}, - pages = {18860--18865 }, - url = {http://dx.doi.org/10.1073/pnas.0608571103} + pages = {18860--18865 } } @ARTICLE{Smith1993, @@ -527,8 +526,7 @@ future.}, file = {Tidd1993.pdf:Tidd1993.pdf:PDF}, owner = {kingaa}, - timestamp = {2009.09.22}, - url = {http://links.jstor.org/sici?sici=0962-8452%2819931222%29254%3A1341%3C257%3ATCFCIC%3E2.0.CO%3B2-G} + timestamp = {2009.09.22} } @ARTICLE{Wearing2009, From noreply at r-forge.r-project.org Mon Nov 11 16:30:44 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 11 Nov 2013 16:30:44 +0100 (CET) Subject: [Pomp-commits] r870 - pkg/pompExamples Message-ID: <20131111153044.26D4618622D@r-forge.r-project.org> Author: kingaa Date: 2013-11-11 16:30:43 +0100 (Mon, 11 Nov 2013) New Revision: 870 Modified: pkg/pompExamples/DESCRIPTION Log: - bump for rebuild Modified: pkg/pompExamples/DESCRIPTION =================================================================== --- pkg/pompExamples/DESCRIPTION 2013-11-11 01:43:33 UTC (rev 869) +++ pkg/pompExamples/DESCRIPTION 2013-11-11 15:30:43 UTC (rev 870) @@ -2,7 +2,7 @@ Type: Package Title: Statistical inference for partially observed Markov processes Version: 0.21-4 -Date: 2013-11-05 +Date: 2013-11-11 Maintainer: Aaron A. King 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")),