# Home

ParticleFilters.jl provides a basic particle filter representation along with some useful tools for constructing more complex particle filters.

In particular it provides both weighted and unweighted particle belief types that implement the POMDPs.jl distribution interface including sampling and automatic caching of probability mass calculations.

Additionally, an important requirement for a particle filter is efficient resampling. This package provides O(n) resamplers.

Dynamics and measurement models for the filters can be specified as a `ParticleFilterModel`

or a `POMDP`

or a custom user-defined type.

The simplest Bootstrap Particle filter can be constructed with `BootstrapFilter`

. `BasicParticleFilter`

provides a more flexible structure.

Basic setup of a model is as follows:

```
using ParticleFilters, Distributions
dynamics(x, u, rng) = x + u + randn(rng)
y_likelihood(x_previous, u, x, y) = pdf(Normal(), y - x)
model = ParticleFilterModel{Float64}(dynamics, y_likelihood)
pf = BootstrapFilter(model, 10)
```

Then the `update`

function can be used to perform a particle filter update.

```
b = ParticleCollection([1.0, 2.0, 3.0, 4.0])
u = 1.0
y = 3.0
b_new = update(pf, b, u, y)
```

There are tutorials for three ways to use the particle filters:

- As an estimator for feedback control,
- to filter time-series measurements, and
- as an updater for POMDPs.jl.

For documentation on all aspects of the package, see the contents below.