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>
49 static constexpr unsigned int Dimension = VEstimatorDimension;
53 using VectorType = vnl_vector_fixed<T, VEstimatorDimension>;
57 using MatrixType = vnl_matrix_fixed<T, VEstimatorDimension, VEstimatorDimension>;
151template <
typename T,
unsigned int VEstimatorDimension>
156 ValueType measurePrediction = dot_product(newPredictor, m_Estimator);
158 ValueType errorMeasurePrediction = newMeasure - measurePrediction;
160 VectorType Corrector = m_Variance * newPredictor;
162 for (
unsigned int j = 0; j < VEstimatorDimension; ++j)
164 m_Estimator(j) += Corrector(j) * errorMeasurePrediction;
167 UpdateVariance(newPredictor);
170template <
typename T,
unsigned int VEstimatorDimension>
176 ValueType denominator = 1.0 / (1.0 + dot_product(aux, newPredictor));
178 for (
unsigned int col = 0; col < VEstimatorDimension; ++col)
180 for (
unsigned int row = 0; row < VEstimatorDimension; ++row)
182 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....