18 #ifndef itkKalmanLinearEstimator_h
19 #define itkKalmanLinearEstimator_h
23 #include "vnl/vnl_vector_fixed.h"
24 #include "vnl/vnl_matrix_fixed.h"
42 template <
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>;
151 template <
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);
170 template <
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;