Main Content

resamplingPolicyPF

Create resampling policy object with resampling settings

Since R2019b

Description

The 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 stateEstimatorPF object.

Creation

Description

example

policy = resamplingPolicyPF creates a resamplingPolicyPF object policy, which contains properties to be modified to control when resampling should be triggered. Use this object as the ResamplingPolicy property of the stateEstimatorPF object.

Properties

expand all

Method for determining if resampling should occur, specified as a character vector. Possible choices are 'ratio' and 'interval'. The 'interval' method triggers resampling at regular intervals of operating the particle filter. The 'ratio' method triggers resampling based on the ratio of effective total particles.

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 never executed.

This property only applies with the TriggerMethod is set to 'interval'.

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 triggered.

Examples

collapse all

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.

pf.ResamplingPolicy
ans = 
  resamplingPolicyPF with properties:

                TriggerMethod: 'ratio'
             SamplingInterval: 1
    MinEffectiveParticleRatio: 0.5000

Check the policy settings of the new particle filter.

pf2.ResamplingPolicy
ans = 
  resamplingPolicyPF with properties:

                TriggerMethod: 'interval'
             SamplingInterval: 3
    MinEffectiveParticleRatio: 0.5000

Version History

Introduced in R2019b