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
Constructors Modifier Constructor Description protected
AbstractKalmanFilter(MatrixDecomposer decomposer, ProcessEstimate initialState)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RealMatrix
computeInnovationCovarianceMatrix(RealMatrix r, RealMatrix h)
Compute innovation covariance matrix.protected void
correct(T measurement, RealMatrix stm, RealVector innovation, RealMatrix h, RealMatrix s)
Perform correction step.ProcessEstimate
getCorrected()
Get the corrected state.ProcessEstimate
getPredicted()
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 Detail
-
AbstractKalmanFilter
protected AbstractKalmanFilter(MatrixDecomposer decomposer, ProcessEstimate initialState)
Simple constructor.- Parameters:
decomposer
- decomposer to use for the correction phaseinitialState
- initial state
-
-
Method Detail
-
predict
protected void predict(double time, RealVector predictedState, RealMatrix stm, RealMatrix noise)
Perform prediction step.- Parameters:
time
- process timepredictedState
- predicted state vectorstm
- state transition matrixnoise
- process noise covariance matrix
-
computeInnovationCovarianceMatrix
protected RealMatrix computeInnovationCovarianceMatrix(RealMatrix r, RealMatrix h)
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
public ProcessEstimate getPredicted()
Get the predicted state.- Specified by:
getPredicted
in interfaceKalmanFilter<T extends Measurement>
- Returns:
- predicted state
-
getCorrected
public ProcessEstimate getCorrected()
Get the corrected state.- Specified by:
getCorrected
in interfaceKalmanFilter<T extends Measurement>
- Returns:
- corrected state
-
-