Documentation ¶
Index ¶
- type BrownianModel
- func (m *BrownianModel) CovarianceTransition(dt time.Duration) mat.Matrix
- func (m *BrownianModel) InitialState() State
- func (s *BrownianModel) NewMeasurement(value mat.Vector) *Measurement
- func (m *BrownianModel) Transition(dt time.Duration) mat.Matrix
- func (s *BrownianModel) Value(state mat.Vector) mat.Vector
- type BrownianModelConfig
- type ConstantVelocityModel
- func (m *ConstantVelocityModel) CovarianceTransition(dt time.Duration) mat.Matrix
- func (m *ConstantVelocityModel) InitialState() State
- func (m *ConstantVelocityModel) NewPositionMeasurement(position mat.Vector, variance float64) *Measurement
- func (m *ConstantVelocityModel) Position(state mat.Vector) mat.Vector
- func (m *ConstantVelocityModel) Transition(dt time.Duration) mat.Matrix
- func (m *ConstantVelocityModel) Velocity(state mat.Vector) mat.Vector
- type ConstantVelocityModelConfig
- type LinearModel
- type Measurement
- type SimpleModel
- type SimpleModelConfig
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrownianModel ¶
type BrownianModel struct {
// contains filtered or unexported fields
}
func NewBrownianModel ¶
func NewBrownianModel(initialTime time.Time, initialState mat.Vector, cfg BrownianModelConfig) *BrownianModel
func (*BrownianModel) CovarianceTransition ¶
func (m *BrownianModel) CovarianceTransition(dt time.Duration) mat.Matrix
func (*BrownianModel) InitialState ¶
func (m *BrownianModel) InitialState() State
func (*BrownianModel) NewMeasurement ¶
func (s *BrownianModel) NewMeasurement(value mat.Vector) *Measurement
func (*BrownianModel) Transition ¶
func (m *BrownianModel) Transition(dt time.Duration) mat.Matrix
type BrownianModelConfig ¶
type ConstantVelocityModel ¶
type ConstantVelocityModel struct {
// contains filtered or unexported fields
}
ConstantVelocityModel models a particle moving over time with state modelled by position and velocity.
func NewConstantVelocityModel ¶
func NewConstantVelocityModel(initialTime time.Time, initialPosition mat.Vector, cfg ConstantVelocityModelConfig) *ConstantVelocityModel
NewConstantVelocityModel initialises a constant velocity model.
func (*ConstantVelocityModel) CovarianceTransition ¶
func (m *ConstantVelocityModel) CovarianceTransition(dt time.Duration) mat.Matrix
CovarianceTransition returns the covariance of the process noise for the given time step. Note: This covariance is very simple, there are better ways to model the process noise for constant velocity models.
func (*ConstantVelocityModel) InitialState ¶
func (m *ConstantVelocityModel) InitialState() State
InitialState initializes the model.
func (*ConstantVelocityModel) NewPositionMeasurement ¶
func (m *ConstantVelocityModel) NewPositionMeasurement(position mat.Vector, variance float64) *Measurement
NewPositionMeasurement provides a new measurement for fusing into the model state. It is assumed the covariance of the measurement is a scaled identity matrix.
func (*ConstantVelocityModel) Position ¶
func (m *ConstantVelocityModel) Position(state mat.Vector) mat.Vector
Position is a helper to read the position value frmo a state vector for this model.
func (*ConstantVelocityModel) Transition ¶
func (m *ConstantVelocityModel) Transition(dt time.Duration) mat.Matrix
Transition returns the linear transformation that advances the model for the given time step.
type ConstantVelocityModelConfig ¶
ConstantVelocityModelConfig is used to set the variance of the process and the variance of the first measurement. It is assumed that the covariance of the state is a scaled identity matrix, so that the variance of each component of the position and velocity are identical. Observation variances in this model are provided on a per-measurement basis.
type LinearModel ¶
type LinearModel interface { InitialState() State Transition(dt time.Duration) mat.Matrix CovarianceTransition(dt time.Duration) mat.Matrix }
LinearModel is used to initialize hidden states in the model and provide transition matrices to the filter. kalman/models provides commonly used models.
type Measurement ¶
type SimpleModel ¶
type SimpleModel struct {
// contains filtered or unexported fields
}
SimpleModel provides the most basic Kalman Filter example of modelling a Brownian time series in a single dimension. This is just a wrapper around the BrownianModel, with a simplified interface that operates directly on floating point values rather than on vectors.
func NewSimpleModel ¶
func NewSimpleModel(initialTime time.Time, initialValue float64, cfg SimpleModelConfig) *SimpleModel
func (*SimpleModel) CovarianceTransition ¶
func (s *SimpleModel) CovarianceTransition(dt time.Duration) mat.Matrix
func (*SimpleModel) InitialState ¶
func (s *SimpleModel) InitialState() State
func (*SimpleModel) NewMeasurement ¶
func (s *SimpleModel) NewMeasurement(value float64) *Measurement
func (*SimpleModel) Transition ¶
func (s *SimpleModel) Transition(dt time.Duration) mat.Matrix