gov.sandia.cognition.statistics.bayesian
Class AbstractKalmanFilter

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.algorithm.AbstractBatchAndIncrementalLearner<Vector,MultivariateGaussian>
          extended by gov.sandia.cognition.statistics.bayesian.AbstractKalmanFilter
All Implemented Interfaces:
BatchAndIncrementalLearner<Vector,MultivariateGaussian>, BatchLearner<Collection<? extends Vector>,MultivariateGaussian>, IncrementalLearner<Vector,MultivariateGaussian>, BayesianEstimator<Vector,Vector,MultivariateGaussian>, RecursiveBayesianEstimator<Vector,Vector,MultivariateGaussian>, CloneableSerializable, Serializable, Cloneable
Direct Known Subclasses:
ExtendedKalmanFilter, KalmanFilter

public abstract class AbstractKalmanFilter
extends AbstractBatchAndIncrementalLearner<Vector,MultivariateGaussian>
implements RecursiveBayesianEstimator<Vector,Vector,MultivariateGaussian>

Contains fields useful to both Kalman filters and extended Kalman filters.

Since:
3.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Field Summary
protected  Vector currentInput
          Current input to the model.
protected  Matrix measurementCovariance
          Covariance associated with the measurements.
protected  Matrix modelCovariance
          Covariance associated with the system's model.
 
Constructor Summary
AbstractKalmanFilter(Vector currentInput, Matrix modelCovariance, Matrix measurementCovariance)
          Creates a new instance of AbstractKalmanFilter
 
Method Summary
 AbstractKalmanFilter clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 void computeMeasurementBelief(MultivariateGaussian belief, Vector innovation, Matrix C)
          Updates the measurement belief by computing the Kalman gain and incorporating the innovation into the estimate
 Matrix computePredictionCovariance(Matrix A, Matrix beliefCovariance)
          Computes the prediction covariance from the Jacobian and believe covariance
 Vector getCurrentInput()
          Getter for currentInput
 Matrix getMeasurementCovariance()
          Getter for measurementCovariance
 Matrix getModelCovariance()
          Getter for modelCovariance
abstract  void measure(MultivariateGaussian belief, Vector observation)
          Integrates a measurement into the system, refining the current belief of the state of the system
abstract  void predict(MultivariateGaussian belief)
          Creates a prediction of the system's next state given the current belief state
 void setCurrentInput(Vector currentInput)
          Setter for currentInput
 void setMeasurementCovariance(Matrix measurementCovariance)
          Setter for measurementCovariance
 void setModelCovariance(Matrix modelCovariance)
          Setter for modelCovariance
 void update(MultivariateGaussian belief, Vector observation)
          The update method updates an object of ResultType using the given new data of type DataType, using some form of "learning" algorithm.
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.AbstractBatchAndIncrementalLearner
learn, learn, update
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.BatchLearner
learn
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.IncrementalLearner
createInitialLearnedObject, update
 

Field Detail

currentInput

protected Vector currentInput
Current input to the model.


modelCovariance

protected Matrix modelCovariance
Covariance associated with the system's model.


measurementCovariance

protected Matrix measurementCovariance
Covariance associated with the measurements.

Constructor Detail

AbstractKalmanFilter

public AbstractKalmanFilter(Vector currentInput,
                            Matrix modelCovariance,
                            Matrix measurementCovariance)
Creates a new instance of AbstractKalmanFilter

Parameters:
currentInput - Current input to the model.
modelCovariance - Covariance associated with the system's model.
measurementCovariance - Covariance associated with the measurements.
Method Detail

clone

public AbstractKalmanFilter clone()
Description copied from class: AbstractCloneableSerializable
This makes public the clone method on the Object class and removes the exception that it throws. Its default behavior is to automatically create a clone of the exact type of object that the clone is called on and to copy all primitives but to keep all references, which means it is a shallow copy. Extensions of this class may want to override this method (but call super.clone() to implement a "smart copy". That is, to target the most common use case for creating a copy of the object. Because of the default behavior being a shallow copy, extending classes only need to handle fields that need to have a deeper copy (or those that need to be reset). Some of the methods in ObjectUtil may be helpful in implementing a custom clone method. Note: The contract of this method is that you must use super.clone() as the basis for your implementation.

Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractBatchAndIncrementalLearner<Vector,MultivariateGaussian>
Returns:
A clone of this object.

predict

public abstract void predict(MultivariateGaussian belief)
Creates a prediction of the system's next state given the current belief state

Parameters:
belief - Current belief state

computePredictionCovariance

public Matrix computePredictionCovariance(Matrix A,
                                          Matrix beliefCovariance)
Computes the prediction covariance from the Jacobian and believe covariance

Parameters:
A - System Jacobian, which is estimated in the case of the EKF.
beliefCovariance - Covariance of the current state belief.
Returns:
Covariance of the prediction.

measure

public abstract void measure(MultivariateGaussian belief,
                             Vector observation)
Integrates a measurement into the system, refining the current belief of the state of the system

Parameters:
belief - Current belief of the state of the system
observation - Measurement to integrate.

computeMeasurementBelief

public void computeMeasurementBelief(MultivariateGaussian belief,
                                     Vector innovation,
                                     Matrix C)
Updates the measurement belief by computing the Kalman gain and incorporating the innovation into the estimate

Parameters:
belief - Current belief of the state.
innovation - Innovation, which is the observation minus the predicted observation
C - Output-selector matrix, the partial derivative of the output with respect to the current estimated state.

update

public void update(MultivariateGaussian belief,
                   Vector observation)
Description copied from interface: IncrementalLearner
The update method updates an object of ResultType using the given new data of type DataType, using some form of "learning" algorithm.

Specified by:
update in interface IncrementalLearner<Vector,MultivariateGaussian>
Parameters:
belief - The object to update.
observation - The new data for the learning algorithm to use to update the object.

getModelCovariance

public Matrix getModelCovariance()
Getter for modelCovariance

Returns:
Covariance associated with the system's model.

setModelCovariance

public void setModelCovariance(Matrix modelCovariance)
Setter for modelCovariance

Parameters:
modelCovariance - Covariance associated with the system's model.

getCurrentInput

public Vector getCurrentInput()
Getter for currentInput

Returns:
Current input to the model.

setCurrentInput

public void setCurrentInput(Vector currentInput)
Setter for currentInput

Parameters:
currentInput - Current input to the model.

getMeasurementCovariance

public Matrix getMeasurementCovariance()
Getter for measurementCovariance

Returns:
Covariance associated with the measurements.

setMeasurementCovariance

public void setMeasurementCovariance(Matrix measurementCovariance)
Setter for measurementCovariance

Parameters:
measurementCovariance - Covariance associated with the measurements.