wpfilter {pomp} | R Documentation |

## Weighted particle filter

### Description

A sequential importance sampling (particle filter) algorithm.
Unlike in `pfilter`

, resampling is performed only when triggered by
deficiency in the effective sample size.

### Usage

```
## S4 method for signature 'data.frame'
wpfilter(
data,
Np,
params,
rinit,
rprocess,
dmeasure,
trigger = 1,
target = 0.5,
...,
verbose = getOption("verbose", FALSE)
)
## S4 method for signature 'pomp'
wpfilter(
data,
Np,
trigger = 1,
target = 0.5,
...,
verbose = getOption("verbose", FALSE)
)
## S4 method for signature 'wpfilterd_pomp'
wpfilter(data, Np, trigger, target, ..., verbose = getOption("verbose", FALSE))
```

### Arguments

`data` |
either a data frame holding the time series data,
or an object of class ‘pomp’,
i.e., the output of another pomp calculation.
Internally, |

`Np` |
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 length(time(object,t0=TRUE)) or as a function taking a positive integer argument.
In the latter case, |

`params` |
optional; named numeric vector of parameters.
This will be coerced internally to storage mode |

`rinit` |
simulator of the initial-state distribution.
This can be furnished either as a C snippet, an |

`rprocess` |
simulator of the latent state process, specified using one of the rprocess plugins.
Setting |

`dmeasure` |
evaluator of the measurement model density, specified either as a C snippet, an |

`trigger` |
numeric; if the effective sample size becomes smaller than |

`target` |
numeric; target power. |

`...` |
additional arguments are passed to |

`verbose` |
logical; if |

### Details

**This function is experimental and should be considered in alpha stage.
Both interface and underlying algorithms may change without warning at any time.
Please explore the function and give feedback via the pomp Issues page.**

### Value

An object of class ‘wpfilterd_pomp’, which extends class ‘pomp’. Information can be extracted from this object using the methods documented below.

### Methods

`logLik`

the estimated log likelihood

`cond_logLik`

the estimated conditional log likelihood

`eff_sample_size`

the (time-dependent) estimated effective sample size

`as.data.frame`

coerce to a data frame

`plot`

diagnostic plots

### Note for Windows users

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 `cdir`

and `cfile`

options to cause the C snippets to be written to a file of your choice, thus avoiding the use of temporary files altogether.

### Author(s)

Aaron A. King

### References

M.S. Arulampalam, S. Maskell, N. Gordon, and T. Clapp. A tutorial on particle filters for online nonlinear, non-Gaussian Bayesian tracking. *IEEE Transactions on Signal Processing* **50**, 174–188, 2002. doi:10.1109/78.978374.

### See Also

More on pomp elementary algorithms:
`elementary_algorithms`

,
`kalman`

,
`pfilter()`

,
`pomp-package`

,
`probe()`

,
`simulate()`

,
`spect()`

,
`trajectory()`

More on sequential Monte Carlo methods:
`bsmc2()`

,
`cond_logLik()`

,
`eff_sample_size()`

,
`filter_mean()`

,
`filter_traj()`

,
`kalman`

,
`mif2()`

,
`pfilter()`

,
`pmcmc()`

,
`pred_mean()`

,
`pred_var()`

,
`saved_states()`

More on full-information (i.e., likelihood-based) methods:
`bsmc2()`

,
`mif2()`

,
`pfilter()`

,
`pmcmc()`

*pomp*version 5.11.0.0 Index]