Documentation ¶
Index ¶
- func AlphaGauss(r, c int) float64
- type BF
- func (b *BF) Particles() mat.Matrix
- func (b *BF) Predict(x, u mat.Vector) (filter.Estimate, error)
- func (b *BF) Resample(alpha float64) error
- func (b *BF) Run(x, u, z mat.Vector) (filter.Estimate, error)
- func (b *BF) Update(x, u, z mat.Vector) (filter.Estimate, error)
- func (b *BF) Weights() mat.Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlphaGauss ¶
AlphaGauss computes optimal regulariation parameter for Gaussian kernel and returns it.
Types ¶
type BF ¶
type BF struct {
// contains filtered or unexported fields
}
BF is a Bootstrap Filter a.k.a. SIR Particle Filter. For more information about Bootstrap Filter see: https://en.wikipedia.org/wiki/Particle_filter#The_bootstrap_filter
func New ¶
func New(m filter.Model, ic filter.InitCond, q, r filter.Noise, p int, pdf distmv.LogProber) (*BF, error)
New creates new Particle Filter (PF) with the following parameters and returns it: - m: system model - init: initial condition of the filter - q: state noise a.k.a. process noise - r: output noise a.k.a. measurement noise - p: number of filter particles - pdf: Probability Density Function (PDF) of filter output error New returns error if non-positive number of particles is given or if the particles fail to be generated.
func (*BF) Predict ¶
Predict estimates the next system state and its output given the state x and input u and returns it. Predict modifies internal state of the filter: it updates its particle with their predicted values. It returns error if it fails to propagate either the filter particles or x to the next state.
func (*BF) Resample ¶
Resample allows to resample filter particles with regularization parameter alpha. It generates new filter particles and replaces the existing ones with them. If invalid (non-positive) alpha is provided we use optimal alpha for gaussian kernel. It returns error if it fails to generate new filter particles.
func (*BF) Run ¶
Run runs one step of Bootstrap Filter for given state x, input u and measurement z. It corrects system state estimate x using measurement z and returns a new state estimate. It returns error if it either fails to propagate particles or update the state x.