An iterated filtering algorithm for estimating the parameters of a partially-observed Markov process.
mif2 causes the algorithm to perform a specified number of particle-filter iterations.
At each iteration, the particle filter is performed on a perturbed version of the model, in which the parameters to be estimated are subjected to random perturbations at each observation.
This extra variability effectively smooths the likelihood surface and combats particle depletion by introducing diversity into particle population.
As the iterations progress, the magnitude of the perturbations is diminished according to a user-specified cooling schedule.
The algorithm is presented and justified in Ionides et al. (2015).
## S4 method for signature 'data.frame' mif2( data, Nmif = 1, rw.sd, cooling.type = c("geometric", "hyperbolic"), cooling.fraction.50, Np, params, rinit, rprocess, dmeasure, partrans, ..., verbose = getOption("verbose", FALSE) ) ## S4 method for signature 'pomp' mif2( data, Nmif = 1, rw.sd, cooling.type = c("geometric", "hyperbolic"), cooling.fraction.50, Np, ..., verbose = getOption("verbose", FALSE) ) ## S4 method for signature 'pfilterd_pomp' mif2(data, Nmif = 1, Np, ..., verbose = getOption("verbose", FALSE)) ## S4 method for signature 'mif2d_pomp' mif2( data, Nmif, rw.sd, cooling.type, cooling.fraction.50, ..., verbose = getOption("verbose", FALSE) )
either a data frame holding the time series data,
or an object of class ‘pomp’,
i.e., the output of another pomp calculation.
The number of filtering iterations to perform.
specification of the magnitude of the random-walk perturbations that will be applied to some or all model parameters.
Parameters that are to be estimated should have positive perturbations specified here.
The specification is given using the
See below for some examples.
The perturbations that are applied are normally distributed with the specified s.d. If parameter transformations have been supplied, then the perturbations are applied on the transformed (estimation) scale.
specifications for the cooling schedule,
i.e., the manner and rate with which the intensity of the parameter perturbations is reduced with successive filtering iterations.
the number of particles to use.
This may be specified as a single positive integer, in which case the same number of particles will be used at each timestep.
Alternatively, if one wishes the number of particles to vary across timesteps, one may specify
or as a function taking a positive integer argument.
In the latter case,
optional; named numeric vector of parameters.
This will be coerced internally to storage mode
simulator of the initial-state distribution.
This can be furnished either as a C snippet, an R function, or the name of a pre-compiled native routine available in a dynamically loaded library.
simulator of the latent state process, specified using one of the rprocess plugins.
evaluator of the measurement model density, specified either as a C snippet, an R function, or the name of a pre-compiled native routine available in a dynamically loaded library.
optional parameter transformations, constructed using
Many algorithms for parameter estimation search an unconstrained space of parameters.
When working with such an algorithm and a model for which the parameters are constrained, it can be useful to transform parameters.
One should supply the
additional arguments supply new or modify existing model characteristics or components.
When named arguments not recognized by
Upon successful completion,
mif2 returns an object of class
Np is anything other than a constant, the user must take care that the number of particles requested at the end of the time series matches that requested at the beginning.
In particular, if
T=length(time(object)), then one should have
Np is furnished as an integer vector and
Np is furnished as a function.
The following methods are available for such an object:
picks up where
mif2 leaves off and performs more filtering iterations.
returns the so-called mif log likelihood which is the log likelihood of the perturbed model, not of the focal model itself.
To obtain the latter, it is advisable to run several
pfilter operations on the result of a
extracts the point estimate
extracts the effective sample size of the final filtering iteration
Various other methods can be applied, including all the methods applicable to a
pfilterd_pomp object and all other pomp estimation algorithms and diagnostic methods.
rw.sd function simply returns a list containing its arguments as unevaluated expressions.
These are then evaluated in a context containing the model
This allows for easy specification of the structure of the perturbations that are to be applied.
rw.sd(a=0.05, b=ifelse(time==time,0.2,0), c=ivp(0.2), d=ifelse(time==time,0.2,0), e=ivp(0.2,lag=13), f=ifelse(time<23,0.02,0))
results in perturbations of parameter
a with s.d. 0.05 at every time step, while parameters
c both get perturbations of s.d. 0.2 only just before the first observation.
e, by contrast, get perturbations of s.d. 0.2 only just before the thirteenth observation.
f gets a random perturbation of size 0.02 before every observation falling before t=23.
On the m-th IF2 iteration, prior to time-point n, the d-th parameter is given a random increment normally distributed with mean 0 and standard deviation c[m,n] sigma[d,n], where c is the cooling schedule and sigma is specified using
rw.sd, as described above.
Let N be the length of the time series and alpha=
cooling.type="geometric", we have
cooling.type="hyperbolic", we have
where s satisfies
Thus, in either case, the perturbations at the end of 50 IF2 iterations are a fraction alpha smaller than they are at first.
To re-run a sequence of IF2 iterations, one can use the
mif2 method on a ‘mif2d_pomp’ object.
By default, the same parameters used for the original IF2 run are re-used (except for
verbose, the default of which is shown above).
If one does specify additional arguments, these will override the defaults.
Some Windows users report problems when using C snippets in parallel computations.
These appear to arise when the temporary files created during the C snippet compilation process are not handled properly by the operating system.
To circumvent this problem, use the
cfile options to cause the C snippets to be written to a file of your choice, thus avoiding the use of temporary files altogether.
Aaron A. King, Edward L. Ionides, Dao Nguyen
More on full-information (i.e., likelihood-based) methods:
More on sequential Monte Carlo methods:
More on pomp estimation algorithms:
approximate Bayesian computation,
More on maximization-based estimation methods:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.