xk = Axk-1 + Buk-1 + wk-1with a measurement xk that is
zk = Hxk + vk.
The random variables wk and vk represent the process and measurement noise and are assumed to be independent of each other and distributed with normal probability (white noise).
The Kalman filter cycle involves the following steps:
The Kalman filter is initialized with a ProcessModel and a
MeasurementModel, which contain the corresponding transformation and
noise covariance matrices. The parameter names used in the respective models
correspond to the following names commonly used in the mathematical
literature:
ProcessModel, MeasurementModel
| Modifier and Type | Field and Description |
|---|---|
| private RealMatrix | controlMatrix
The control matrix, equivalent to B. |
| private RealMatrix | errorCovariance
The error covariance matrix, equivalent to P. |
| private RealMatrix | measurementMatrix
The measurement matrix, equivalent to H. |
| private RealMatrix | measurementMatrixT
The transposed measurement matrix. |
| private final MeasurementModel | measurementModel
The measurement model used by this filter instance. |
| private final ProcessModel | processModel
The process model used by this filter instance. |
| private RealVector | stateEstimation
The internal state estimation vector, equivalent to x hat. |
| private RealMatrix | transitionMatrix
The transition matrix, equivalent to A. |
| private RealMatrix | transitionMatrixT
The transposed transition matrix. |
| Access | Constructor and Description |
|---|---|
| public | KalmanFilter(final ProcessModel
the model defining the underlying process dynamics process, final MeasurementModel the model defining the given measurement characteristics measurement)Creates a new Kalman filter with the given process and measurement models. |
| Modifier and Type | Method and Description |
|---|---|
| public void | correct(final double[]
the measurement vector z)Correct the current state estimate with an actual measurement. |
| public void | correct(final RealVector
the measurement vector z)Correct the current state estimate with an actual measurement. |
| public double[][] | Returns: the error covariance matrixReturns the current error covariance matrix. |
| public RealMatrix | Returns: the error covariance matrixReturns a copy of the current error covariance matrix. |
| public int | Returns: the measurement vector dimensionReturns the dimension of the measurement vector. |
| public int | Returns: the state dimensionReturns the dimension of the state estimation vector. |
| public double[] | Returns: the state estimation vectorReturns the current state estimation vector. |
| public RealVector | Returns: the state estimation vectorReturns a copy of the current state estimation vector. |
| public void | |
| public void | predict(final double[]
the control vector u)Predict the internal state estimation one time step ahead. |
| public void | predict(final RealVector
the control vector u)Predict the internal state estimation one time step ahead. |
| controlMatrix | back to summary |
|---|---|
| private RealMatrix controlMatrix The control matrix, equivalent to B. | |
| errorCovariance | back to summary |
|---|---|
| private RealMatrix errorCovariance The error covariance matrix, equivalent to P. | |
| measurementMatrix | back to summary |
|---|---|
| private RealMatrix measurementMatrix The measurement matrix, equivalent to H. | |
| measurementMatrixT | back to summary |
|---|---|
| private RealMatrix measurementMatrixT The transposed measurement matrix. | |
| measurementModel | back to summary |
|---|---|
| private final MeasurementModel measurementModel The measurement model used by this filter instance. | |
| processModel | back to summary |
|---|---|
| private final ProcessModel processModel The process model used by this filter instance. | |
| stateEstimation | back to summary |
|---|---|
| private RealVector stateEstimation The internal state estimation vector, equivalent to x hat. | |
| transitionMatrix | back to summary |
|---|---|
| private RealMatrix transitionMatrix The transition matrix, equivalent to A. | |
| transitionMatrixT | back to summary |
|---|---|
| private RealMatrix transitionMatrixT The transposed transition matrix. | |
| KalmanFilter | back to summary |
|---|---|
| public KalmanFilter(final ProcessModel process, final MeasurementModel measurement) throws NullArgumentException, NonSquareMatrixException, DimensionMismatchException, MatrixDimensionMismatchException Creates a new Kalman filter with the given process and measurement models.
| |
| correct | back to summary |
|---|---|
| public void correct(final double[] z) throws NullArgumentException, DimensionMismatchException, SingularMatrixException Correct the current state estimate with an actual measurement.
| |
| correct | back to summary |
|---|---|
| public void correct(final RealVector z) throws NullArgumentException, DimensionMismatchException, SingularMatrixException Correct the current state estimate with an actual measurement.
| |
| getErrorCovariance | back to summary |
|---|---|
| public double[][] getErrorCovariance() Returns the current error covariance matrix.
| |
| getErrorCovarianceMatrix | back to summary |
|---|---|
| public RealMatrix getErrorCovarianceMatrix() Returns a copy of the current error covariance matrix.
| |
| getMeasurementDimension | back to summary |
|---|---|
| public int getMeasurementDimension() Returns the dimension of the measurement vector.
| |
| getStateDimension | back to summary |
|---|---|
| public int getStateDimension() Returns the dimension of the state estimation vector.
| |
| getStateEstimation | back to summary |
|---|---|
| public double[] getStateEstimation() Returns the current state estimation vector.
| |
| getStateEstimationVector | back to summary |
|---|---|
| public RealVector getStateEstimationVector() Returns a copy of the current state estimation vector.
| |
| predict | back to summary |
|---|---|
| public void predict() Predict the internal state estimation one time step ahead. | |
| predict | back to summary |
|---|---|
| public void predict(final double[] u) throws DimensionMismatchException Predict the internal state estimation one time step ahead.
| |
| predict | back to summary |
|---|---|
| public void predict(final RealVector u) throws DimensionMismatchException Predict the internal state estimation one time step ahead.
| |