SuperKalmanFilter Class Reference
[Mathematical algorithmsGPS solution algorithms and Tropospheric]

#include <SuperKalmanFilter.hpp>

Collaboration diagram for SuperKalmanFilter:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class computes the solution using an adaptive kalman filter with selection of the parameter weights.

A typical way to use this class follows:

    // Declarations and initializations here...

    SuperKalmanFilter kalman(xhat0, pmatrix);

    while(cin >> x >> y)
    {

       try
       {

          meas(0) = x;
          meas(1) = y;

          kalman.Compute(phimatrix, qmatrix, meas, hmatrix, rmatrix);

          cout << kalman.xhat(0) << " " << kalman.xhat(1) << endl;
       }
       catch (Exception e)
       {
          cout << e;
       }
    }

This class is modified from 'SimpleKalmanFilter', some new methods were added to do precise orbit determination. Comparing with the 'SimpleKalmanFilter' class, this class will have advanced features: 1) robust 2) adaptive with selection of the parameter weights.

Definition at line 86 of file SuperKalmanFilter.hpp.

Public Member Functions

 SuperKalmanFilter ()
 Default constructor.
 SuperKalmanFilter (const Vector< double > &initialState, const Matrix< double > &initialErrorCovariance)
 Common constructor.
 SuperKalmanFilter (const double &initialValue, const double &initialErrorVariance)
 Common constructor.
virtual ~SuperKalmanFilter ()
 Destructor.
virtual void Reset (const Vector< double > &initialState, const Matrix< double > &initialErrorCovariance)
 Reset method.
virtual void Reset (const double &initialValue, const double &initialErrorVariance)
 Reset method.
virtual int Compute (const Matrix< double > &phiMatrix, const Matrix< double > &controlMatrix, const Vector< double > &controlInput, const Matrix< double > &processNoiseCovariance, const Vector< double > &measurements, const Matrix< double > &measurementsMatrix, const Matrix< double > &measurementsNoiseCovariance) throw (InvalidSolver)
 Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error covariance matrix.
virtual int Compute (const Vector< double > &stateVector, const Matrix< double > &phiMatrix, const Matrix< double > &controlMatrix, const Vector< double > &controlInput, const Matrix< double > &processNoiseCovariance, const Vector< double > &measurements, const Matrix< double > &measurementsMatrix, const Matrix< double > &measurementsNoiseCovariance) throw (InvalidSolver)
 Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error covariance matrix.
virtual int Compute (const Matrix< double > &phiMatrix, const Matrix< double > &processNoiseCovariance, const Vector< double > &measurements, const Matrix< double > &measurementsMatrix, const Matrix< double > &measurementsNoiseCovariance) throw (InvalidSolver)
 Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error covariance matrix.
virtual int Compute (const Vector< double > &stateVector, const Matrix< double > &phiMatrix, const Matrix< double > &processNoiseCovariance, const Vector< double > &measurements, const Matrix< double > &measurementsMatrix, const Matrix< double > &measurementsNoiseCovariance) throw (InvalidSolver)
 Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error covariance matrix.
virtual int Compute (const double &phiValue, const double &controlGain, const double &controlInput, const double &processNoiseVariance, const double &measurement, const double &measurementsGain, const double &measurementsNoiseVariance) throw (InvalidSolver)
 Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error variance.
virtual int Compute (const double &stateValue, const double &phiValue, const double &controlGain, const double &controlInput, const double &processNoiseVariance, const double &measurement, const double &measurementsGain, const double &measurementsNoiseVariance) throw (InvalidSolver)
 Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error variance.
virtual int Compute (const double &phiValue, const double &processNoiseVariance, const double &measurement, const double &measurementsGain, const double &measurementsNoiseVariance) throw (InvalidSolver)
 Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error variance.
virtual int Compute (const double &stateValue, const double &phiValue, const double &processNoiseVariance, const double &measurement, const double &measurementsGain, const double &measurementsNoiseVariance) throw (InvalidSolver)
 Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error variance.

Public Attributes

Vector< double > xhat
 A posteriori state estimation. This is usually your target.
Matrix< double > P
 A posteriori error covariance.
Vector< double > xhatminus
 A priori state estimation.
