# ParticleFilter¶

class probnum.filtsmooth.particle.ParticleFilter(prior_process, importance_distribution, num_particles, rng, with_resampling=True, resampling_percentage_threshold=0.1)

Particle filter (PF). Also known as sequential Monte Carlo method.

A PF estimates the posterior distribution of a Markov process given noisy, non-linear observations, with a set of particles.

The random state of the particle filter is inferred from the random state of the initial random variable.

Parameters
• prior_process (MarkovProcess) – Prior Gauss-Markov process.

• importance_distribution (ImportanceDistribution) – Importance distribution.

• num_particles (Integral) – Number of particles to use.

• rng (Generator) – Random number generator.

• with_resampling (bool) – Whether after each step the effective number of particles shall be checked, and, if too low, the state should be resampled. Optional. Default is True.

• resampling_percentage_threshold (Real) – Percentage threshold for resampling. That is, it is the value $$p$$ such that resampling is performed if $$N_{\text{eff}} < p \, N_\text{particles}$$ holds. Optional. Default is 0.1. If this value is non-positive, resampling is never performed. If it is larger than 1, resampling is performed after each step.

Methods Summary

 filter(regression_problem) Apply particle filtering to a data set. filter_generator(regression_problem) Apply Particle filtering to a data set. importance_rv_generator(measmod, particles, …)

Methods Documentation

filter(regression_problem)[source]

Apply particle filtering to a data set.

Parameters

regression_problem (TimeSeriesRegressionProblem) – Regression problem.

Returns

• posterior – Posterior distribution of the filtered output

• info_dicts – list of dictionaries containing filtering information

TimeSeriesRegressionProblem

a regression problem data class

filter_generator(regression_problem)[source]

Apply Particle filtering to a data set.

Parameters

regression_problem (TimeSeriesRegressionProblem) – Regression problem.

Yields
• curr_rv – Filtering random variable at each grid point.

• info_dict – Dictionary containing filtering information

TimeSeriesRegressionProblem