NEWS | R Documentation |
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
.
There is a new, adaptive MCMC proposal function, mvn.rw.adaptive
that can be used in pmcmc
and abc
.
The new covmat
method, applied to abc
, abcList
, pmcmc
, or pmcmcList
objects, returns an inflated empirical covariance matrix suitable for use as input to the proposal generator mvn.rw
.
The deprecated transform.params
argument from nlf
has been removed.
The deprecated pars
and rw.sd
arguments from abc
and pmcmc
have been removed.
The deprecated data.array
method has been removed.
The default value of max.fail
for pmcmc
is now Inf
.
That is, by default pmcmc
will not halt (but will issue a warning) when filtering failure occurs (i.e., no particles are consistent with the data, as defined by the likelihood threshold tol
).
logmeanexp
has used a delta-method estimate of the variance in log(mean(exp(x))) when se = TRUE
.
This gave misleadingly small values when the variance in exp(x) was large.
The new logmeanexp
uses a jackknife estimate of the variance.
This is still conservative, in that it is biased upwards, but is more robust.
pomp now includes magrittr, plyr, reshape2, ggplot2, and knitr in its Suggests
field:
these packages are available for use in pompExample
s and package tests.
There is now a coef
method for mifList
and mif2List
objects.
By default, when Csnippet
s are used, the source code is now stored internally to the pomp
object.
When a pomp
object is used, a test is first performed to see if the needed shared-object file exists.
If it does not, the source code is written to a file in the session's temporary directory, which is then compiled and loaded.
This feature allows pomp
objects to be stored and reused across R sessions.
The name of the file is constructed using a hash of the file's contents.
The functions bake
and stew
have arguments that allow the control of the RNG.
These functions can now set the state (and kind) of the RNG and restore it when they return.
The new function freeze
allows control of the RNG similarly.
The seed
argument of bsmc
and bsmc2
has been removed.
Its use now generates a warning, stating that it has no effect.
The seed
argument to pfilter
is now deprecated and will be removed soon.
Equivalent functionality is provided via freeze
, bake
, or stew
.
The new functions bake
and stew
faciliate storing expensive calculations for later retrieval in a transparent fashion.
pompBuilder
, which has not been actively maintained for time due to the fact that its facilities are all provided by pomp
via Csnippet
s, is now no longer exported.
pmcmc
and pfilter
now have the capability of saving filtered trajectories.
These can be extracted using the new method filter.traj
.
The principal use will be in conjunction with pmcmc
, where, upon convergence to the posterior, samples from the filtered trajectories are draws from the posterior P[x[1:T] | y[1:T]].
Thanks to Sebastian Funk for initiating this development.
partrans
and parmat
have been jiggered to make them play better with reshape2::melt
.
Some of the underpinnings of nlf
have been streamlined for speed.
Measles data from England and Wales, kindly provided by Ben Bolker, are now included as ewmeas
and ewcitmeas
.
When using Csnippet
s, by default, the C codes and shared-object files are stored in the R session's temporary directory.
One can override this behavior by setting the global pomp.cache
option.
A pomp
object's initializer can now be specified as a Csnippet.
The default initializer is now considerably faster.
A full-featured version of IF2, an improved iterated filtering algorithm, is now available as mif2
.
This allows a more general structure for the random perturbations applied to parameters and is generally more efficient and stable than IF1.
In the pomp
constructor, unrecognized arguments are stored internally for use with user-supplied model functions.
As of this version, an informative message is generated when this happens.
Previously, this silent behavior was a source of confusion for some users.
The unfortunately named pomp
arguments parameter.transform
and parameter.inv.transform
have been deprecated in favor of the more mnemonic toEstimationScale
and fromEstimationScale
.
Using the old arguments will result in the same behavior as previously, but a warning will be generated.
The mif
option cooling.fraction
has been replaced by the more descriptive cooling.fraction.50
.
Recall that this parameter specifies the fraction of random-walk remaining after 50 mif
iterations.
Fixed bug arising when using pomp
with Csnippets
under windows.
Thanks to Hamish McCallum for reporting it.
Improvements to documentation.
The optimization packages nloptr and subplex are no longer dependencies of pomp that will be loaded at the time pomp is. Instead, they are imported as needed.
Bug fix in partrans
when transformations are implemented using Csnippet
s.
Remove the verhulst
example.
mif
now has the default value var.factor=1
.
Since var.factor
has long been a required parameter, this change is backward compatible.
The long-deprecated cooling.factor
option to mif
has now been removed.
mif
's pars
argument, which is redundant, is now deprecated.
In a future release, this argument will be removed.
When using Csnippet
s or pompBuilder
, it is no longer necessary to manually load and unload the dynamically loadable library.
This is now handled automatically.
Accordingly, the link
argument of pompBuilder
has been removed.
The pompLoad
and pompUnload
functions introduced in 0.58-1 remain available, though they should rarely be needed.
pmcmc
and abc
can now use arbitrary symmetric proposal distributions via the proposal
argument.
For the moment, these are constrained to be symmetric.
Two new functions, mvn.diag.rw
and mvn.rw
generate suitable proposal functions.
The first generates a multivariate normal random-walk proposal with diagonal variance-covariance matrix; this duplicates the old behavior of both abc
and pmcmc
.
The second, mvn.rw
, corresponds to a multivariate normal random-walk proposal with arbitrary variance-covariance matrix.
In pmcmc
and abc
, the arguments pars
and rw.sd
are now unneeded and have been deprecated.
Use of rw.sd
will generate a warning and result in behavior equivalent to choosing proposal=mvn.diag.rw(rw.sd)
.
Use of pars
will be ignored, with a warning.
In nlf
, the transform.params
argument is now deprecated;
use instead the transform
argument, as in the other inference methods.
A bug in spect.match
has been fixed.
Thanks to Karsten Hempel for finding it and contributing the fix.
Compiler messages are now suppressed by default when Csnippet
s are used in construction of a pomp
object.
These can be enabled by setting options(verbose=TRUE)
.
A pomp
object created with Csnippet
s or pompBuilder
will now remember its associated shared-object file, which can be unloaded and reloaded using the new pompUnload
and pompLoad
methods.
simulate
has a new argument, include.data
, that when used in conjuncion with as.data.frame=TRUE
will include the actual data in the resulting data frame along with the simulations.
Revamped the pompExample
function.
A search path for example directories is now stored in global option "pomp.examples".
New values
method extracts simulated probe values on probed.pomp
object.
Better documentation in the ‘pomp.h’ header file.
Vignettes now feature bsmc2
instead of bsmc
.
A modified version of the Liu and West (2001) algorithm is included as bsmc2
.
By default, when B
is of class bsmcd.pomp
, plot(B)
ignores fixed parameters.
A bug having to do with paths to the temporary C files, encountered when using Csnippet
s under windows, has been fixed.
Package demos are now checked by R CMD check
on all platforms.
nlf
now returns an S4 object of class nlfd.pomp
with a logLik
method for extracting the log quasi likelihood and a $
method for extracting arbitrary components.
The transform
argument (for providing a function to transform the data) has been removed in favor of transform.data
.
The new mifList
class facilitates approaches based on multiple mif
runs.
The c
method constructs mifList
s from mif
s.
The plot
method produces diagnostic plots.
compare.mif
is now deprecated in favor of plot
applied to a mif
or mifList
.
transform
argument for pmcmc
and abc
has been removed.
More informative error messages are generated when a needed variable cannot be found.
Features that facilitate multiple ABC chains have been added.
There is a c
method to combine abc
objects into an abcList
object and to combine abcList
objects.
Running conv.rec
on an abc
or abcList
object produces coda mcmc
and mcmc.list
objects, respectively.
Diagnostic plots are produced by running plot
on such objects.
Basic structure of pmcmcList
and abcList
objects is changed: these objects now inherit directly from list
.
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 and to combine pmcmcList
objects.
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 as obsolete.
Fix bug in compare.pmcmc
.
Introduced new compare.pmcmc
and compare.abc
functions, comparable to compare.mif
.
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.
pomp
can now take snippets of C code directly as definitions of the various basic functions.
This is accomplished through the use of a new Csnippet
function.
See the ‘sir’ demo for a demonstration.
It is now possible to specify global variables and typedefs using the globals
argument to pompBuilder
and pomp
.
See the ‘sir’ demo for a demonstration.
Thanks to Carl Pearson for the suggestion.
A new method, probe.match.objfun
, constructs objective functions suitable for use in optimizers.
pomp
now depends on nloptr
, which provides a suite of optimization algorithms.
This package can now be used in various methods for optimization of an objective function.
New inline C functions to_log_barycentric
and from_log_barycentric
are provided in ‘pomp.h’ to facilitate log-barycentric transformations.
These have proven very useful in dealing with parameters constrained to sum to one (e.g., initial conditions of compartmental models).
Bug fix in periodic.bspline.basis
.
Package vignettes are no longer available via vignette()
but can be reached from the help index.
Correct a bug in abc
to do with parameter transformation.
Create new dprior
and rprior
slots for pomp
objects.
These will be used by the Bayesian methods (currently abc
, bsmc
, and pmcmc
).
The hyperparams
argument to these methods has been removed;
hyperparameters are now treated just as any others.
bsmc
can now be called so that the particles are drawn from the prior distribution (as set by the rprior
slot).
Some of the longer tests will only be run if an environment variable is set.
Revisit dacca
bug. Set negative compartments to zero along with compartments immediately downstream.
Fix bug that arises only very occasionally in the dacca
cholera example.
Modify dacca
model so that rare positivity violations are punished in a different way.
This modifies the formal model slightly.
By default, pompBuilder
now creates all files in the temporary directory.
abc
implements Approximate Bayesian Computation for pomp models.
pompExample
now has an optional argument, envir
, determining which environment the pomp
object will be loaded into.
logmeanexp
now has an optional argument, se
, allowing for computation of an approximate standard error.
bug fix in gompertz
example.
bug fix in pmcmc
: Metropolis-Hastings ratio was incorrect except for flat priors!
a fix so that pompBuilder
will find ‘pomp.h’ header file on Windows machines. Thanks to Dave Hayman for finding the problem.
new logmeanexp
function.
some reorganization of the source package structure.
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.
Fix bug with continue
and method "mif2"
.
new method to coerce pfilterd.pomp
objects to data-frames.
profileDesign
can now handle variables of mixed type.
New "mif2"
option for mif
.
The default behavior for mif
and pfilter
with respect to filtering failures has been changed.
Before, the default behavior has been to stop with an error on the first filtering failure (max.fail=0
).
Now, the default is max.fail=Inf
, i.e., an error is never triggered.
The implementation of MIF cooling schedules has been changed to make it more general.
The cooling schedule is now specified by a type
and a fraction
.
Currently, supported cooling.type
s include geometric
(the old behavior) and hyperbolic
, i.e., a 1/(1+n) schedule.
The cooling.fraction
argument specifies the cooling at 50 iterations.
That is, if s
is the intensity of the random-walk perturbation to parameters at the first iteration (rw.sd
), then the intensity at iteration 50 is s*cooling.fraction
.
Remove all data()
-loadable pomp
objects.
To load the prebuilt example pomp
objects from previous versions, use the new pompExample
function.
E.g., instead of data(euler.sir)
, do pompExample("euler.sir")
.
Clean up tests.
Fix bug in pompBuilder
on mac.
Fix bug in dmeasure
when log=TRUE
. Bug located by R. Reiner.
Add eff.sample.size
and cond.logLik
methods for pfilterd.pomp
objects.
Modify traj.match.objfun
to allow arbitrary parameters to be passed to the ODE integrator.
Add params
argument to pomp
so that parameters can be specified at the time the pomp
object is created.
Improve error checking in pomp
.
Add support for covariates to pompBuilder
.
Add native parameter transformation routines to the demos.
Change the warning behavior in lookup_table
so that warnings are not generated unless true extrapolation is performed (i.e., eliminate the warnings at the boundary).
Some small modifications to the ‘pomp.h’ header file.
When trajectory
calls ode
, there is a need to preserve information across calls to the vectorfield-evaluating function.
The code has been modified to do this in a cleaner way.
Several minor bugs have been fixed. See the ChangeLog for details.
An EXPERIMENTAL facility for constructing pomp
objects out of native C routines is now included (pompBuilder).
This facility is being actively developed and future changes may not be backward compatible.
A new facility allowing access to the userdata
slot of a pomp
object from compiled rprocess
, rmeasure
, dprocess
, dmeasure
, skeleton
, and partrans
codes is now available.
Calls to the new C routines get_pomp_userdata
, get_pomp_userdata_int
, and get_pomp_userdata_double
allow retrieval of these elements.
Some of the data()
-loadable examples have been reworked to make use of the above facility.
The parameterization of these examples has changed.
These changes are not backward compatible: codes that depend on the data()
-loadable examples may be broken.
A demonstration of pompBuilder
has been put into the “advanced topics” vignette.
A bug in the blowflies
example has been fixed.
Thanks to Greg Minshall for discovering it.
The gompertz
example parameter transformations have been changed.
No longer are the names of the parameter vector changed in the transformation.
This change is not backward-compatible, but only codes using this example are affected.
The euler.sir
and gillespie.sir
examples have been changed.
The transmission rate β(t) is now the arithmetic sum of the seasonality basis functions.
Before, it was the geometric sum.
R_0 is now given by the arithmetic average of the β parameters divided by γ+μ.
This change is not backward-compatible, but only codes using these examples are affected.
An experimental facility for constructing pomp
objects with native C routines is now included.
The blowflies
, euler.sir
, gillespie.sir
, bbs
, and ricker
data()
-loadable examples have been changed to make the parameterization simpler and more natural.
This change is not backward-compatible, but only codes using this example are affected.
In trajectory
, all vectorfield and map evaluation is now done in C for speed.
For continuous-time dynamical systems, this gives an approximately 4-fold speedup.
Demos have been created to show some examples.
A segfault bug in bbs
example has been fixed.
The posterior medians (not means) are now stored in the params
slot of the bsmcd.pomp
object.
New arguments in mif
, nlf
, bsmc
, pmcmc
, probe-match
, and traj-match
allow the estimation to be done on a transformed parameter space.
When transform=TRUE
in these commands (transform.params=TRUE
for nlf
), estimation is performed on the transformed parameter space.
This is described and demonstrated in the “intro_to_pomp” vignette.
The data()
-loadable examples have been re-implemented to make use of the above-mentioned facility.
Note that this new functionality makes it unnecessary to un-transform model parameters within the user-specified rprocess
, dprocess
, rmeasure
, dmeasure
, skeleton
, and initializer
codes.
This change is not backward-compatible, but only codes using these data()
-loadable example are affected.
The Bayesian sequential Monte Carlo command bsmc
now returns not a list but an object of class bsmcd.pomp
.
An experimental plot
method for objects of this class now exists.
Also, the parameter posterior means are now stored in the params
slot of the bsmcd.pomp
object:
access them with the coef
command as usual.
A new example, using data from an influenza outbreak in a British boarding school and an SIR model, has been included.
Do data(bbs)
to load it.
Setting the new argument as.data.frame
to TRUE
in simulate
and trajectory
causes the results to be returned as a data-frame.
A new method partrans
allows transformation of vectors or matrices of parameters.
The parameter transformations have been pushed into C for speed.
It is possible to specify native parameter transformation routines in addition to C functions, but this last facility has not yet been extensively tested.
A new slot has.trans
has been introduced into the pomp
class, and the types of slots par.trans
and par.untrans
have changed.
parmat
now gracefully handles the case when params
is already a matrix.
Error in the documentation of pfilter
repaired.
Thanks to Alex Smith for pointing this out.
Improvements in the documentation of the Nicholson blowflies data data(blowflies)
.
When a pomp
object is updated using pomp
, the params
slot will now be copied over (appropriately transformed).
Before, it was simply dropped.
The gillespie.sir
example has been changed to make the reporting rate equal to rho
.
Before, it was fixed at 10%.
A new error-trap has been put into probe
and probe.match
for the case nsim < nprobes
.
Thanks to Dani Jonas for finding this error.
More informative error messages when dimension of state space or data space disagree internally.
The weighted
argument to mif
and continue
is now deprecated in favor of a new argument method
.
The old weighted=TRUE
corresponds to method="mif"
while the old weighted=FALSE
corresponds to method="unweighted"
.
New functions traj.match.objfun
and probe.match.objfun
have been added.
These functions construct functions of one argument suitable for use as objective functions in optim
-like optimizers (iincluding subplex
and sannbox
).
Minimizing these functions solves the trajectory-matching problem and probe-matching problem, respectively.
This allows the user much greater flexibility in choice of optimization algorithm than is afforded by traj.match
and probe.match
.
The sannbox
optimizer, which performs simulated annealing with box constraints, is now exported and available for general use.
The bsmc
method has been improved, due to the contributions of Pierre Jacob.
Specifically, bsmc
no longer reports a log-likelihood (which it never actually computed anyway) but a log-evidence.
The latter computation was supplied by Pierre Jacob.
A new helper function, exp2geom_rate_correction
has been added to the ‘pomp.h’ file.
This function computes the rate r such that if N \sim geometric(prob=1-\exp(-r dt)) and T \sim exponential(rate=R), then E[N dt] = E[T].
This is useful in approximating a continuous-time death process by a discrete time (Euler) process.
In particular, in such a case, T
is the waiting time to death in the former and N*dt
is the waiting time to death in the latter.
An Euler binomial or multinomial process with rate r=exp2geom_rate_correction(R,dt)
will have the same mean waiting time as the exponential process with rate R
.
Thanks to Sebastien Ballesteros for suggesting this.
A new helper function, rgammawn
has been added, with both R and C interfaces.
This function draws an increment of a Gamma white-noise process with a given intensity.
Specifically, dw=rgammwn(sigma,dt)
is Gamma distributed with mean dt
and variance sigma^2*dt
.
In this case, mu*dw/dt
is suitable for use as a random rate in an Euler-multinomial process.
Thanks to Sebastien Ballesteros for suggesting this.
A bug to do with computation of the number of steps needed in discrete-time simulation and trajectory computations has been fixed. This bug was introduced in version 0.40-1.
It is now possible for discrete-time determistic skeletons to have a general step-size.
Before, the stepsize was always forced to be 1.
The new argument skelmap.delta.t
in pomp
(default value 1) sets this step-size.
NB: in implementing this feature, a new slot has been added to the basic pomp
class.
pomp
objects created with versions <0.40-1 will not therefore work with this version and must be re-created.
The deterministic skeleton trajectory functions now look for variables named in zeronames
and treat these variables as accumulators.
This brings the behavior of the deterministic skeleton functions into line with rprocess
.
A new section of the “advanced topics” vignette discusses accumulator variables and zeronames
.
Include the user manual PDF among the vignettes.
The new function parmat
creates a suitable matrix of parameters in one line.
Bug fix in bsmc
that arises when the state space is 1-D.
Thanks to Arnab Bhattacharya for finding the bug.
Some inconsistencies in the arguments of bsmc
have been fixed.
Minor corrections to the documentation for spect
, probe
, and traj.match
.
Fix infelicity in traj.match
and nlf
that arises when the data
slot has no rownames.
Rownames are not strictly required for the data
slot.
The sannbox
algorithm now should work even when the objective function throws a non-finite value.
The behavior now is to replace non-finite values with a large number.
This behavior follows that of the SANN
method in optim
.
The help files for pfilter
and mif
have been updated to explain how to use a variable number of particles in the particle filtering algorithm.
Inside init.state
, a check has been added to make sure that the user's initializer function returns a vector of uniform size, as per the algorithms' assumptions.
Thanks to Micaela Martinez-Bakker for catching this.
mif
has been modified so as to allow estimation of initial-value parameters alone via fixed-lag smoothing.
When po
is a pomp
-class object with covariates, as.data.frame(po)
and as(po,"data.frame")
now contain columns for the covariates.
The latter are interpolated, if necessary, at the observation times.
Bug fix: when pfilter
is called with a single parameter vector supplied in the params
argument, these parameters are copied into the params
slot of the resulting pfilterd.pomp
object.
Before, this failed when the params
slot of the pomp
object was empty.
A similar bug existed in traj.match
and has likewise been fixed.
To eliminate warnings and confusion during package check, profile.design
has been replaced by profileDesign
.
For parallelism, slice.design
and sobol.design
have been replaced by sliceDesign
and sobolDesign
, respectively.
The older forms are now deprecated and will be removed in a future release.
New facilities for parameter transformation are provided.
New optional arguments parameter.transform
and parameter.inv.transform
to pomp
allow the user to specify transformations between natural and internal parameter scalings.
A new option transfom
to coef
and coef<-
allows the user to get and set parameters on the natural scale.
See pomp?coef
and the “intro_to_pomp” vignette for details and examples.
Similarly, the conv.rec
method now takes an optional transform
argument.
Minor improvements to the documentation.
pfilter
will now give an error if ever a non-finite likelihood (dmeasure value) is returned.
Before, errors were only generated when dmeasure returned NA.
spect
now returns frequencies reflective of the observation times.
Before, the frequencies were given as fractions of the sampling frequency.
Improvements to the documentation.
Clarifications and minor improvements in the help pages.
A new section describing and demonstrating nonlinear forecasting has been added to the “intro to pomp” vignette.
Fixed bug in nlf
: desire for transient period (nconverge>0) was unrecognized.
Fixed bug in pomp
when data
is of class pomp
: userdata should be preserved.
Improved discussion of SIR model in “intro to pomp” vignette.
In pfilterd.pomp
objects, saved.states
and saved.params
slots are now length-ntimes lists of arrays.
It is now possible to use variable numbers of particles in pfilter
.
The Np
argument may be specified as a single number as before, or now as either a vector of numbers or a function.
The “advanced topics” vignette has been much augmented and improved.
The euler.sir
example (load it with data(euler.sir)
) has a different measurement model: a discretized normal distribution with the same mean and variance as before.
The arguments skeleton.map
and skeleton.vectorfield
are now deprecated.
Specify a discrete-time skeleton using skeleton.type="map"
and a continuous-time skeleton via skeleton.type="vectorfield"
.
pomp
is now a generic function.
Calling it on a pomp
object copies the object; one can optionally modify some of the slots.
Two new files ‘gompertz.R’ and ‘gompertz.c’ are in the ‘examples’ directory. These contain codes needed to reproduce the Gompertz example in the “intro_to_pomp” vignette.
The warning messages to do with the default behaviors of simulate
and trajectory
with respect to the arguments times
and t0
have been removed.
These warnings were introduced in version 0.34-1 to alert users to changes in the default behavior of simulate
and trajectory
introduced with that version.
See the help (pomp?simulate
, pomp?trajectory
) for details.
It is now possible to save both the states and particles portions of the filtering distributions computed in pfilter
.
This is accomplished by means of the logical save.states
and save.params
arguments to pfilter
.
The particles are stored in rank-3 arrays in the slots saved.states
and saved.params
.
This results in the need for a change in the structure of pfilterd.pomp
objects: note that pfilterd.pomp
objects (including mif
and pmcmc
objects) created under pre-0.37-1 version of the package will not load under versions >= 0.37-1.
trajectory
now gives a more informative error when no skeleton is present
pred.mean
, pred.var
, and filter.mean
methods are now defined for pfilterd.pomp
objects (and not just mif
objects)
A new data()
-loadable example is included: do ?blowflies
to read about it.
The B-spline basis construction functions bspline.basis
and periodic.bspline.basis
now take a names
argument that allows one to give names to the basis functions.
The “intro_to_pomp” vignette has been updated. The first part of the vignette centers on a new, more transparent first example.
A bug in pfilter
has been fixed. This bug was introduced in version 0.32-6 (SVN revision 315). Upon filtering failure, state variables were left un-updated. Thanks to Karim Khader for reporting circumstances that led to the identification of this bug.
There is now a method for loglik
on probed.pomp
objects. This returns the synthetic likelihood.
The box-constrained simulated annealing optimization method sannbox
is now an option in probe.match
.
Calling states
on a pomp
object having no unobserved states now fails gracefully (returning NULL rather than generating an error).
The rprocess plugin discrete.time.sim
now takes an optional delta.t
argument to allow for arbitrary (but still necessarily regular) spacing of observations. By default, delta.t=1.
There are two new classes: traj.matched.pomp
and pfilterd.pomp
to hold the results of traj.match
and pfilter
computations, respectively. The old classes mif
and pmcmc
now inherit from pfilterd.pomp
in a natural way.
When traj.match
is called, the returned traj.matched.pomp
object has its states
slot filled with the model trajectory at the fitted parameters.
More optimization methods are now provided in traj.match
. These include the new algorithm “sannbox”, an optionally box-constrained simulated annealing algorithm.
probe.match
is now an S4 method (like pfilter
, mif
, pmcmc
, and traj.match
) with methods for classes pomp
, probed.pomp
, and probe.matched.pomp
.
There is a change to the interface to pfilter
in that save.states
results in the filling of the last.states
slot. Before version 0.36-1, the pfilter
returned a list. The element states
of that list corresponds to the slot last.states
in version 0.36-1. It was necessary to make this name-change in order to avoid a conflict with the states
slot inherited from the pomp
class.
Added a facility for computation of ‘synthetic likelihood’ (Wood 2010) using a robust estimate of the covariance. A new slot in objects of class probed.pomp
holds this value.
The synthetic likelihood is now the quantity that is maximized in probe.match
.
Added the argument type
to probe.ccf
so that either cross-covariance or cross-correlation can be returned. probe.ccf
and probe.acf
now have comparable interfaces.
Changed the way that probe.acf
accepts lags. Now an arbitrary set of lags can be selected.
A bug in the new method obs
has been fixed.
A protection-stack overflow bug in probe
has been fixed.
The seed
slot in probed.pomp
and spect.pomp
objects has been removed, along with unwanted behavior to do with it.
Added a method to coerce probed.pomp
objects to data.frame
objects.
Fix bug when simulate
is run on objects that inherit from pomp
but are not themselves pomps.
simulate
should return pomp
objects when obs=FALSE
and states=FALSE
, regardless of what class object
is.
simulate
and rprocess
are accelerated somewhat through judicious use of memcpy
.
The default behaviors of simulate
and trajectory
with respect to the argument times
has changed.
There is a new argument, t0
, which specifies the time at which the initial conditions obtain.
The default for t0
is timezero(object)
.
The default for times
is now time(object,t0=FALSE)
(it was time(object,t0=TRUE)
).
This change eliminates an infelicity in which simulate
and trajectory
returned undesired values at the initial time.
Users can ensure that their codes will continue to function as intended by specifying the values of the times
and t0
arguments to these functions, thus removing dependence on the defaults.
To aid users in modifying their codes, a warning is now displayed whenever a potentially affected call is made.
These warnings will be removed in a future release.
See the documentation (pomp?simulate
, pomp?trajectory
) for a description of the new default behaviors.
The states
slot now holds values of the state process only at the times given in the times
slot.
This is a change from the earlier behavior in which the states
slot sometimes included the value of the state process at t0
.
simulate
has been re-implemented in C for speed.
A new method obs
for pomp
objects returns the contents of the data
slot.
It is synonymous with data.array
.
A banner is now displayed on package attachment.
coef<-
now behaves like ordinary vector assignment.
probe
and spect
now take an argument params
.
probe.cov
and probe.cor
have been removed in favor of probe.acf
and probe.ccf
.
The functions euler.simulate
, onestep.simulate
, and onestep.density
, deprecated since version 0.29-1, have been removed.
Major improvements in speed in the probe-matching routines have been realized by coding the computationally-intensive portions of these calculations in C.
New probes recommended by Simon Wood (Nature 466:1102-1104, 2010) have been implemented.
In particular, the new function probe.marginal
regresses the marginal distributions of actual and simulated data against a reference distribution, returning as probes the regression coefficients.
probe.marginal
and probe.acf
have been coded in C for speed.
pomp now includes parameter estimation methods based on probe-matching and power-spectrum-matching as explained in papers by Kendall et al. (Ecology, 80:1789–1805, 1999) and Reuman et al. (Proc. Nat'l. Acad. Sci., U.S.A. 103:18860–18865, 2006).
new window
, timezero
, and timezero<-
methods are available for manipulating pomp
objects.
pomp now includes an implementation of the particle Markov chain Monte Carlo algorithm of Andrieu et al. (J. R. Stat. Soc. B 72:1–33, 2010).
This algorithm is implemented in the method pmcmc
: see help(pmcmc)
for details.
Implementation primarily due to Ed Ionides.
pomp now includes an implementation of the approximate Bayesian Sequential Monte Carlo algorithm of Liu & West (Liu, J. & West, M. (2001) Combining Parameter and State Estimation in Simulation-Based Filtering. In Doucet, A.; de Freitas, N. & Gordon, N. J. (eds.) Sequential Monte Carlo Methods in Practice, Springer, New York, pp. 197–224).
This algorithm is implemented in the method bsmc
: see help(bsmc)
for details.
Thanks to Matt Ferrari and Michael Lavine for the implementation.
The cholera transmission model from King, A. A., Ionides, E. L., Pascual, M., and Bouma, M. J. (2008) Inapparent infections and cholera dynamics, Nature 454:877–880 together with data from the Dacca district of historic Bengal are now included.
See help(dacca)
for details.
This is a major revision.
Big improvements to the documentation, including worked examples in vignettes and improvements to the manual pages.
Encoding models is now much easier through the use of “plugin” modules.
These are functions that write the rprocess
and dprocess
slots given minimal information on the structure of the model.
A plugin for continuous-time Markov process models using the Gillespie algorithm is available.
A plugin for discrete-time Markov processes is now available.
Several example pomps are now loadable via the data()
command.
There are changes in the C interface to measurement models that are NOT BACKWARD COMPATIBLE. Existing user measurement model codes will need to be modified, but these changes are minor.
The changes are documented in detail in the file ‘CHANGES_0.29-1.txt’.
The nonlinear forecasting method of Kendall, Ellner, et al. is now implemented in the package. This is an “indirect inference” method using quasi-likelihood as an objective function.
Improved documentation in ‘euler.Rd’.
Trajectories of the deterministic skeleton can now be computed via the method trajectory
.
Bug fix in stochastic Euler algorithm.
Better error handling in mif
Fix inaccuracy in documentation of pomp
arguments rmeasure
and dmeasure
Bug fix in convergence record storage
Bug fix in “intro_to_pomp” vignette
Better error handling and improved documentation for mif
Testing of examples in the ‘examples’ directory, including compilation, linking, and running of dynamically-loadable library on unix machines
A bug in the Euler simulator was repaired.
The Euler simulator no longer calls GetRNGState()
and PutRNGState()
.
When a native routine is used for the Euler step, it must contain these calls.
A potential bug in the Euler-multinomial simulator was repaired.
The lookup_table (see file ‘include/pomp.h’) interface for C codes has been streamlined.
It is now slightly more straightforward to set up a struct lookup_table
.
See the examples (‘include/examples’).
Added ‘logistic.R’ to the ‘tests’ directory. This is a one-variable stochastic differential equation simulated using Euler-Maruyama.
The SIR example (‘examples/sir.R’) now includes two pomps: one with native routines implementing rprocess, dprocess, and skeleton, the other using R files. The comparison may be instructive.
Several bugs fixed.
This is a major revision.
The basic structure of the pomp
class has been changed to better support the use of native routines as well as R functions.
In particular, the rmeasure
, dmeasure
, and skeleton
methods can now be specified either as R functions or as native routines.
Native routines are specified by name; an optional PACKAGE
argument is provided to narrow the search.
The search is done not at the time of the call to pomp
but at the time the function is used.
Support has been added for covariates, in the form of lookup tables.
This has been accomplished through the addition of slots tcovar
, covar
, and covarnames
to the pomp
class.
rmeasure
, dmeasure
, skeleton
, and init.state
now perform lookup when covariates exist and pass this information to the user-defined function.
rprocess
and dprocess
receive the full lookup table (tcovar
plus covar
).
rmeasure
, dmeasure
, and skeleton
are now specified by a function (or native routine) that does the computation for ONE state vector and ONE parameter vector.
This is analogous to the way that init.state
has operated from the beginning.
It greatly simplifies model specification from the user's point of view without changing the low-level methods interfaces (pomp methods rmeasure
, dmeasure
, skeleton
, init.states
).
However, this change is not backward-compatible: users will need to rewrite code for the rmeasure
, dmeasure
, and skeleton
slots.
In practice, this should not be difficult.
It involves removing loops over times
and columns of params
and (if covariates are used in the measurement model or deterministic skeleton) making use of the covars
argument passed to the user function.
The interface to the euler.simulate
and euler.density
facilities have changed to make them consistent with the new pomp class.
The header files have been reorganized: ‘include/euler.h’ and ‘include/lookup_table.h’ have been replaced with a single ‘include/pomp.h’. Significant additions have been made to support the new structure of the pomp class. Specifically, new prototypes have been defined for native routines to implement the measurement model, the process model, and the deterministic skeleton.