Matrix< double > Pminus
 A priori error covariance.
Matrix< double > weightFactor
 A weight factor, it's a identity matrix by default.

Protected Member Functions

virtual int Predict (const Matrix< double > &phiMatrix, const Vector< double > &previousState, const Matrix< double > &previousErrorCovariance, const Matrix< double > &controlMatrix, const Vector< double > &controlInput, const Matrix< double > &processNoiseCovariance) throw (InvalidSolver)
 Predicts (or "time updates") the a priori estimate of the system state, as well as the a priori estimate error covariance matrix.
virtual int Correct (const Vector< double > &measurements, const Matrix< double > &measurementsMatrix, const Matrix< double > &measurementsNoiseCovariance) throw (InvalidSolver)
 Corrects (or "measurement updates") the a posteriori estimate of the system state vector, as well as the a posteriori estimate error covariance matrix, using as input the predicted a priori state vector and error covariance matrix, plus measurements and associated matrices.


Constructor & Destructor Documentation

SuperKalmanFilter  ) 
 

Default constructor.

Definition at line 40 of file SuperKalmanFilter.cpp.

References gpstk::ident().

SuperKalmanFilter const Vector< double > &  initialState,
const Matrix< double > &  initialErrorCovariance
 

Common constructor.

Parameters:
initialState Vector setting the initial state of the system.
initialErrorCovariance Matrix setting the initial values of the a posteriori error covariance.

Definition at line 54 of file SuperKalmanFilter.cpp.

References gpstk::ident().

SuperKalmanFilter const double &  initialValue,
const double &  initialErrorVariance
 

Common constructor.

This is meant to be used with one-dimensional systems.

Parameters:
initialValue Initial value of system state.
initialErrorVariance Initial value of the a posteriori error variance.

Definition at line 72 of file SuperKalmanFilter.cpp.

References gpstk::ident().

virtual ~SuperKalmanFilter  )  [inline, virtual]
 

Destructor.

Definition at line 118 of file SuperKalmanFilter.hpp.


Member Function Documentation

int Compute const double &  stateValue,
const double &  phiValue,
const double &  processNoiseVariance,
const double &  measurement,
const double &  measurementsGain,
const double &  measurementsNoiseVariance
throw (InvalidSolver) [virtual]
 

Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error variance.

Version for one-dimensional systems without control input on the system.

Parameters:
phiValue State transition gain.
processNoiseVariance Process noise variance.
measurement Measurement value.
measurementsGain Measurements gain.
measurementsNoiseVariance Measurements noise variance.
Returns:
0 if OK -1 if problems arose

Definition at line 780 of file SuperKalmanFilter.cpp.

References GPSTK_THROW, and Matrix::size().

int Compute const double &  phiValue,
const double &  processNoiseVariance,
const double &  measurement,
const double &  measurementsGain,
const double &  measurementsNoiseVariance
throw (InvalidSolver) [virtual]
 

Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error variance.

Version for one-dimensional systems without control input on the system.

Parameters:
phiValue State transition gain.
processNoiseVariance Process noise variance.
measurement Measurement value.
measurementsGain Measurements gain.
measurementsNoiseVariance Measurements noise variance.
Returns:
0 if OK -1 if problems arose

Definition at line 730 of file SuperKalmanFilter.cpp.

References GPSTK_THROW, and Matrix::size().

int Compute const double &  stateValue,
const double &  phiValue,
const double &  controlGain,
const double &  controlInput,
const double &  processNoiseVariance,
const double &  measurement,
const double &  measurementsGain,
const double &  measurementsNoiseVariance
throw (InvalidSolver) [virtual]
 

Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error variance.

Version for one-dimensional systems.

Parameters:
stateValue Predicted state value
phiValue State transition gain.
controlGain Control gain.
controlInput Control input value.
processNoiseVariance Process noise variance.
measurement Measurement value.
measurementsGain Measurements gain.
measurementsNoiseVariance Measurements noise variance.
Returns:
0 if OK -1 if problems arose

Definition at line 676 of file SuperKalmanFilter.cpp.

References GPSTK_THROW, and Matrix::size().

