Create resampling policy object with resampling settings
resamplingPolicyPF object stores settings for when
resampling should occur when using a particle filter for state estimation. The object
contains the method that triggers resampling and the relevant threshold for this
resampling. Use this object as the
ResamplingPolicy property of the
TriggerMethod — Method for determining if resampling should occur
'ratio' (default) | character vector
Method for determining if resampling should occur, specified as a
character vector. Possible choices are
triggers resampling at regular intervals of operating the particle filter.
'ratio' method triggers resampling based on the ratio
of effective total particles.
SamplingInterval — Fixed interval between resampling
1 (default) | scalar
Fixed interval between resampling, specified as a scalar. This interval
determines during which correction steps the resampling is executed. For
example, a value of 2 means the resampling is executed every second
correction step. A value of
inf means that resampling is
This property only applies with the
MinEffectiveParticleRatio — Minimum desired ratio of effective to total particles
0.5 (default) | scalar
Minimum desired ratio of effective to total particles, specified as a
scalar. The effective number of particles is a measure of how well the
current set of particles approximates the posterior distribution. A lower
effective particle ratio means less particles are contributing to the
estimation and resampling might be required. If the ratio of effective
particles to total particles falls below the
MinEffectiveParticleRatio, a resampling step is
Update Policy Settings of Particle Filter
Create a particle filter with the default settings.
pf = stateEstimatorPF;
Create a copy of the particle filter.
pf2 = copy(pf);
Create a policy object.
policy = resamplingPolicyPF;
Change the trigger mode to interval-based triggering and trigger resampling every third step.
policy.TriggerMethod = 'interval'; policy.SamplingInterval = 3;
Update the policy settings of the new particle filter with the policy object.
pf2.ResamplingPolicy = policy;
Check the policy settings of the original particle filter.
ans = resamplingPolicyPF with properties: TriggerMethod: 'ratio' SamplingInterval: 1 MinEffectiveParticleRatio: 0.5000
Check the policy settings of the new particle filter.
ans = resamplingPolicyPF with properties: TriggerMethod: 'interval' SamplingInterval: 3 MinEffectiveParticleRatio: 0.5000
Introduced in R2019b