Beliefs

Types

ParticleFilters.jl provides two types of particle beliefs. ParticleCollection is little more than a vector of unweighted particles. WeightedParticleBelief allows for different weights for each of the particles.

Both are subtypes of AbstractParticleBelief and implement the same particle belief interface. For probability mass calculations (the pdf function), a dictionary containing the normalized sum of weights for all identical particles is created on the first call and cached for efficient future querying.

Interface

Standard POMDPs.jl Distribution Interface

The following functions from the POMDPs.jl distributions interface provide basic ways of interacting with particle beliefs as distributions (click on each for documentation):

Particle Interface

These functions provide access to the particles and weights in the beliefs (click on each for docstrings):

Interface Docstrings

Base.randFunction
rand(rng::AbstractRNG, d::Any)

Return a random element from distribution or space d.

If d is a state or transition distribution, the sample will be a state; if d is an action distribution, the sample will be an action or if d is an observation distribution, the sample will be an observation.

Distributions.pdfFunction
pdf(d::Any, x::Any)

Evaluate the probability density of distribution d at sample x.

Distributions.supportFunction
support(d::Any)

Return an iterable object containing the possible values that can be sampled from distribution d. Values with zero probability may be skipped.

StatsBase.modeFunction
mode(d::Any)

Return the most likely value in a distribution d.

Statistics.meanFunction
mean(d::Any)

Return the mean of a distribution d.

ParticleFilters.probdictFunction
probdict(b::AbstractParticleBelief)

Return a dictionary mapping states to probabilities.

The probability is the normalized sum of the weights for all matching particles.

For ParticleCollection and WeightedParticleBelief, the result is cached for efficiency so the calculation is only performed the first time this is called. There is a default implementation for all AbstractParticleBeliefs, but it is inefficient (it creates a new dictionary every time). New AbstractParticleBelief implementations should provide an efficient implementation.

source