int Compute const double &  phiValue,
const double &  controlGain,
const double &  controlInput,
const double &  processNoiseVariance,
const double &  measurement,
const double &  measurementsGain,
const double &  measurementsNoiseVariance
throw (InvalidSolver) [virtual]
 

Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error variance.

Version for one-dimensional systems.

Parameters:
phiValue State transition gain.
controlGain Control gain.
controlInput Control input value.
processNoiseVariance Process noise variance.
measurement Measurement value.
measurementsGain Measurements gain.
measurementsNoiseVariance Measurements noise variance.
Returns:
0 if OK -1 if problems arose

Definition at line 622 of file SuperKalmanFilter.cpp.

References GPSTK_THROW, and Matrix::size().

int Compute const Vector< double > &  stateVector,
const Matrix< double > &  phiMatrix,
const Matrix< double > &  processNoiseCovariance,
const Vector< double > &  measurements,
const Matrix< double > &  measurementsMatrix,
const Matrix< double > &  measurementsNoiseCovariance
throw (InvalidSolver) [virtual]
 

Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error covariance matrix.

This version assumes that no control inputs act on the system.

Parameters:
stateVector Predicted state vector
phiMatrix State transition matrix.
processNoiseCovariance Process noise covariance matrix.
measurements Measurements vector.
measurementsMatrix Measurements matrix. Called geometry matrix in GNSS.
measurementsNoiseCovariance Measurements noise covariance matrix.
Returns:
0 if OK -1 if problems arose

Definition at line 561 of file SuperKalmanFilter.cpp.

References GPSTK_THROW.

int Compute const Matrix< double > &  phiMatrix,
const Matrix< double > &  processNoiseCovariance,
const Vector< double > &  measurements,
const Matrix< double > &  measurementsMatrix,
const Matrix< double > &  measurementsNoiseCovariance
throw (InvalidSolver) [virtual]
 

Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error covariance matrix.

This version assumes that no control inputs act on the system.

Parameters:
phiMatrix State transition matrix.
processNoiseCovariance Process noise covariance matrix.
measurements Measurements vector.
measurementsMatrix Measurements matrix. Called geometry matrix in GNSS.
measurementsNoiseCovariance Measurements noise covariance matrix.
Returns:
0 if OK -1 if problems arose

Definition at line 509 of file SuperKalmanFilter.cpp.

References GPSTK_THROW.

int Compute const Vector< double > &  stateVector,
const Matrix< double > &  phiMatrix,
const Matrix< double > &  controlMatrix,
const Vector< double > &  controlInput,
const Matrix< double > &  processNoiseCovariance,
const Vector< double > &  measurements,
const Matrix< double > &  measurementsMatrix,
const Matrix< double > &  measurementsNoiseCovariance
throw (InvalidSolver) [virtual]
 

Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error covariance matrix.

Parameters:
stateVector Predicted state vector
phiMatrix State transition matrix.
controlMatrix Control matrix.
controlInput Control input vector.
processNoiseCovariance Process noise covariance matrix.
measurements Measurements vector.
measurementsMatrix Measurements matrix. Called geometry matrix in GNSS.
measurementsNoiseCovariance Measurements noise covariance matrix.
Returns:
0 if OK -1 if problems arose

Definition at line 449 of file SuperKalmanFilter.cpp.

References GPSTK_THROW.

int Compute const Matrix< double > &  phiMatrix,
const Matrix< double > &  controlMatrix,
const Vector< double > &  controlInput,
const Matrix< double > &  processNoiseCovariance,
const Vector< double > &  measurements,
const Matrix< double > &  measurementsMatrix,
const Matrix< double > &  measurementsNoiseCovariance
throw (InvalidSolver) [virtual]
 

Compute the a posteriori estimate of the system state, as well as the a posteriori estimate error covariance matrix.

Parameters:
phiMatrix State transition matrix.
controlMatrix Control matrix.
controlInput Control input vector.
processNoiseCovariance Process noise covariance matrix.
measurements Measurements vector.
measurementsMatrix Measurements matrix. Called geometry matrix in GNSS.
measurementsNoiseCovariance Measurements noise covariance matrix.
Returns:
0 if OK -1 if problems arose

Definition at line 397 of file SuperKalmanFilter.cpp.

References GPSTK_THROW.

