Package org.hipparchus.filtering.kalman
Class AbstractKalmanFilter<T extends Measurement>
java.lang.Object
org.hipparchus.filtering.kalman.AbstractKalmanFilter<T>
- Type Parameters:
T
- the type of the measurements
- All Implemented Interfaces:
KalmanFilter<T>
- Direct Known Subclasses:
ExtendedKalmanFilter
,LinearKalmanFilter
public abstract class AbstractKalmanFilter<T extends Measurement>
extends Object
implements KalmanFilter<T>
Shared parts between linear and non-linear Kalman filters.
- Since:
- 1.3
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractKalmanFilter
(MatrixDecomposer decomposer, ProcessEstimate initialState) Simple constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected RealMatrix
Compute innovation covariance matrix.protected void
correct
(T measurement, RealMatrix stm, RealVector innovation, RealMatrix h, RealMatrix s) Perform correction step.Get the corrected state.Get the predicted state.protected void
predict
(double time, RealVector predictedState, RealMatrix stm, RealMatrix noise) Perform prediction step.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hipparchus.filtering.kalman.KalmanFilter
estimationStep
-
Constructor Details
-
AbstractKalmanFilter
Simple constructor.- Parameters:
decomposer
- decomposer to use for the correction phaseinitialState
- initial state
-
-
Method Details
-
predict
Perform prediction step.- Parameters:
time
- process timepredictedState
- predicted state vectorstm
- state transition matrixnoise
- process noise covariance matrix
-
computeInnovationCovarianceMatrix
Compute innovation covariance matrix.- Parameters:
r
- measurement covarianceh
- Jacobian of the measurement with respect to the state (may be null if measurement should be ignored)- Returns:
- innovation covariance matrix, defined as \(h.P.h^T + r\), or null if h is null
-
correct
protected void correct(T measurement, RealMatrix stm, RealVector innovation, RealMatrix h, RealMatrix s) throws MathIllegalArgumentException Perform correction step.- Parameters:
measurement
- single measurement to handlestm
- state transition matrixinnovation
- innovation vector (i.e. residuals) (may be null if measurement should be ignored)h
- Jacobian of the measurement with respect to the state (may be null if measurement should be ignored)s
- innovation covariance matrix (may be null if measurement should be ignored)- Throws:
MathIllegalArgumentException
- if matrix cannot be decomposed
-
getPredicted
Get the predicted state.- Specified by:
getPredicted
in interfaceKalmanFilter<T extends Measurement>
- Returns:
- predicted state
-
getCorrected
Get the corrected state.- Specified by:
getCorrected
in interfaceKalmanFilter<T extends Measurement>
- Returns:
- corrected state
-