API
 
Loading...
Searching...
No Matches
recursive_least_squares.hpp
Go to the documentation of this file.
1#ifndef PCRLS_HPP
2#define PCRLS_HPP
3
4#include <Eigen/Dense>
5#include <mx/improc/eigenCube.hpp>
6#include <mx/improc/eigenImage.hpp>
7using namespace mx::improc;
8#include "utils.hpp"
9
10namespace DDSPC
11{
12
13/*
14 This is just a generic Recursive Least Squares implementation.
15 The auto-regressive model will be implemented in a different class.
16 This allows for better reuse of the Recursive Least Squares.
17*/
18
20
21 private:
22
23 public:
29
30 Matrix K; // The gain matrix
31 Matrix err; // The a-priori prediction error
32 Matrix xtP; // A convenience variable
33
34
35 Matrix prediction_matrix; // Prediction matrix
36 Matrix inverse_covariance; // Inverse covariance
37
39
40 RecursiveLeastSquares(int num_predictors, int num_features, realT forgetting_factor, realT inverse_covariance);
42
43 // This interface might need to change
44 void update(eigenImage<realT> *x, eigenImage<realT> *y);
45 void update(Matrix *x, Matrix *y);
46
47 //Matrix* predict(eigenImage<realT> *x);
48 void reset();
49 void save_state(std::string filaname);
50};
51
52}
53
54#endif
void update(eigenImage< realT > *x, eigenImage< realT > *y)
void save_state(std::string filaname)
Eigen::Matrix< realT, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition utils.hpp:12
float realT
Definition utils.hpp:11