Package org.apache.commons.math3.filter
Class DefaultProcessModel
- java.lang.Object
-
- org.apache.commons.math3.filter.DefaultProcessModel
-
- All Implemented Interfaces:
ProcessModel
public class DefaultProcessModel extends java.lang.Object implements ProcessModel
Default implementation of aProcessModelfor the use with aKalmanFilter.- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description private RealMatrixcontrolMatrixThe control matrix, used to integrate a control input into the state estimation.private RealMatrixinitialErrorCovMatrixThe initial error covariance matrix of the observed process.private RealVectorinitialStateEstimateVectorThe initial state estimation of the observed process.private RealMatrixprocessNoiseCovMatrixThe process noise covariance matrix.private RealMatrixstateTransitionMatrixThe state transition matrix, used to advance the internal state estimation each time-step.
-
Constructor Summary
Constructors Constructor Description DefaultProcessModel(double[][] stateTransition, double[][] control, double[][] processNoise)Create a newProcessModel, taking double arrays as input parameters.DefaultProcessModel(double[][] stateTransition, double[][] control, double[][] processNoise, double[] initialStateEstimate, double[][] initialErrorCovariance)Create a newProcessModel, taking double arrays as input parameters.DefaultProcessModel(RealMatrix stateTransition, RealMatrix control, RealMatrix processNoise, RealVector initialStateEstimate, RealMatrix initialErrorCovariance)Create a newProcessModel, taking double arrays as input parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RealMatrixgetControlMatrix()Returns the control matrix.RealMatrixgetInitialErrorCovariance()Returns the initial error covariance matrix.RealVectorgetInitialStateEstimate()Returns the initial state estimation vector.RealMatrixgetProcessNoise()Returns the process noise matrix.RealMatrixgetStateTransitionMatrix()Returns the state transition matrix.
-
-
-
Field Detail
-
stateTransitionMatrix
private RealMatrix stateTransitionMatrix
The state transition matrix, used to advance the internal state estimation each time-step.
-
controlMatrix
private RealMatrix controlMatrix
The control matrix, used to integrate a control input into the state estimation.
-
processNoiseCovMatrix
private RealMatrix processNoiseCovMatrix
The process noise covariance matrix.
-
initialStateEstimateVector
private RealVector initialStateEstimateVector
The initial state estimation of the observed process.
-
initialErrorCovMatrix
private RealMatrix initialErrorCovMatrix
The initial error covariance matrix of the observed process.
-
-
Constructor Detail
-
DefaultProcessModel
public DefaultProcessModel(double[][] stateTransition, double[][] control, double[][] processNoise, double[] initialStateEstimate, double[][] initialErrorCovariance) throws NullArgumentException, NoDataException, DimensionMismatchExceptionCreate a newProcessModel, taking double arrays as input parameters.- Parameters:
stateTransition- the state transition matrixcontrol- the control matrixprocessNoise- the process noise matrixinitialStateEstimate- the initial state estimate vectorinitialErrorCovariance- the initial error covariance matrix- Throws:
NullArgumentException- if any of the input arrays isnullNoDataException- if any row / column dimension of the input matrices is zeroDimensionMismatchException- if any of the input matrices is non-rectangular
-
DefaultProcessModel
public DefaultProcessModel(double[][] stateTransition, double[][] control, double[][] processNoise) throws NullArgumentException, NoDataException, DimensionMismatchExceptionCreate a newProcessModel, taking double arrays as input parameters.The initial state estimate and error covariance are omitted and will be initialized by the
KalmanFilterto default values.- Parameters:
stateTransition- the state transition matrixcontrol- the control matrixprocessNoise- the process noise matrix- Throws:
NullArgumentException- if any of the input arrays isnullNoDataException- if any row / column dimension of the input matrices is zeroDimensionMismatchException- if any of the input matrices is non-rectangular
-
DefaultProcessModel
public DefaultProcessModel(RealMatrix stateTransition, RealMatrix control, RealMatrix processNoise, RealVector initialStateEstimate, RealMatrix initialErrorCovariance)
Create a newProcessModel, taking double arrays as input parameters.- Parameters:
stateTransition- the state transition matrixcontrol- the control matrixprocessNoise- the process noise matrixinitialStateEstimate- the initial state estimate vectorinitialErrorCovariance- the initial error covariance matrix
-
-
Method Detail
-
getStateTransitionMatrix
public RealMatrix getStateTransitionMatrix()
Returns the state transition matrix.- Specified by:
getStateTransitionMatrixin interfaceProcessModel- Returns:
- the state transition matrix
-
getControlMatrix
public RealMatrix getControlMatrix()
Returns the control matrix.- Specified by:
getControlMatrixin interfaceProcessModel- Returns:
- the control matrix
-
getProcessNoise
public RealMatrix getProcessNoise()
Returns the process noise matrix. This method is called by theKalmanFilterevery prediction step, so implementations of this interface may return a modified process noise depending on the current iteration step.- Specified by:
getProcessNoisein interfaceProcessModel- Returns:
- the process noise matrix
- See Also:
KalmanFilter.predict(),KalmanFilter.predict(double[]),KalmanFilter.predict(RealVector)
-
getInitialStateEstimate
public RealVector getInitialStateEstimate()
Returns the initial state estimation vector.Note: if the return value is zero, the Kalman filter will initialize the state estimation with a zero vector.
- Specified by:
getInitialStateEstimatein interfaceProcessModel- Returns:
- the initial state estimation vector
-
getInitialErrorCovariance
public RealMatrix getInitialErrorCovariance()
Returns the initial error covariance matrix.Note: if the return value is zero, the Kalman filter will initialize the error covariance with the process noise matrix.
- Specified by:
getInitialErrorCovariancein interfaceProcessModel- Returns:
- the initial error covariance matrix
-
-