ParticleFilter¶
- class probnum.filtsmooth.particle.ParticleFilter(prior_process, importance_distribution, num_particles, rng, with_resampling=True, resampling_percentage_threshold=0.1)¶
Bases:
BayesFiltSmooth
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 (Union[int, Integral, integer]) – 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 (Union[float, Real, floating]) – 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.
- Return type
None
Methods Summary
filter
(regression_problem)Apply particle filtering to a data set.
filter_generator
(regression_problem)Apply Particle filtering to a data set.
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
See also
TimeSeriesRegressionProblem
a regression problem data class
- filter_generator(regression_problem)[source]¶
Apply Particle filtering to a data set.
- Parameters
regression_problem (TimeSeriesRegressionProblem) – Regression problem.
- Raises
ValueError – If repeating time-points are encountered.
- Yields
curr_rv – Filtering random variable at each grid point.
info_dict – Dictionary containing filtering information
See also
TimeSeriesRegressionProblem
a regression problem data class