int Correct const Vector< double > &  measurements,
const Matrix< double > &  measurementsMatrix,
const Matrix< double > &  measurementsNoiseCovariance
throw (InvalidSolver) [protected, virtual]
 

Corrects (or "measurement updates") the a posteriori estimate of the system state vector, as well as the a posteriori estimate error covariance matrix, using as input the predicted a priori state vector and error covariance matrix, plus measurements and associated matrices.

Parameters:
measurements Measurements vector.
measurementsMatrix Measurements matrix. Called geometry matrix in GNSS.
measurementsNoiseCovariance Measurements noise covariance matrix.
Returns:
0 if OK -1 if problems arose

Definition at line 252 of file SuperKalmanFilter.cpp.

References GPSTK_THROW, gpstk::inverseChol(), and gpstk::transpose().

int Predict const Matrix< double > &  phiMatrix,
const Vector< double > &  previousState,
const Matrix< double > &  previousErrorCovariance,
const Matrix< double > &  controlMatrix,
const Vector< double > &  controlInput,
const Matrix< double > &  processNoiseCovariance
throw (InvalidSolver) [protected, virtual]
 

Predicts (or "time updates") the a priori estimate of the system state, as well as the a priori estimate error covariance matrix.

Parameters:
phiMatrix State transition matrix.
previousState Previous system state vector. It is the last computed xhat.
previousErrorCovariance Error covariance matrix of the previous state
controlMatrix Control matrix.
controlInput Control input vector.
processNoiseCovariance Process noise covariance matrix.
Returns:
0 if OK -1 if problems arose

Definition at line 147 of file SuperKalmanFilter.cpp.

References GPSTK_THROW, and gpstk::transpose().

void Reset const double &  initialValue,
const double &  initialErrorVariance
[virtual]
 

Reset method.

This method will reset the filter, setting new values for initial system state and the a posteriori error variance. Used for one-dimensional systems.

Parameters:
initialValue Initial value of system state.
initialErrorVariance Initial value of the a posteriori error variance.

Definition at line 117 of file SuperKalmanFilter.cpp.

References SuperKalmanFilter::P, SuperKalmanFilter::Pminus, Matrix::resize(), Vector::resize(), Vector::size(), SuperKalmanFilter::weightFactor, SuperKalmanFilter::xhat, and SuperKalmanFilter::xhatminus.

void Reset const Vector< double > &  initialState,
const Matrix< double > &  initialErrorCovariance
[virtual]
 

Reset method.

This method will reset the filter, setting new values for initial system state vector and the a posteriori error covariance matrix.

Parameters:
initialState Vector setting the initial state of the system.
initialErrorCovariance Matrix setting the initial values of the a posteriori error covariance.

Definition at line 92 of file SuperKalmanFilter.cpp.

References Matrix::cols(), SuperKalmanFilter::P, SuperKalmanFilter::Pminus, Matrix::resize(), Vector::resize(), Matrix::rows(), Vector::size(), SuperKalmanFilter::weightFactor, SuperKalmanFilter::xhat, and SuperKalmanFilter::xhatminus.


Member Data Documentation

Matrix<double> P
 

A posteriori error covariance.

Definition at line 361 of file SuperKalmanFilter.hpp.

Referenced by SuperKalmanFilter::Reset().

Matrix<double> Pminus
 

A priori error covariance.

Definition at line 369 of file SuperKalmanFilter.hpp.

Referenced by SuperKalmanFilter::Reset().

Matrix<double> weightFactor
 

A weight factor, it's a identity matrix by default.

Definition at line 373 of file SuperKalmanFilter.hpp.

Referenced by SuperKalmanFilter::Reset().

Vector<double> xhat
 

A posteriori state estimation. This is usually your target.

Definition at line 357 of file SuperKalmanFilter.hpp.

Referenced by SuperKalmanFilter::Reset().

Vector<double> xhatminus
 

A priori state estimation.

Definition at line 365 of file SuperKalmanFilter.hpp.

Referenced by SuperKalmanFilter::Reset().


The documentation for this class was generated from the following files:
Generated on Thu Sep 9 03:31:31 2010 for GPS ToolKit Software Library by  doxygen 1.3.9.1