kalman

package module
v0.0.0-...-3de1d23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2019 License: MIT Imports: 2 Imported by: 0

README

Adaptive Kalman filtering in Golang

License GoDoc goreportcard

go get github.com/konimarti/kalman

Adaptive Kalman filtering with Rapid Ongoing Stochastic covariance Estimation (ROSE)

Usage for standard Kalman filtering

	// create matrices and vectors
	...

	// create Kalman filter
	filter := kalman.NewFilter(
		X, // initial state (n x 1)
		P, // initial process covariance (n x n)
		F, // prediction matrix (n x n)
		B, // control matrix (n x k)
		Q, // process model covariance matrix (n x n)
		H, // measurement matrix (l x n)
		R, // measurement errors (l x l)
	)

	// get measurement (l x 1) and control (k x 1) vectors
	..

	// apply filter
	filtered := filter.Apply(measurement, control)
}
Results with standard Kalman filter

Results of Kalman filtering on car example.

See example here.

Results with Rapid Ongoing Stochasic covariance Estimation (ROSE) filter

Results of ROSE filtering.

See example here.

Credits

This software package has been developed for and is in production at Kalkfabrik Netstal.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter interface {
	Apply(z, ctrl mat.Vector) mat.Vector
	State() mat.Vector
}

Filter interface for using the Kalman filter

func NewFilter

func NewFilter(X *mat.VecDense, P, F, B, Q, H, R *mat.Dense) Filter

NewFilter returns a Kalman filter X: initial state P: initial covariance matrix F: prediction matrix B: control matrix Q: system noise covariance matrix H: scaling matrix for measurements R: measurement error matrix

func NewRoseFilter

func NewRoseFilter(X *mat.VecDense, P, F, B, H, G *mat.Dense, gammaR, alphaR, alphaM float64) Filter

NewRoseFilter returns a ROSE Kalman filter Rapid Ongoing Stochasic covariance Estimation (ROSE) Filter X: initial state P: initial covariance matrix F: prediction matrix B: control matrix H: scaling matrix for measurements G: discretized G matrix for system noise gammaR: Gain factor for measurement noise alphaR: Kalman gain for measurment covariance noise alphaM: Kalman gain for covariance M

Directories

Path Synopsis
example
car command
rose command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL