NEWS | R Documentation |
The source codes underlying specification of basic model components via R functions has been reworked to remove reliance on deep PROTECT
stacks.
Thanks to Thomas Kalibera for showing the way!
A bug in the documentation for filter.traj
, pointed out by Pierre Jacob, has been fixed.
The C API for pomp is no longer explained only in comments in the “pomp.h” header file. It is now described and explained in the new C API vignette.
The new pomp_cdir
global option allows one to set the directory holding C snippet files globally.
A bug caused by re-use of the cfile
argument has been fixed.
Re-use now triggers an error, with an informative message.
Some documentation improvements.
A bug in runifDesign
(and therefore profileDesign
when type="runif"
) has been fixed.
There are now plot
methods for objects of classes ‘probe_match_objfun’ and ‘spect_match_objfun’.
The melt
function can now be applied to arbitrary ‘pomp’ objects.
A new function, runifDesign
allows construction of design matrices using samples from multivariate uniform distributions.
The profileDesign
function takes a new argument, type
, with two options:
"sobol"
, the default, constructs the design using sobolDesign
, as before.
"runif"
uses the new runifDesign
function.
A new example, comprising models and data for the 2014–2016 west African Ebola virus disease outbreak, is included.
See ?ebola
for details.
It is now possible to adjust the observation times and zero-time in the sir
and sir2
examples.
One can also change the default RNG seed used in generating the simulated data.
The codes underlying the rprocess
workhorse have been streamlined to obviate an unnecessary copy operation.
As a result, the interface to the rprocess
workhorse has been changed.
The interface to the new flow
workhorse has been changed to match.
The new flow
workhorse allows integration/iteration of the deterministic skeleton at arbitrary times from an arbitrary initial condition.
When coef
is applied to a ‘listie’, the result can be more usefully melt
ed.
The probe-names returned by probe.acf
and probe.ccf
have changed.
A bug, whereby the ‘coef’ method from other packages was masked, has been fixed.
Errors in the documentation have been corrected.
There is a new as.data.frame
method for ‘listie’s.
Some problems with the exposure of internal objects for package developers have been corrected.
The magrittr pipe operator, %>%
, is now re-exported.
More examples have been included.
Minor changes to error messages.
The names of the ‘objfun’ methods have been changed to probe_objfun
, spect_objfun
, traj_objfun
, and nlf_objfun
.
The package directory structure has been modified to include a new ‘examples’ directory, which holds the examples used in the documentation.
The names of the ‘objfun’ methods have been shortened.
It is now permissible that the sequence of observation times (and sequences of covariate times) be merely non-decreasing sequences. Previously, pomp insisted on strictly increasing time sequences.
The default cooling schedule (cooling.type
) in mif2
is now “geometric”, in contrast to “hyperbolic”, as before.
pomp now requires at least R version 3.5.
The zeronames
argument has been renamed accumvars
.
In the course of ordinary work, one should never need to interact with the low-level pomp
constructor function now.
The pompExample
function has been dropped.
The various examples are now included as regular functions that construct ‘pomp’ objects.
The bbs
example has been dropped.
One can now modify basic model components at (almost) any stage in a pipeline of pomp computations.
All the top-level inference functions, plus probe
, pfilter
, and simulate
now allow modification of basic model components.
The rprocess
plugins onestep.sim
, discrete.time.sim
, euler.sim
, gillespie.sim
, and gillespie.hl.sim
have been renamed onestep
, discrete_time
, euler
, gillespie
, and gillespie_hl
, respectively.
The old usage is available but deprecated.
One can now call simulate
on a model without reference to any data.
The covariate table facility (covariate_table
) now supports piecewise constant interpolation.
The syntax with which one includes covariates via covariate_table
has become more flexible.
Specifically, the arguments to covariate_table
are now evaluated sequentially, so that later ones can depend on earlier ones.
Once evaluated, the covariates are bound column-wise into a single data frame.
The manner in which one writes R functions to specify basic model components has been totally changed. Before, one wrote functions that took specific arguments such as 'x', 'params', and 'covars'. Now, one writes such functions with any or all state variables, observables, covariates, and/or time as arguments.
simulate
now returns more informative results when simulations from multiple parameter sets are simultaneously computed.
Specifically, if params
has column names, these are used to identify the resulting simulations.
Thus when format = "pomps"
(the default), the names of the resulting list will be constructed from the column names of params
.
Likewise, when format = "arrays"
, the resulting arrays will have informative column names;
When format = "data.frame"
, the identifier variable will make use of the column names.
The basic particle filter, pfilter
, has a simpler mode of operation:
params
should be a single parameter set only.
That is, it is no longer possible to pass a matrix of parameters to pfilter
.
The Liu-West algorithm, bsmc2
, has a simpler mode of operation:
params
should be a single parameter set only:
the SMC particles are drawn from rprior
.
The as.data.frame
, states
, and obs
options for simulate
have been done away with.
One now chooses the format of the returned simulations via the format
argument.
When one simulates at multiple parameter sets, list names, array dimnames
, or identifying variables in the output data frame help to correlate simulations with parameter sets.
The as.data.frame
argument to trajectory
has been removed in favor of a new format
argument that allows one to choose between receiving the results in the form of an "array"
or a "data.frame"
.
All the basic model components now have defaults.
The default rinit
behavior remains as it was:
it assumes the initial state distribution is concentrated at a point mass determined by parameters with “.0
” or “_0
” suffices.
The default process model is “missing”: calls to dprocess
and rprocess
will result in missing values (NA
).
The default measurement model is “missing” as well.
The default prior is flat and improper:
all calls to the default dprior
result in 1
(0
if log = TRUE
, and all calls to rprior
result in NA
.
The default skeleton is missing.
The default parameter transformations remain the identity.
The transform
argument present in many pomp algorithms has been removed.
Parameter transformations are now automatically performed when appropriate.
The default parameter transformation remains the identity.
The old probe.match
and traj.match
functions have been removed.
The new approach to parameter estimation based on numerical optimization involves constructing stateful objective functions.
There are now three of these: traj.match.objfun
, probe.match.objfun
, and spect.match.objfun
.
The documentation system has been thoroughly overhauled.
In skeleton
, the t
argument has been replaced by times
, to make this uniform with the other workhorse functions.
Covariates are now included using the covariate_table
construction, passed via the covar
argument to pomp
.
The tcovar
argument is no longer used.
Instead of providing separate fromEstimationScale
and toEstimationScale
arguments to pomp
, one now provides a single partrans
argument constructed by means of the new function parameter_trans
.
In addition, references to “fromEstimationScale” and “toEstimationScale” have been abbreviated to “fromEst” and “toEst”, respectively, throughout the package.
When writing C snippets for parameter transformations, the notation T_p
refers to the value of p
on the estimation scale.
Thus, if parameter alpha is to be log-transformed for estimation, the toEst
snippet would contain the line T_alpha = log(alpha);
and the fromEst
snippet would include alpha = exp(T_alpha);
.
The parameter_trans
function now takes optional arguments log
, logit
, and barycentric
, with names of parameters to be log-, logit-, and log-barycentric transformed, respectively.
The measurement.model
argument to pomp
has been removed.
It is now necessary to specify the measurement model directly using rmeasure
and/or dmeasure
.
The initializer
is no longer referred to by that name.
It is now rinit
, since it draws from the distribution of the latent state at the initial time.
The low-level function init.state
has been replaced by rinit
.
The conv.rec
method has been deprecated, replaced by the new traces
method.
The euler.sir
example has been renamed sir
.
The gillespie.sir
example has been renamed sir2
.
The covmat
method can now be applied to a probed.pomp
object.
It returns the estimated covariance matrix of the probes.
When trajectory
calls on deSolve routines to numerically integrate a model vectorfield, more informative error messages are generated, and diagnostics are printed when verbose = TRUE
.
The show
method applied to pomp objects is now quite terse.
To obtain detailed information, the spy
method is available.
The spy
method now returns the information formerly displayed in a call to show
, in addition to the C files associated with any C snippets.
The use of $
methods to access the slots of pomp S4 objects has now been removed.
These classes are no longer exported (for the most part).
The transform
argument to the probe.quantile
function has been removed (as it is entirely redundant!).
The old and deprecated mif
and bsmc
methods have been removed.
The obs
and states
arguments of simulate
are deprecated and will be removed in a forthcoming release.
The C-level interface for apply_probe_sims
has changed: the new argument rho
must be the “package:pomp” environment.
A bug in pfilter
(and hence pmcmc
) when filter.traj=TRUE
was discovered and fixed.
In the buggy version, the filter trajectory was sampled with incorrect weights.
Timo Voipio contributed a pull request that traps the error resulting from sannbox
being passed a candidate.dist
that is not a function.
show
and print
methods have been made very terse:
they simply report on the class of the object in question.
To see more detailed information about a ‘pomp’ object, use spy
.
New (unexported) solibs<-
method allows developers of packages extending pomp to incorporate C snippets into object that contain ‘pomp’ objects.
New verbose
option in trajectory
gives diagnostic information from deSolve integration routines.
Of course, this is pertinent only if the model skeleton is a vectorfield.
Bug in the display of istate
when deSolve::ode
errors has been fixed.
New hitch
function facilitates construction of pomp.fun
objects from R functions, C snippets, and links to external libraries.
Native routines needed to access pomp.fun
objects in C are now registered for use by other packages.
coef(object) <- NULL
, where object
is of class ‘pomp’, erases any parameters stored in object
.
The euler.sir
, gillespie.sir
, blowflies
, ricker
, bbs
, dacca
, and rw2
examples are all now implemented using C snippets.
A new ‘pomp_defines.h’ header is provided for developers of packages that depend on pomp.
Internally, rprocess
is no longer stored as an R function.
The use of plugins is now required for the implementation of the rprocess
component.
Currently, there are five plugins available:
onestep.sim
, discrete.time.sim
, euler.sim
, gillespie.sim
, and gillespie.hl.sim
.
The new hitch
function automates the building and linking of C snippets and R functions into pomp.fun
s.
The handling of dprocess
has changed.
The onestep.dens
plugin is now deprecated and will soon be removed.
dprocess
is now specified directly using either a C snippet or an R function, in much the same way that, for example, dmeasure
is specified.
The old ‘forward’ and ‘inverse’ options for the dir
argument of partrans
have been dispensed with.
The much more descriptive options ‘toEstimationScale’ and ‘fromEstimationScale’ remain.
The C snippet compiling facilities have been thoroughly reworked.
onestep.dens
can now take a Csnippet
specification of the process-model transition density.
All inference functions can now take a list in the start
or params
arguments.
When altering parameters in a call to probe
on a probed.pomp
object, the new parameters were ignored.
This bug has been fixed.
New spy
method displays the C snippet file(s) associated with a pomp
object.
The long-deprecated seed
argument to bsmc
and bsmc2
has been removed.
More work to obviate warnings generated by T. Kalibera's latest rchk
checks.
Messages from the compiler resulting from attempts to compile C snippets are now suppressed on all platforms except in case of failure.
Setting verbose=TRUE
forces display of these messages.
Source codes have been revisited to obviate warnings generated by T. Kalibera's latest rchk
checks.
Fix a minor bugs in spect
.
Improve test coverage.
spect.match
has been refactored, with small changes to the interface.
pomp
now handles specification of workhorse functions (i.e., rprocess
, dprocess
, rmeasure
, dmeasure
, initializer
, skeleton
, rprior
, dprior
, fromEstimationScale
, toEstimationScale
) as NULL
more consistently.
Fix bug in systematic resampler when np != nw
.
Fix bug in conv.rec
when only one parameter is requested.
Correct and improve documentation for conv.rec
.
coef<-
can now take a list of parameters:
it simply applies unlist
to turn the list into a numeric vector.
Simplify conv.rec
.
In pfilter
, Np
is now a required argument unless params
is specified as a matrix of particles.
Thanks to Carles Breto for catching the unintended behavior.
The bug reported in issue #57 has been fixed.
A bug arising when building pomp objects with Csnippets in certain Windows configurations has been fixed.
Issue #56, in which covariate names are discarded when coercing a pomp object to a data frame, has been fixed. Thanks to Eamon O'Dea for reporting this bug.
More informative error messages are given when bake
or freeze
return NULL
.
In such a case, these functions now generate a warning and return a character-string message, with attributes.
Improve documentation of traj.match
, in response to Issue #57.
A new facility, gillespie.hl.sim
, allows implementation of Gillespie's algorithm for exact stochastic simulation of continuous-time Markov processes via a streamlined C snippet interface.
The old facility for Gillespie simulations, gillespie.sim
, now accepts C snippets for faster calculation of event rates.
The old skeleton.type
and skelmap.delta.t
arguments of the pomp
constructor, which have generated error messages since version 1.9.2, have been done away with completely.
Eamon O'Dea identified a bug (Issue #54) occurring when pomp
is called with a single-row data frame.
This has been fixed using his contributed patch.
A new dmultinom
function is provided in ‘pomp.h’.
This provides the probability distribution function for the multinomial distribution.
Improved tests.
Fixed bugs emerging in R-devel due to refactoring of underlying R source code.
Eamon O'Dea pointed out that the bug in gillespie.sim
, addressed by version 1.12.3, was not completely fixed.
This problem has now been resolved.
In addition, covariates are now guaranteed to be evaluated at least once per observation interval.
The new argument hmax
to gillespie.sim
allows the user to specify the maximum step size that will be taken before covariates are evaluated.
The K-leap method has been removed. Its accuracy is low on test problems and it is difficult to make it compatible with the pomp paradigm. In particular, it does not readily accomodate time-varying covariates in a sensible way, nor does it lend itself to simulations at pre-specified times.
bspline.basis
and periodic.bspline.basis
now take an optional non-negative integer argument deriv
.
When deriv > 0
, the order-deriv
derivative of each basis function is returned.
A new function, periodic_bspline_basis_eval_deriv
, has been added to the C API.
This function gives access, at the C level, to evaluation of the derivatives of periodic B-splines.
Upgrade license to GPL version 3.
Fix buffer-flow problem identified by valgrind
.
Fix bug found by Eamon O'Dea in gillespie.sim
.
Fix bug in onestep.sim
.
The Ricker example has a new parameter, c, which scales the (unobserved) population size. By default, c=1, so that the behavior is as before.
Improved error trapping.
Some changes have been made to the use of random numbers in some codes (the stochastic simulations in gillespie.sim
and the resampling in the particle-filtering codes).
These changes will mean that calculations performed before will not be reproducible in perfect detail, but will be statistically equivalent.
Minor changes in C codes to obviate warnings generated by T. Kalibera's rchk
checks.
The rare and fascinating “Bug of St. Patrick” has been fixed. Thanks to Carles Breto for finding the bug and helping to isolate it.
More informative error messages are generated when dmeasure
returns a non-finite likelihood in any of the particle filtering codes.
Some streamlining of codes.
Callable routines are now registered.
The functions bake
, stew
, and freeze
now preserve information about the system time used in computation as an attribute of the returned object.
In addition, these functions store information about the RNG settings.
Some documentation improvements, courtesy of Sebastian Funk.
Various documentation improvements.
More verbosity is provided with verbose=TRUE
.
Better handling of pomp
's times
argument.
New logLik
method for pmcmcList
objects.
The deprecated option to supply a matrix or numeric vector as the data
argument to pomp
have been removed and an error is now generated.
data
must be provided as either a data frame or an object of class pomp
.
See ?pomp
for details.
The deprecated skeleton.type
and skelmap.delta.t
arguments to pomp
have been removed.
Using these arguments will now generate an error message.
The correct method of specifiying the deterministic skeleton is now explained in the help pages (?pomp
).
Source code fixes to eliminate warnings during compilation.
Improved test suite.
Minor documentation correction.
During particle filtering, when non-finite dmeasure
values are generated, an error is generated and the offending parameters, states, data, and time are reported.
In methods that use parameter transformations (transform=TRUE
), the reported parameters were on the transformed (estimation) scale, which can be confusing.
The error message now gives the parameters on the natural (model) scale.
Modified ‘src/ssa.c’ to fix UBSAN errors.
C codes have been modified to take advantage of changes to the R API (R SVN REVISION 71180).
A bug in mif2
arising when filtering fails in the final timestep has been fixed.
In this case, when all particles are deemed inconsistent with the data, we use an unweighted mean (with a warning) in place of the default weighted mean.
C codes have been modified to take advantage of changes to the R API (R SVN REVISION 71180).
Modified ‘src/ssa.c’ to fix UBSAN errors.
There is a new option, shlib.args
, to pomp
.
This allows arbitrary options to be passed to the compiler when C snippets are used.
In particular, one can link a library of C snippets against a precompiled static library.
In Sobol' sequence generation (sobolDesign
, profileDesign
), we now use the suggestion of Joe & Kuo (2003) to choose a better sequence start point.
The generation of Sobol' sequences (sobolDesign
, profileDesign
) is now performed using the NLopt routines written in C instead of the original TOMS 659 FORTRAN codes.
The copyright notices are located in the source code.
The stochastic simulation algorithms underlying the Gillespie and K-leap methods (gillespie.sim
, kleap.sim
) have been refactored in C.
In addition, errors due to accumulation of round-off error have been repaired.
The result will be more accurate, but somewhat slower when there are a very large number of reactions.
Fixed a bug in plot
on pomp
objects with more than 10 variables to plot.
Refactored rw.sd
for greater stability.
Modified the “dacca” example to use C snippets.
Made Sobol' codes more robust.
Modified the demos to use best practices.
Further improvements to the test suite. Code coverage is now 100%.
Improvement of the test suite and of error messages.
Improve the show
and print
methods for pomp
objects.
Some internal refactoring.
Improve error messages for missing basic components.
Fix typos in one of the help-page examples.
Several obscure bug-fixes.
Add some references.
Major revisions to the package help pages and manual.
The separate documentation on C snippets and process-model plugins has been merged into the main pomp
help page, which now has comprehensive instructions on building a pomp
object.
Update to the package help page.
New methods for the Ensemble Kalman Filter (enkf
) and Ensemble Adjustment Kalman Filter (eakf
) have been added to the package.
There is a new plugin for rprocess
called kleap.sim
.
This implements the so-called “K-leap method” of Cai & Xu (2007).
Major overhaul of error handling system and to error and warning messages. Many more errors are now trapped and reported with more informative messages.
The matrix and numeric vector options for the data
argument to pomp
are now deprecated and will be removed in a future release.
In calls to pomp
, data
should be either a data frame or a pomp
-class object.
In mif2
, it is now required that Nmif>0
.
Redundant bootstrap
argument to nlf
has been removed.
Many improvements to the test suite to obtain better code coverage.
Fixed bugs that might arise in rare circumstances in simulate
and eulermultinom
functions.
Fixed a bug in pompExample
.
Fixed several small, rare bugs found as a result of improved testing.
Fixed bug in specification of skeleton in pompExamples.
pomp
is no longer an S4 method.
Its new status as an ordinary function abbreviates and consolidates the code and simplifies the documentation.
A bug restricting access in C code to userdata
has been fixed.
Fixed bug in pompExample(...,show=TRUE)
.
A better interface for specifying a model's deterministic skeleton is provided.
One specifies skeleton=map(f,delta.t)
for a discrete-time skeleton (a map) and skeleton=vectorfield(f)
for a continuous-time skeleton (a vectorfield).
The old arguments skeleton.type
and skelmap.delta.t
are deprecated and will be removed in a future release.
The pfilter
help page has been improved.
Specifically, the discussion of filtering failures is better.
Miscellaneous improvements to the help pages.
mif2
no longer computes filter means.
The new argument show
of pompExamples
allows one to display the example code instead of executing it.
The minimum version of R supported is now 3.1.2.
init.state
now has the optional argument nsim
.
Using this, one can request multiple initial state vectors per parameter vector.
pfilter
now uses less memory when it is asked to run at a single point in parameter space.
A bug associated with the rw.sd
argument to mif2
on Windows platforms has been fixed.
The method="mif2"
option to mif
has been removed.
Use mif2
instead.
The particles
method (rarely if ever used), has been removed to streamline the mif
codes.
The method="mif2"
option to mif
is now deprecated.
It will be removed in a future release.
Use mif2
instead.
Following the publication of the Journal of Statistical Software announcement paper, the ‘CITATION’ has been modified to include the appropriate citation.
Please use citation("pomp")
to learn about how to cite pomp correctly.
conv.rec
on the results of a mif2
computation now play nicely with reshape2::melt
.
It is now possible to direct pomp
to place Csnippet
codes in a specified location.
This is accomplished via the new cdir
and cfile
arguments to pomp
.
When several concurrent R processes attempt to simultaneously compile Csnipet
code from copies of a pomp
object on the same machine, a race condition exists.
This release fixes this by ensuring that Csnippet
codes are written and compiled in a process-specific directory.
This release removes several long-deprecated features.
The seed
argument to pfilter
has been removed.
Use freeze
to obtain similar functionality.
The redundant pars
argument to mif
has been removed.
Names of parameters to be estimated are taken from the nonzero entries of rw.sd
.
Initial-value parameters are designated using the ivps
argument.
The old parameter.transform
and parameter.inv.transform
arguments to pomp
have been removed.
They were superseded by the arguments fromEstimationScale
and toEstimationScale
in version 0.65-1.
Some internal changes to mif2
by C. Breto, in support of panel methods under development.
Bug fix: for POMPs with a scalar state variable, the filter.mean
, pred.mean
, and pred.var
methods dropped the singleton dimension of the respective arrays, in conflict with the assumptions of certain plot
methods.
This resolves issue #3.
Documentation improvements.
Specifically, the details of how step-sizes are chosen in the euler.sim
, discrete.time.sim
, and onestep.sim
plugins has been spelled out explicitly.
Also, incompleteness in the sannbox
documentation has been corrected.
Provide filter.traj
method for pmcmcList
objects.
Fixed a bug in mif
and mif2
when cooling.type="hyperbolic"
and cooling.fraction.50=1
.