LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::linearRegression< T > Class Template Reference
[Linear Algebra]

The linear regression algorithm estimates a linear relation between two vector spaces. More...

#include <ltiLinearRegression.h>

Inheritance diagram for lti::linearRegression< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::linearRegression< T >:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class linearRegression More...

Public Member Functions

 linearRegression ()
 linearRegression (const parameters &par)
 linearRegression (const linearRegression &other)
virtual ~linearRegression ()
virtual const char * getTypeName () const
matrix< T > apply (matrix< T > &srcMatrix, matrix< T > &destMatrix)
void transform (vector< T > &srcVector, vector< T > &destVector) const
vector< T > transform (vector< T > &srcVector) const
matrix< T > getLinRegMatrix () const
void setLinRegMatrix (matrix< T > &linRegMatrixSet)
linearRegressioncopy (const linearRegression &other)
linearRegressionoperator= (const linearRegression &other)
virtual functorclone () const
const parametersgetParameters () const
virtual bool read (ioHandler &handler, const bool complete=true)
virtual bool write (ioHandler &handler, const bool complete=true) const

Detailed Description

template<class T>
class lti::linearRegression< T >

The linear regression algorithm estimates a linear relation between two vector spaces.

To each vector srcVect of the source vector space with dimension srcDim, the corresponding vector destDim of the destination vector space with dimension destDim can be calculated using the resulting regression matrix R:

destVect = R * srcVect.

R is calculated from a training set of corresponding vectors in both spaces. Note that srcVect = 0 can only result in destVect = 0, so it is important to eliminate any offsets from both vector spaces before using this algorithm:

destVect = destVectMean + R * (srcVect - srcVectMean)

For example application see ltiLinearRegressionTracking.


Constructor & Destructor Documentation

template<class T>
lti::linearRegression< T >::linearRegression (  ) 

default constructor

template<class T>
lti::linearRegression< T >::linearRegression ( const parameters par  ) 

default constructor with parameters

template<class T>
lti::linearRegression< T >::linearRegression ( const linearRegression< T > &  other  ) 

copy constructor

Parameters:
other the object to be copied
template<class T>
virtual lti::linearRegression< T >::~linearRegression (  )  [virtual]

destructor


Member Function Documentation

template<class T>
matrix<T> lti::linearRegression< T >::apply ( matrix< T > &  srcMatrix,
matrix< T > &  destMatrix 
)

The linear regression algorithm.

It calculates a linear transformation matrix linRegMatrix, that approximately fulfills destMatrix = linRegMatrix * srcMatrix.

Parameters:
srcMatrix the columns of this matrix are the source training vectors of dimension srcDim
destMatrix the columns of this matrix are the destination training vectors of dimension destDim
Returns:
resulting (destDim x srcDim) transformation matrix. This is also kept in the parameter linRegMatrix and can be used directly with "transform"
template<class T>
virtual functor* lti::linearRegression< T >::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::functor.

Reimplemented in lti::linearRegressionTracking.

template<class T>
linearRegression& lti::linearRegression< T >::copy ( const linearRegression< T > &  other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

template<class T>
matrix<T> lti::linearRegression< T >::getLinRegMatrix (  )  const

gets the linear regression matrix

template<class T>
const parameters& lti::linearRegression< T >::getParameters (  )  const

returns used parameters

Reimplemented from lti::functor.

Reimplemented in lti::linearRegressionTracking.

template<class T>
virtual const char* lti::linearRegression< T >::getTypeName (  )  const [virtual]

returns the name of this type ("linearRegression")

Reimplemented from lti::linearAlgebraFunctor.

Reimplemented in lti::linearRegressionTracking.

template<class T>
linearRegression& lti::linearRegression< T >::operator= ( const linearRegression< T > &  other  ) 

Alias for copy.

Reimplemented from lti::functor.

template<class T>
virtual bool lti::linearRegression< T >::read ( ioHandler handler,
const bool  complete = true 
) [virtual]

Reads this functor from the given handler.

Reimplemented from lti::functor.

Reimplemented in lti::linearRegressionTracking.

template<class T>
void lti::linearRegression< T >::setLinRegMatrix ( matrix< T > &  linRegMatrixSet  ) 

sets the linear regression matrix

template<class T>
vector<T> lti::linearRegression< T >::transform ( vector< T > &  srcVector  )  const

multiplication of srcVector with the linear regression matrix of dimension (destDim x srcDim)

Parameters:
srcVector source vector of dimension srcDim
Returns:
destination vector of dimension destDim
template<class T>
void lti::linearRegression< T >::transform ( vector< T > &  srcVector,
vector< T > &  destVector 
) const

multiplication of srcVector with the linear regression matrix of dimension (destDim x srcDim)

Parameters:
srcVector source vector of dimension srcDim
destVector destination vector of dimension destDim
template<class T>
virtual bool lti::linearRegression< T >::write ( ioHandler handler,
const bool  complete = true 
) const [virtual]

Writes this functor to the given handler.

Reimplemented from lti::functor.

Reimplemented in lti::linearRegressionTracking.


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

Generated on Sat Apr 10 15:28:28 2010 for LTI-Lib by Doxygen 1.6.1