lti::meansFunctor< T > Class Template Reference
[Basic Statistics]
Functor which computes several kinds of means for vectors and matrices.
More...
#include <ltiMeansFunctor.h>
List of all members.
Classes |
class | parameters |
| the parameters for the class meansFunctor More...
|
Public Member Functions |
| meansFunctor () |
| meansFunctor (const meansFunctor &other) |
virtual | ~meansFunctor () |
virtual const char * | getTypeName () const |
T | apply (const vector< T > &src) const |
T | geometricMean (const vector< T > &src) const |
T | arithmeticMean (const vector< T > &src) const |
T & | apply (const vector< T > &src, T &dest) const |
T & | arithmeticMean (const vector< T > &src, T &dest) const |
T & | geometricMean (const vector< T > &src, T &dest) const |
vector< T > & | apply (const matrix< T > &src, vector< T > &dest) const |
void | meanOfRows (const matrix< T > &src, vector< T > &dest) const |
void | geometricMeanOfRows (const matrix< T > &src, vector< T > &dest) const |
void | arithmeticMeanOfRows (const matrix< T > &src, vector< T > &dest) const |
void | meanOfColumns (const matrix< T > &src, vector< T > &dest) const |
void | arithmeticMeanOfColumns (const matrix< T > &src, vector< T > &dest) const |
void | geometricMeanOfColumns (const matrix< T > &src, vector< T > &dest) const |
meansFunctor & | copy (const meansFunctor &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
Detailed Description
template<class T>
class lti::meansFunctor< T >
Functor which computes several kinds of means for vectors and matrices.
Be careful with the terms used here. If you have following matrix
| 5 6 10 3 |
| 1 -2 4 5 |
| 3 2 1 -2 |
The meanOfRows means the mean of all rows, i.e. a row vector containing (for the arithmetical mean) the sum of all row vectors divided by the number of rows. This is (3 2 5 2).
The meanOfColumns means the mean of all columns, i.e. a column vector containing (for the arithmetical mean) the sum of all column vectors divided by the number of columns. This is (6 2 1)^T.
The parameter parameters::rowWise indicates that the matrix will be seen as a set of row vectors (if true), or column vectors (false).
Constructor & Destructor Documentation
copy constructor
- Parameters:
-
Member Function Documentation
The result of this function depends on the value of parameters::rowWise.
If this parameter is true, the functor will compute a vector, whose elements contain each the mean of one column of the matrix (the computes the mean of the rows, where each row is a data point in n-dimensional space. if rowWise is false, the result vector contains the mean of the columns of the matrix (each column a data point). The type of the mean (arithmetic or geometric) is determined by the value of parameters::geometric. For the geometric mean we take the square root of the absolute value of the product of all elements.
- Parameters:
-
| src | matrix<T> with the source data. |
| dest | matrix<T> where the result will be left. |
- Returns:
- a reference to the
dest
.
computes the mean of the given vector.
The type of the mean (arithmetic or geometric) is determined by the parameter parameters::geometric. For geometric mean we take the square root of the absolute value of the product of all elements.
- Parameters:
-
| src | vector<T> with the source data. |
| dest | T where the result will be left. |
- Returns:
- a reference to the
dest
.
returns the mean of the given vector.
The type of the mean (arithmetic or geometric) is determined by the parameter parameters::geometric
- Parameters:
-
| src | vector<T> with the source data. |
- Returns:
- the result.
computes the arithmetic mean of the given vector.
- Parameters:
-
| src | vector<T> with the source data. |
| dest | T where the result will be left. |
- Returns:
- a reference to the
dest
.
returns the arithmetic mean of the given vector.
- Parameters:
-
| src | vector<T> with the source data. |
- Returns:
- the arithmetic mean of the elements of src.
The result vector contains the arithmetic mean of the columns of the matrix (each column a data point).
- Parameters:
-
| src | matrix<T> with the source data. |
| dest | matrix<T> where the result will be left. |
This function will compute a vector, whose elements contain each the arithmetic mean of one column of the matrix (the method computes the mean of the rows, where each row is a data point in n-dimensional space).
- Parameters:
-
| src | matrix<T> with the source data. |
| dest | matrix<T> where the result will be left. |
computes the geometric mean of the given vector.
For convenience we take the square root of the absolute value of the product of all elements.
- Parameters:
-
| src | vector<T> with the source data. |
| dest | T where the result will be left. |
- Returns:
- a reference to the
dest
.
returns the geometric mean of the given vector.
For convenience we take the square root of the absolute value of the product of all elements.
- Parameters:
-
| src | vector<T> with the source data. |
- Returns:
- the geometric mean of the elements of src.
The result vector contains the geometric mean of the columns of the matrix (each column a data point).
For convenience we take the square root of the absolute value of the product of all elements.
- Parameters:
-
| src | matrix<T> with the source data. |
| dest | matrix<T> where the result will be left. |
This function will compute a vector, whose elements contain each the geometric mean of one column of the matrix (the method computes the mean of the rows, where each row is a data point in n-dimensional space).
- Parameters:
-
| src | matrix<T> with the source data. |
| dest | matrix<T> where the result will be left. |
The result vector contains the mean of the columns of the matrix (each column a data point).
The type of the mean (arithmetic or geometric) is determined by the value of parameters::geometric. For the geometric mean we take the square root of the absolute value of the product of all elements.
- Parameters:
-
| src | matrix<T> with the source data. |
| dest | matrix<T> where the result will be left. |
This function will compute a vector, whose elements contain each the mean of one column of the matrix (the method computes the mean of the rows, where each row is a data point in n-dimensional space).
The type of the mean (arithmetic or geometric) is determined by the value of parameters::geometric. For the geometric mean we take the square root of the absolute value of the product of all elements.
- Parameters:
-
| src | matrix<T> with the source data. |
| dest | matrix<T> where the result will be left. |
The documentation for this class was generated from the following file: