18#ifndef itkKalmanLinearEstimator_h
19#define itkKalmanLinearEstimator_h
23#include "vnl/vnl_vector_fixed.h"
24#include "vnl/vnl_matrix_fixed.h"
42template <
typename T,
unsigned int VEstimatorDimension>
48 static constexpr unsigned int Dimension = VEstimatorDimension;
52 using VectorType = vnl_vector_fixed<T, VEstimatorDimension>;
56 using MatrixType = vnl_matrix_fixed<T, VEstimatorDimension, VEstimatorDimension>;
149template <
typename T,
unsigned int VEstimatorDimension>
156 const ValueType errorMeasurePrediction = newMeasure - measurePrediction;
160 for (
unsigned int j = 0; j < VEstimatorDimension; ++j)
162 m_Estimator(j) += Corrector(j) * errorMeasurePrediction;
168template <
typename T,
unsigned int VEstimatorDimension>
174 const ValueType denominator = 1.0 / (1.0 + dot_product(aux, newPredictor));
176 for (
unsigned int col = 0; col < VEstimatorDimension; ++col)
178 for (
unsigned int row = 0; row < VEstimatorDimension; ++row)
180 m_Variance(col, row) -= aux(col) * aux(row) * denominator;
Implement a linear recursive estimator.
void UpdateVariance(const VectorType &)
const MatrixType & GetVariance() const
vnl_vector_fixed< T, VEstimatorDimension > VectorType
vnl_matrix_fixed< T, VEstimatorDimension, VEstimatorDimension > MatrixType
const VectorType & GetEstimator() const
void SetVariance(const MatrixType &m)
void UpdateWithNewMeasure(const ValueType &newMeasure, const VectorType &newPredictor)
void SetVariance(const ValueType &var=1.0)
static constexpr unsigned int Dimension
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....