API
Applications
Utilities
API
Handbook
GitHub
Home
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>
7
using namespace
mx::improc;
8
#include "
utils.hpp
"
9
10
namespace
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
19
class
RecursiveLeastSquares
{
20
21
private
:
22
23
public
:
24
realT
_gamma
;
25
realT
_inverse_gamma
;
26
realT
_initial_covariance
;
27
int
_num_features
;
28
int
_num_predictors
;
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
38
Matrix
prediction_output
;
39
40
RecursiveLeastSquares
(
int
num_predictors,
int
num_features,
realT
forgetting_factor,
realT
inverse_covariance
);
41
~RecursiveLeastSquares
();
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
DDSPC::RecursiveLeastSquares
Definition
recursive_least_squares.hpp:19
DDSPC::RecursiveLeastSquares::_initial_covariance
realT _initial_covariance
Definition
recursive_least_squares.hpp:26
DDSPC::RecursiveLeastSquares::inverse_covariance
Matrix inverse_covariance
Definition
recursive_least_squares.hpp:36
DDSPC::RecursiveLeastSquares::prediction_output
Matrix prediction_output
Definition
recursive_least_squares.hpp:38
DDSPC::RecursiveLeastSquares::_num_predictors
int _num_predictors
Definition
recursive_least_squares.hpp:28
DDSPC::RecursiveLeastSquares::update
void update(eigenImage< realT > *x, eigenImage< realT > *y)
Definition
recursive_least_squares.cpp:52
DDSPC::RecursiveLeastSquares::prediction_matrix
Matrix prediction_matrix
Definition
recursive_least_squares.hpp:35
DDSPC::RecursiveLeastSquares::~RecursiveLeastSquares
~RecursiveLeastSquares()
Definition
recursive_least_squares.cpp:36
DDSPC::RecursiveLeastSquares::_num_features
int _num_features
Definition
recursive_least_squares.hpp:27
DDSPC::RecursiveLeastSquares::_inverse_gamma
realT _inverse_gamma
Definition
recursive_least_squares.hpp:25
DDSPC::RecursiveLeastSquares::err
Matrix err
Definition
recursive_least_squares.hpp:31
DDSPC::RecursiveLeastSquares::save_state
void save_state(std::string filaname)
Definition
recursive_least_squares.cpp:87
DDSPC::RecursiveLeastSquares::xtP
Matrix xtP
Definition
recursive_least_squares.hpp:32
DDSPC::RecursiveLeastSquares::_gamma
realT _gamma
Definition
recursive_least_squares.hpp:24
DDSPC::RecursiveLeastSquares::reset
void reset()
Definition
recursive_least_squares.cpp:40
DDSPC::RecursiveLeastSquares::K
Matrix K
Definition
recursive_least_squares.hpp:30
DDSPC
Definition
ar_controller.cpp:4
DDSPC::Matrix
Eigen::Matrix< realT, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition
utils.hpp:12
DDSPC::realT
float realT
Definition
utils.hpp:11
utils.hpp
apps
loPredCtrl
recursive_least_squares.hpp
Generated by
1.9.8