iCub-main
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
iCub::ctrl::AWPolyEstimator Class Referenceabstract

Adaptive window polynomial fitting. More...

#include <adaptWinPolyEstimator.h>

+ Inheritance diagram for iCub::ctrl::AWPolyEstimator:

Public Member Functions

 AWPolyEstimator (unsigned int _order, unsigned int _N, const double _D)
 Create a polynomial estimator object of order _order on an adaptive window of a maximum length _N an threshold _D. More...
 
AWPolyListgetList ()
 Return a reference to internal elements list. More...
 
void feedData (const AWPolyElement &el)
 Feed data into the algorithm. More...
 
yarp::sig::Vector getWinLen ()
 Return the current windows lengths. More...
 
yarp::sig::Vector getMSE ()
 Return the mean squared error (MSE) computed over the current windows lengths between the predictions and the real data. More...
 
yarp::sig::Vector estimate ()
 Execute the algorithm upon the elements list, with the max deviation threshold given by D. More...
 
yarp::sig::Vector estimate (const AWPolyElement &el)
 Execute the algorithm upon the elements list, with the max deviation threshold given by D. More...
 
void reset ()
 Reinitialize the internal state. More...
 
virtual ~AWPolyEstimator ()
 Destructor. More...
 

Protected Member Functions

virtual yarp::sig::Vector fit (const yarp::sig::Vector &x, const yarp::sig::Vector &y, const unsigned int n=0)
 Find the regressor which best fits in least square sense the last n data sample couples, or all couples if n==0. More...
 
virtual double eval (double x)
 Evaluate regressor at certain point. More...
 
virtual double getEsteeme ()=0
 Return the current estimation. More...
 

Protected Attributes

AWPolyList elemList
 
unsigned int order
 
unsigned int N
 
double D
 
yarp::sig::Vector t
 
yarp::sig::Vector x
 
yarp::sig::Vector coeff
 
yarp::sig::Vector winLen
 
yarp::sig::Vector mse
 
bool firstRun
 

Detailed Description

Adaptive window polynomial fitting.

Abstract class.

Definition at line 73 of file adaptWinPolyEstimator.h.

Constructor & Destructor Documentation

◆ AWPolyEstimator()

AWPolyEstimator::AWPolyEstimator ( unsigned int  _order,
unsigned int  _N,
const double  _D 
)

Create a polynomial estimator object of order _order on an adaptive window of a maximum length _N an threshold _D.

Parameters
_orderis the order of polynomial fitting.
_Nis the maximum windows length.
_Dis the threshold.

Definition at line 27 of file adaptWinPolyEstimator.cpp.

◆ ~AWPolyEstimator()

virtual iCub::ctrl::AWPolyEstimator::~AWPolyEstimator ( )
inlinevirtual

Destructor.

Definition at line 174 of file adaptWinPolyEstimator.h.

Member Function Documentation

◆ estimate() [1/2]

Vector AWPolyEstimator::estimate ( )

Execute the algorithm upon the elements list, with the max deviation threshold given by D.

Returns
the current estimation.

Definition at line 100 of file adaptWinPolyEstimator.cpp.

◆ estimate() [2/2]

Vector AWPolyEstimator::estimate ( const AWPolyElement el)

Execute the algorithm upon the elements list, with the max deviation threshold given by D.

Parameters
elis the new data of type AWPolyElement.
Returns
the current estimation.

Definition at line 185 of file adaptWinPolyEstimator.cpp.

◆ eval()

double AWPolyEstimator::eval ( double  x)
protectedvirtual

Evaluate regressor at certain point.

Parameters
xthe point.
Returns
regressor evaluated in x.

Definition at line 41 of file adaptWinPolyEstimator.cpp.

◆ feedData()

void AWPolyEstimator::feedData ( const AWPolyElement el)

Feed data into the algorithm.

Parameters
elis the new data of type AWPolyElement.

Definition at line 93 of file adaptWinPolyEstimator.cpp.

◆ fit()

Vector AWPolyEstimator::fit ( const yarp::sig::Vector &  x,
const yarp::sig::Vector &  y,
const unsigned int  n = 0 
)
protectedvirtual

Find the regressor which best fits in least square sense the last n data sample couples, or all couples if n==0.

Parameters
xvector containing the input data.
yvector containing the output data.
nlast n data sample couples to fit.
Returns
the regressor's coefficients.

Reimplemented in iCub::ctrl::AWLinEstimator.

Definition at line 55 of file adaptWinPolyEstimator.cpp.

◆ getEsteeme()

virtual double iCub::ctrl::AWPolyEstimator::getEsteeme ( )
protectedpure virtual

Return the current estimation.

Note
needs to be defined.
Returns
esteeme.

Implemented in iCub::ctrl::AWQuadEstimator, and iCub::ctrl::AWLinEstimator.

◆ getList()

AWPolyList& iCub::ctrl::AWPolyEstimator::getList ( )
inline

Return a reference to internal elements list.

Returns
reference to internal elements list.

Definition at line 128 of file adaptWinPolyEstimator.h.

◆ getMSE()

yarp::sig::Vector iCub::ctrl::AWPolyEstimator::getMSE ( )
inline

Return the mean squared error (MSE) computed over the current windows lengths between the predictions and the real data.

Returns
the MSE.

Definition at line 147 of file adaptWinPolyEstimator.h.

◆ getWinLen()

yarp::sig::Vector iCub::ctrl::AWPolyEstimator::getWinLen ( )
inline

Return the current windows lengths.

Returns
the current windows lengths.

Definition at line 140 of file adaptWinPolyEstimator.h.

◆ reset()

void AWPolyEstimator::reset ( )

Reinitialize the internal state.

Note
Windows lengths are brought to the maximum value N and output remains zero as long as fed data size reaches N.

Definition at line 193 of file adaptWinPolyEstimator.cpp.

Member Data Documentation

◆ coeff

yarp::sig::Vector iCub::ctrl::AWPolyEstimator::coeff
protected

Definition at line 83 of file adaptWinPolyEstimator.h.

◆ D

double iCub::ctrl::AWPolyEstimator::D
protected

Definition at line 79 of file adaptWinPolyEstimator.h.

◆ elemList

AWPolyList iCub::ctrl::AWPolyEstimator::elemList
protected

Definition at line 76 of file adaptWinPolyEstimator.h.

◆ firstRun

bool iCub::ctrl::AWPolyEstimator::firstRun
protected

Definition at line 87 of file adaptWinPolyEstimator.h.

◆ mse

yarp::sig::Vector iCub::ctrl::AWPolyEstimator::mse
protected

Definition at line 85 of file adaptWinPolyEstimator.h.

◆ N

unsigned int iCub::ctrl::AWPolyEstimator::N
protected

Definition at line 78 of file adaptWinPolyEstimator.h.

◆ order

unsigned int iCub::ctrl::AWPolyEstimator::order
protected

Definition at line 77 of file adaptWinPolyEstimator.h.

◆ t

yarp::sig::Vector iCub::ctrl::AWPolyEstimator::t
protected

Definition at line 81 of file adaptWinPolyEstimator.h.

◆ winLen

yarp::sig::Vector iCub::ctrl::AWPolyEstimator::winLen
protected

Definition at line 84 of file adaptWinPolyEstimator.h.

◆ x

yarp::sig::Vector iCub::ctrl::AWPolyEstimator::x
protected

Definition at line 82 of file adaptWinPolyEstimator.h.


The documentation for this class was generated from the following files: