Skip to content

Commit

Permalink
version 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
kingaa authored and cran-robot committed Aug 7, 2023
1 parent 2e4bdee commit a417a23
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 51 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
@@ -1,8 +1,8 @@
Package: pomp
Type: Package
Title: Statistical Inference for Partially Observed Markov Processes
Version: 5.3
Date: 2023-07-15
Version: 5.4
Date: 2023-08-07
Authors@R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa@umich.edu",comment=c(ORCID="0000-0001-6159-3207")),
person(given=c("Edward","L."),family="Ionides",role="aut",comment=c(ORCID="0000-0002-4190-0174")) ,
person(given="Carles",family="Bretó",role="aut",comment=c(ORCID="0000-0003-4695-4902")),
Expand Down Expand Up @@ -58,7 +58,7 @@ Collate: 'package.R' 'pstop.R' 'undefined.R' 'csnippet.R' 'pomp_fun.R'
'traces.R' 'transformations.R' 'userdata.R' 'verhulst.R'
'vmeasure_spec.R' 'window.R' 'wquant.R'
NeedsCompilation: yes
Packaged: 2023-07-15 20:09:46 UTC; kingaa
Packaged: 2023-08-07 19:01:16 UTC; kingaa
Author: Aaron A. King [aut, cre] (<https://orcid.org/0000-0001-6159-3207>),
Edward L. Ionides [aut] (<https://orcid.org/0000-0002-4190-0174>),
Carles Bretó [aut] (<https://orcid.org/0000-0003-4695-4902>),
Expand All @@ -75,4 +75,4 @@ Author: Aaron A. King [aut, cre] (<https://orcid.org/0000-0001-6159-3207>),
Simon N. Wood [ctb] (<https://orcid.org/0000-0002-2034-7453>)
Maintainer: Aaron A. King <kingaa@umich.edu>
Repository: CRAN
Date/Publication: 2023-07-15 20:40:02 UTC
Date/Publication: 2023-08-07 19:50:02 UTC
28 changes: 14 additions & 14 deletions MD5
@@ -1,10 +1,10 @@
15dcee4d9d59630d9b52d979749f0fd0 *DESCRIPTION
4c8ee4c4d54c665680e9b38079526bef *DESCRIPTION
3719d92d178bce491aa4bb35df4aae40 *NAMESPACE
02534df093ec523b2eaaa3749675c91e *R/abc.R
290505ed00e8da021f6978923db3c8e3 *R/accumulators.R
f631c0b055cd77901154c1d136aff661 *R/as_data_frame.R
cb687fab11bfce9f1a2d726c243d5b92 *R/as_pomp.R
fee5b650ad30b110e7304675c9b24c64 *R/bake.R
031733e115edd4569950461819d2e199 *R/bake.R
a3dac97d88a9ee0f69afe9419d60dde4 *R/basic_components.R
6f586885dc2c9d9dd013abdba19b0192 *R/basic_probes.R
52e905355299bbe2e6b7cb0c3f645c4c *R/betabinom.R
Expand Down Expand Up @@ -64,7 +64,7 @@ e66716dd3e0934154a3c0709fdf9e0e6 *R/pmcmc.R
59db660f5447adb6adaf010f6cb78010 *R/pomp.R
dab4f0738dbcf9313530cda3ba0c62b4 *R/pomp_class.R
a094c2c219742139c75461c1a5485549 *R/pomp_examp.R
8a0c1f45034c4c2271665b28d00478ce *R/pomp_fun.R
2dbaee4a6c9c9483c216d57c13ea268a *R/pomp_fun.R
571f769acc35c2e89bc6ee13596462d6 *R/pred_mean.R
f1e7a49c24c2ca2d58cbe995526270e0 *R/pred_var.R
df0959485eb78a4fe68e9ca1338dfd5b *R/print.R
Expand All @@ -74,7 +74,7 @@ ac50142e5adeabb6b815eadd1eb61eb0 *R/probe.R
f870c1766c00b085c20a233996256f0e *R/profile_design.R
6dd6187bd88729648f65496ac3661c1d *R/proposals.R
f864587fe3777f6b9b35a1f65feff785 *R/pstop.R
91d5f63c5ba5655f325a23e0ffeca3ba *R/resample.R
fbf4e75ddaba91862fe13a2add0ec59c *R/resample.R
16e6f83b7c0a3d1c551b5884cd02d29c *R/ricker.R
ef0042515b34afe987a6a250fa0fbbcc *R/rinit_spec.R
80d92614b9252a543c48347ecdcfb8a3 *R/rmeasure_spec.R
Expand Down Expand Up @@ -120,16 +120,16 @@ cd6ac31b6d5fe76019d6426f2a453e05 *data/ewcitmeas.rda
0e0eda4824bc68535da32d9aa065fae7 *data/parus.csv.gz
b3467dd24936736bb5c8300c507a0f39 *inst/CITATION
d32239bcb673463ab874e80d47fae504 *inst/GPL
f240d8fe508b05a1c18e837e72cc4145 *inst/NEWS
8cbda4ab29ab519afc8c3ca19a0719f8 *inst/NEWS.Rd
424fa4296f0a23da1543da8af1779337 *inst/NEWS
9a003eb28d21be25edd7c3e3eeadde1c *inst/NEWS.Rd
27c1db8cc70185e80bee9990421613b3 *inst/doc/index.html
5416ecb0ced763ada08409d4ee9a0552 *inst/include/pomp.h
80a3bd957af7c5fb07b31cbc64925330 *inst/include/pomp_defines.h
93db7b681b7913169a51472e0baed049 *man/abc.Rd
50ecbf6a80b3b11b3afe3dc01991f339 *man/accumvars.Rd
9f08db5c6ce2a47919f1a16bf2fd8aba *man/as_data_frame.Rd
9fb528e7af70e75a272b51ec561e8af5 *man/as_pomp.Rd
256064a06827e4efcd02dc0ac471dcf0 *man/bake.Rd
b487a30a4f09c63b95a51dab92ab6071 *man/bake.Rd
e56881730061ad446adfd94e447871e8 *man/basic_components.Rd
2e9a241d0eeddcbaa17365dda996e931 *man/basic_probes.Rd
d23106155f95afd7ef10340abadcb4cd *man/betabinom.Rd
Expand Down Expand Up @@ -196,15 +196,15 @@ d90393d8bdc7e2f91afa44913246bf95 *man/pomp-defunct.Rd
3f0736b27f826cb73d36165034338bed *man/pomp.Rd
5ae46356ad061e42538e8f72f79c3011 *man/pomp_class.Rd
0f0ca4d99fdc7f14aaca4c8b075f9a14 *man/pomp_examp.Rd
c1063e66408830163094991d92a90ba4 *man/pomp_fun.Rd
8f59a042d349a72afb5b89d93e97d84c *man/pomp_fun.Rd
566f80def4298a8b270073525cdd7345 *man/pred_mean.Rd
5d5b7bcd4d5cf59ae75a64d104a70292 *man/pred_var.Rd
b16bc18bec634174729c5d9805776236 *man/print.Rd
c863ed4062a94094c72545240efa167c *man/prior_spec.Rd
f25a4a9cbdda04582daf7458ed0ffc4a *man/probe.Rd
b2f47ab46118f803d3faf1585cd09fd1 *man/probe_match.Rd
975f999aa7bab726bae8d0ef154b49ff *man/proposals.Rd
dc3346f001165e963702983beebed726 *man/resample.Rd
523380e307fff1a0c534b47a53dd04f0 *man/resample.Rd
9f0fe0c72847754a310882514d9f83b3 *man/ricker.Rd
ee5bb2671b582ce5fcb2cfbe59407f22 *man/rinit.Rd
7480ddc6a961f5379263dabb290610a0 *man/rinit_spec.Rd
Expand Down Expand Up @@ -244,16 +244,16 @@ e715565227b8ff3faa88a6fde060c8ba *man/window.Rd
80e9886fd532ce5c30a2fc28c04e2b5e *man/wquant.Rd
2a6f9e9e044a78154d3cfda5936d6f48 *src/Makevars
e8087264ef7301a0df7ecaadb44377cc *src/bspline.c
9b5cd86b155077a0c77257336a7e724b *src/decls.h
ec88c384b67922e5f7054abb259aa95c *src/decls.h
e9b2cb24ca3e694c3348585d94824d11 *src/dinit.c
d41734f8d878f3323b0bb2187d10f36e *src/distributions.c
630d030c21406e62bcc63e41f640148e *src/dmeasure.c
ceaeefc115eb4d837f57a2974c1e4bb4 *src/dprior.c
66093e1e60659148ee030cf41458d031 *src/dprocess.c
f9d15f1b9e76efd828c0d70cda97e2c7 *src/emeasure.c
de073da8d55239e6268b1046a2ecc408 *src/euler.c
ec2a6f3501ce23382732ed879868a9ba *src/euler.c
bacc44bb4acc7a242f2363a8b215aa0d *src/gompertz.c
37758197d6e46cecedeaddd7c0d0fb81 *src/init.c
64b238639cb4f07597175062fed07543 *src/init.c
b4c4094a7e813777ec7b3fc072de9120 *src/internal.h
cf1fea63d8707e7901af09758232c4d5 *src/logmeanexp.c
3df5e9df9ed0c9fcc49793436b6fc3c3 *src/lookup_table.c
Expand All @@ -273,7 +273,7 @@ aedc6518b0a0bc1d89aa785fc778b3b0 *src/resample.c
b5ae565dd8a13934f02f0dff380a1b87 *src/rinit.c
83b5defe42757522f6a7827a927c4aa0 *src/rmeasure.c
d14603e7d8a02a467dcbce3c37e90991 *src/rprior.c
a87566937bda3db8aada2f44c8a15405 *src/rprocess.c
f9a3fa656d434f199b6c4fa7695c1d24 *src/rprocess.c
da6446a38bc0c8009fa11c9733d24d6c *src/simulate.c
92368c7900e142117e085ff744d9555f *src/skeleton.c
f59dd0059cdd443a58c43bf2755f66e5 *src/soboldata.h
Expand All @@ -282,6 +282,6 @@ a579079ce932aae31c893e25ce5aa4f4 *src/sobolseq.c
f1ce592d9e611bd87c985094106b76f0 *src/synth_lik.c
5bcc5fcce0e3bbe1f82e7993de6856f8 *src/trajectory.c
f06c799ac06b81f8cfc55115ec895087 *src/transformations.c
12cebb157dfab934a982514679bdca0c *src/userdata.c
d9d642d89fca2483940891ef732ae813 *src/userdata.c
90d9cc2b8b3e21b3455e864feff5c2b2 *src/vmeasure.c
083f4a7e4453fa20dfe58dd3a3e1d343 *src/wpfilter.c
21 changes: 9 additions & 12 deletions R/bake.R
Expand Up @@ -6,7 +6,7 @@
##' @rdname bake
##' @include package.R
##' @concept reproducibility
##'
##' @author Aaron A. King
##' @details
##' On cooking shows, recipes requiring lengthy baking or stewing are prepared beforehand.
##' The \code{bake} and \code{stew} functions perform analogously:
Expand All @@ -29,12 +29,10 @@
##' By contrast, \code{stew} creates a local environment within which \code{expr} is evaluated; all objects in that environment are saved (by name) in \code{file}.
##' \code{bake} and \code{stew} also store information about the code executed, the dependencies, and the state of the random-number generator (if the latter is controlled) in the archive file.
##' Re-computation is triggered if any of these things change.
##'
##' @section Avoid using \sQuote{pomp} objects as dependencies:
##' Note that when a \sQuote{pomp} object is built with one or more \link[=Csnippet]{C snippets}, the resulting code is \dQuote{salted} with a random element to prevent collisions in parallel computations.
##' As a result, two such \sQuote{pomp} objects will never match perfectly, even if the codes and data used to construct them are identical.
##' Therefore, avoid using \sQuote{pomp} objects as dependencies in \code{bake} and \code{stew}.
##'
##' @param file Name of the archive file in which the result will be stored or retrieved, as appropriate.
##' For \code{bake}, this will contain a single object and hence be an RDS file (extension \sQuote{rds});
##' for \code{stew}, this will contain one or more named objects and hence be an RDA file (extension \sQuote{rda}).
Expand Down Expand Up @@ -63,17 +61,14 @@
##' If \code{TRUE}, the \dQuote{ingredients} of the calculation are returned as a list.
##' In the case of \code{bake}, this list is the \dQuote{ingredients} attribute of the returned object.
##' In the case of \code{stew}, this list is a hidden object named \dQuote{.ingredients}, located in the environment within which \code{stew} was called.
##'
##' @inheritParams base::eval
##'
##' @section Compatibility with older versions:
##' With \pkg{pomp} version 3.4.4.2, the behavior of \code{bake} and \code{stew} changed.
##' In particular, older versions did no dependency checking, and did not check to see whether \code{expr} had changed.
##' Accordingly, the archive files written by older versions have a format that is not compatible with the newer ones.
##' When an archive file in the old format is encountered, it will be updated to the new format, with a warning message.
##' \strong{Note that this will overwrite existing archive files!}
##' However, there will be no loss of information.
##'
##' @return \code{bake} returns the value of the evaluated expression \code{expr}.
##' Other objects created in the evaluation of \code{expr} are discarded along with the temporary, local environment created for the evaluation.
##'
Expand All @@ -92,8 +87,6 @@
##' \code{bake} stores this in the \dQuote{system.time} attribute of the archived \R object;
##' \code{stew} does so in a hidden variable named \code{.system.time}.
##' The timing is obtained using \code{\link{system.time}}.
##'
##' @author Aaron A. King
##'
##' @example examples/bake.R
##'
Expand Down Expand Up @@ -253,7 +246,7 @@ update_stew_archive <- function (
stew <- function (
file, expr,
seed = NULL, kind = NULL, normal.kind = NULL,
dependson = NULL, info = FALSE,
dependson = NULL, info = FALSE, timing = TRUE,
dir = getOption("pomp_archive_dir",getwd())
) {
expr <- substitute(expr)
Expand All @@ -265,6 +258,7 @@ stew <- function (
ep="stew"
)
info <- as.logical(info)
timing <- as.logical(timing)
file <- create_path(dir,file)
reload <- file.exists(file)
e <- new.env(parent=pf)
Expand Down Expand Up @@ -305,12 +299,15 @@ stew <- function (
e$.system.time <- tmg
save(list=objects(envir=e,all.names=TRUE),file=file,envir=e)
}
objlist <- objects(envir=e,all.names=info)
objlist <- objects(envir=e,all.names=FALSE)
for (obj in objlist) {
assign(obj,get(obj,envir=e),envir=pf)
}
if (!info) {
assign(".system.time",e$.systemtime,envir=pf)
if (info) {
assign(".ingredients",e$.ingredients,envir=pf)
}
if (timing) {
assign(".system.time",e$.system.time,envir=pf)
}
invisible(objlist)
}
Expand Down
1 change: 0 additions & 1 deletion R/pomp_fun.R
Expand Up @@ -17,7 +17,6 @@
##' which the native function \code{f} can be found.
##' @param proto optional string; a prototype against which \code{f} will be
##' checked.
##' @param object,x the \sQuote{pomp_fun} object.
##' @author Aaron A. King
##' @seealso \code{\link{pomp}}
NULL
Expand Down
2 changes: 1 addition & 1 deletion R/resample.R
Expand Up @@ -11,7 +11,7 @@
##' @concept sampling
##'
##' @param weights numeric; vector of weights.
##' @param np integer scalar; number of samples to draw.
##' @param Np integer scalar; number of samples to draw.
##'
NULL

Expand Down
7 changes: 7 additions & 0 deletions inst/NEWS
@@ -1,5 +1,12 @@
_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 _5._4:

• ‘stew’ now returns timing information by default.

• The spurious warnings associated with NULL ‘userdata’ have
been eliminated.

_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _5._3:

• The new option ‘on_load’ allows one to specify a C snippet
Expand Down
6 changes: 6 additions & 0 deletions inst/NEWS.Rd
@@ -1,5 +1,11 @@
\name{NEWS}
\title{News for package `pomp'}
\section{Changes in \pkg{pomp} version 5.4}{
\itemize{
\item \code{stew} now returns timing information by default.
\item The spurious warnings associated with NULL \code{userdata} have been eliminated.
}
}
\section{Changes in \pkg{pomp} version 5.3}{
\itemize{
\item The new option \code{on_load} allows one to specify a C snippet that will be executed at the time the C snippet library is loaded.
Expand Down
1 change: 1 addition & 0 deletions man/bake.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions man/pomp_fun.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/resample.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/decls.h
Expand Up @@ -21,7 +21,7 @@ extern SEXP do_dprocess(SEXP object, SEXP x, SEXP times, SEXP params, SEXP log,
/* src/emeasure.c */
extern SEXP do_emeasure(SEXP object, SEXP x, SEXP times, SEXP params, SEXP gnsi);
/* src/euler.c */
extern SEXP euler_model_simulator(SEXP func, SEXP xstart, SEXP tstart, SEXP times, SEXP params, double deltat, rprocmode method, SEXP accumvars, SEXP covar, SEXP args, SEXP gnsi);
extern SEXP euler_simulator(SEXP func, SEXP xstart, SEXP tstart, SEXP times, SEXP params, double deltat, rprocmode method, SEXP accumvars, SEXP covar, SEXP args, SEXP gnsi);
extern int num_euler_steps(double t1, double t2, double *deltat);
extern int num_map_steps(double t1, double t2, double deltat);
/* src/gompertz.c */
Expand Down Expand Up @@ -108,7 +108,7 @@ extern SEXP ExpitTransform(SEXP X);
extern SEXP LogBarycentricTransform(SEXP X);
extern SEXP InverseLogBarycentricTransform(SEXP Y);
/* src/userdata.c */
extern void set_pomp_userdata(SEXP userdata);
extern SEXP set_pomp_userdata(SEXP userdata);
extern const SEXP get_userdata(const char *name);
extern const int *get_userdata_int(const char *name);
extern const double *get_userdata_double(const char *name);
Expand Down
2 changes: 1 addition & 1 deletion src/euler.c
Expand Up @@ -104,7 +104,7 @@ static R_INLINE SEXP ret_array (int n, int nreps, int ntimes, SEXP names)

}

SEXP euler_model_simulator
SEXP euler_simulator
(
SEXP func, SEXP xstart, SEXP tstart, SEXP times, SEXP params,
double deltat, rprocmode method, SEXP accumvars, SEXP covar,
Expand Down
2 changes: 0 additions & 2 deletions src/init.c
Expand Up @@ -7,11 +7,9 @@ static const R_CallMethodDef callMethods[] = {
{"bspline_basis", (DL_FUNC) &bspline_basis, 5},
{"periodic_bspline_basis", (DL_FUNC) &periodic_bspline_basis, 5},
{"systematic_resampling", (DL_FUNC) &systematic_resampling, 2},
{"euler_model_simulator", (DL_FUNC) &euler_model_simulator, 11},
{"lookup_in_table", (DL_FUNC) &lookup_in_table, 2},
{"load_stack_incr", (DL_FUNC) &load_stack_incr, 1},
{"load_stack_decr", (DL_FUNC) &load_stack_decr, 1},
{"SSA_simulator", (DL_FUNC) &SSA_simulator, 11},
{"R_Euler_Multinom", (DL_FUNC) &R_Euler_Multinom, 4},
{"D_Euler_Multinom", (DL_FUNC) &D_Euler_Multinom, 5},
{"R_GammaWN", (DL_FUNC) &R_GammaWN, 3},
Expand Down
4 changes: 2 additions & 2 deletions src/rprocess.c
Expand Up @@ -110,7 +110,7 @@ SEXP do_rprocess (SEXP object, SEXP xstart, SEXP tstart, SEXP times, SEXP params
SEXP fn;
double deltat = 1.0;
PROTECT(fn = GET_SLOT(rproc,install("step.fn")));
PROTECT(X = euler_model_simulator(fn,xstart,tstart,times,params,deltat,type,
PROTECT(X = euler_simulator(fn,xstart,tstart,times,params,deltat,type,
accumvars,covar,args,gnsi));
nprotect += 2;
}
Expand All @@ -121,7 +121,7 @@ SEXP do_rprocess (SEXP object, SEXP xstart, SEXP tstart, SEXP times, SEXP params
double deltat;
PROTECT(fn = GET_SLOT(rproc,install("step.fn")));
deltat = *(REAL(AS_NUMERIC(GET_SLOT(rproc,install("delta.t")))));
PROTECT(X = euler_model_simulator(fn,xstart,tstart,times,params,deltat,type,
PROTECT(X = euler_simulator(fn,xstart,tstart,times,params,deltat,type,
accumvars,covar,args,gnsi));
nprotect += 2;
}
Expand Down
11 changes: 2 additions & 9 deletions src/userdata.c
Expand Up @@ -5,16 +5,9 @@
static SEXP __pomp_ptr_userdata;
#define USERDATA (__pomp_ptr_userdata)

void set_pomp_userdata (SEXP userdata) {
#if (R_VERSION < 262659) // before 4.2.3
if (LENGTH(userdata) > 0) {
USERDATA = userdata;
} else {
USERDATA = R_NilValue;
}
#else
SEXP set_pomp_userdata (SEXP userdata) {
USERDATA = userdata;
#endif
return R_NilValue;
}

const SEXP get_userdata (const char *name) {
Expand Down

0 comments on commit a417a23

Please sign in to comment.