kalman

package
v0.0.0-...-768eb72 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2018 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	Loc *mat.Dense
	Cov *mat.Dense
}

State describes the distribution of the internal state of a Linear system which has multivariate normal distribution.

func NewState

func NewState(loc, cov *mat.Dense) (s *State, err error)

NewState returns a State if the provided matrices have compatible dimensions and otherwise returns an error.

func Observe

func Observe(s *State, m *System) (o *State, err error)

Observe determines the observation distribution for the current time step using the linear measurement equation: `y_next = C * x_next + v_next`. It returns an error if the state and system process dims do not match.

func Predict

func Predict(p *State, m *System) (n *State, err error)

Predict predicts the next state distribution given the previous state and linear system equation `x_next = A * x_prev + B * w_prev `.

func StateObserve

func StateObserve(s *State, m *System) (o *State, err error)

StateObserve returns the observation distribution

func Update

func Update(p *State, m *System, v float64) (n *State, res float64, err error)

Update implements the Kalman Filter update, and returns the a posteriori internal state distribution given the state prior and an observation. Also returns the post-fit residual.

func (*State) Dim

func (s *State) Dim() (d int)

Dim returns the integer dimension of the state.

type System

type System struct {
	// Process matrix
	A *mat.Dense
	// Process noise transform matrix
	B *mat.Dense
	// Measurement matrix
	C *mat.Dense
	// Process Covariance matrix
	Q *mat.Dense
	// Measurement Covariance matrix
	R *mat.Dense
}

System contains a set of transition and covariance matrices which fully describe a Linear Time Invariant (LTI) dynamical system.

func NewSystem

func NewSystem(a, b, c, q, r *mat.Dense) (m *System, err error)

NewSystem returns a System if the provided matrices have compatible dimensions and otherwise returns an error.

func (*System) Dims

func (m *System) Dims() (pDim, mDim int)

Dims returns the dimensions of the process and measurement equations of the given linear System.

Jump to

Keyboard shortcuts

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