Loading...
Searching...
No Matches
BALL::QSAR::Statistics Class Reference

`#include <BALL/QSAR/statistics.h>`

## Public Member Functions

Constructors and Destructors
| Statistics ()
| ~Statistics ()

## Static Public Member Functions

static functions
static void | scaling (std::vector< double > &v)
static void | scaling (std::vector< std::vector< double > > &m)
static void | centering (std::vector< std::vector< double > > &m)
static void | centering (std::vector< double > &v)
static void | centering (vector< double > &v, double &mean, double &std)
static double | getVariance (const std::vector< double > &v, double mean=-1)
static double | getStddev (const vector< double > &v, double mean=-1)
static double | getCovariance (const vector< double > &v1, const vector< double > &v2, double mean1, double mean2)
static double | getMean (const std::vector< double > &v)
static double | calculateRankCorrelation (vector< double > &observed_values, vector< double > &expected_values)
static double | getRowCovariance (const vector< vector< double > > &v, int row1, int row2, double mean1=-1, double mean2=-1, std::multiset< int > *features_to_use=0)
static double | getRowMean (const vector< vector< double > > &v, int row, std::multiset< int > *features_to_use=0)
static double | getRowVariance (const vector< vector< double > > &v, int row, double mean=-1, std::multiset< int > *features_to_use=0)
static double | getRowStddev (const vector< vector< double > > &v, int row, double mean=-1, std::multiset< int > *features_to_use=0)
static void | centering (Eigen::MatrixXd &m)
static void | centering (Eigen::MatrixXd &m, int col)
static double | getMean (const Eigen::MatrixXd &m, int col)
static double | getVariance (const Eigen::MatrixXd &m, int col, double mean=-1)
static double | getStddev (const Eigen::MatrixXd &m, int col, double mean=-1)
static double | getCovariance (const Eigen::MatrixXd &m, int col1, int col2, double mean1=-1, double mean2=-1)
static double | sq (const Eigen::MatrixXd &m, int col, double mean=-1)
static double | distance (const Eigen::MatrixXd &m, int &row1, int &row2, double &p)
static double | distance (const Eigen::MatrixXd &m1, const Eigen::MatrixXd &m2, int &row1, int &row2, double &p)
static double | distance (const Eigen::MatrixXd &m1, const Eigen::MatrixXd &m2, int &row1, int &row2, String &f, String &g)
static double | euclDistance (const Eigen::MatrixXd &m1, const Eigen::MatrixXd &m2, int row1, int row2)
static double | euclNorm (const Eigen::VectorXd &cv)
static double | euclDistance (const Eigen::VectorXd &c1, const Eigen::VectorXd &c2)
static double | scalarProduct (const Eigen::VectorXd &cv)

## Detailed Description

class for statistical correction of input-data

Definition at line 22 of file statistics.h.

## Constructor & Destructor Documentation

## Statistics()

BALL::QSAR::Statistics::Statistics | ( |  | ) |

inline

defaut constructor

Definition at line 29 of file statistics.h.

## ~Statistics()

BALL::QSAR::Statistics::~Statistics | ( |  | ) |

inline

defaut destructor

Definition at line 32 of file statistics.h.

## Member Function Documentation

## calculateRankCorrelation()

double BALL::QSAR::Statistics::calculateRankCorrelation | ( | vector< double > & | observed_values,
|  | vector< double > & | expected_values )

static

calculate Spearman's rank correlation

## centering() [1/5]

void BALL::QSAR::Statistics::centering | ( | Eigen::MatrixXd & | m | ) |

static

scales each column of the given newmat-matrix to a variance of 1

## centering() [2/5]

void BALL::QSAR::Statistics::centering | ( | Eigen::MatrixXd & | m,
|  | int | col )

static

scales column col of the given newmat-matrix m to a variance of 1

## centering() [3/5]

void BALL::QSAR::Statistics::centering | ( | std::vector< double > & | v | ) |

static

centers the given vector to a variance of 1 and mean of 0

## centering() [4/5]

void BALL::QSAR::Statistics::centering | ( | std::vector< std::vector< double > > & | m | ) |

static

centers each colum of the given vector-based matrix to a variance of 1 and mean of 0

## centering() [5/5]

void BALL::QSAR::Statistics::centering | ( | vector< double > & | v,
|  | double & | mean,
|  | double & | std )

static

centers the given vector to a variance of 1 and mean of 0

Parameters

  mean | the mean of v will be saved here
  std | the standart deviation of v will be saved here

## distance() [1/3]

double BALL::QSAR::Statistics::distance | ( | const Eigen::MatrixXd & | m,
|  | int & | row1,
|  | int & | row2,
|  | double & | p )

static

calculates polynomial distance between two rows of newmat-matrix m

## distance() [2/3]

double BALL::QSAR::Statistics::distance | ( | const Eigen::MatrixXd & | m1,
|  | const Eigen::MatrixXd & | m2,
|  | int & | row1,
|  | int & | row2,
|  | double & | p )

static

calculates polynomial distance between row1 of Eigen::MatrixXd m1 and row2 of Eigen::MatrixXd m2.
m1 and m2 must therefore have the same number of columns.

## distance() [3/3]

double BALL::QSAR::Statistics::distance | ( | const Eigen::MatrixXd & | m1,
|  | const Eigen::MatrixXd & | m2,
|  | int & | row1,
|  | int & | row2,
|  | String & | f,
|  | String & | g )

static

calculates the distance between row1 of Eigen::MatrixXd m1 and row2 of Eigen::MatrixXd m2 according to the given equations

Parameters

  f | equation f, determines how elements "x1" of row1 are charged against elements "x2" of row2. Use "x1" and "x2" in the String, e.g. "x1*x2"
  g | equation g, determines what is to be done with the calculated "sum" over all elements (use "sum" in String); e.g. "sum^0.5" => euclidean distance if f=="x1*x2"

## euclDistance() [1/2]

double BALL::QSAR::Statistics::euclDistance | ( | const Eigen::MatrixXd & | m1,
|  | const Eigen::MatrixXd & | m2,
|  | int | row1,
|  | int | row2 )

static

calculates euclidean distance between row1 of Eigen::MatrixXd m1 and row2 of Eigen::MatrixXd m2 as
m1 and m2 must therefore have the same number of columns.

## euclDistance() [2/2]

double BALL::QSAR::Statistics::euclDistance | ( | const Eigen::VectorXd & | c1,
|  | const Eigen::VectorXd & | c2 )

static

Returns the euclidician difference between two ColumnVectors as

## euclNorm()

double BALL::QSAR::Statistics::euclNorm | ( | const Eigen::VectorXd & | cv | ) |

static

Returns the euclidic norm of a ColumnVector as

## getCovariance() [1/2]

double BALL::QSAR::Statistics::getCovariance | ( | const Eigen::MatrixXd & | m,
|  | int | col1,
|  | int | col2,
|  | double | mean1 = -1,
|  | double | mean2 = -1 )

static

calculates covariance between columns col1 and col2 of matrix m

## getCovariance() [2/2]

double BALL::QSAR::Statistics::getCovariance | ( | const vector< double > & | v1,
|  | const vector< double > & | v2,
|  | double | mean1,
|  | double | mean2 )

static

calculate covariance between two given vectors

## getMean() [1/2]

double BALL::QSAR::Statistics::getMean | ( | const Eigen::MatrixXd & | m,
|  | int | col )

static

calculates mean of column col of newmat-matrix m

## getMean() [2/2]

double BALL::QSAR::Statistics::getMean | ( | const std::vector< double > & | v | ) |

static

calculate mean of given vector

## getRowCovariance()

double BALL::QSAR::Statistics::getRowCovariance | ( | const vector< vector< double > > & | v,
|  | int | row1,
|  | int | row2,
|  | double | mean1 = -1,
|  | double | mean2 = -1,
|  | std::multiset< int > * | features_to_use = 0 )

static

calculates covarianve between two rows of the given matrix

Parameters

  features_to_use | if specified, only the contained features are used for calculation of the covariance

## getRowMean()

double BALL::QSAR::Statistics::getRowMean | ( | const vector< vector< double > > & | v,
|  | int | row,
|  | std::multiset< int > * | features_to_use = 0 )

static

calculates mean of a row of the given matrix

Parameters

  features_to_use | if specified, only the contained features are used for calculation of the mean

## getRowStddev()

double BALL::QSAR::Statistics::getRowStddev | ( | const vector< vector< double > > & | v,
|  | int | row,
|  | double | mean = -1,
|  | std::multiset< int > * | features_to_use = 0 )

static

calculates standard deviation of a row of the given matrix

Parameters

  features_to_use | if specified, only the contained features are used for calculation of the standard deviation

## getRowVariance()

double BALL::QSAR::Statistics::getRowVariance | ( | const vector< vector< double > > & | v,
|  | int | row,
|  | double | mean = -1,
|  | std::multiset< int > * | features_to_use = 0 )

static

calculates variance of a row of the given matrix

Parameters

  features_to_use | if specified, only the contained features are used for calculation of the variance

## getStddev() [1/2]

double BALL::QSAR::Statistics::getStddev | ( | const Eigen::MatrixXd & | m,
|  | int | col,
|  | double | mean = -1 )

static

calculated standard deviation of column col of matrix m

## getStddev() [2/2]

double BALL::QSAR::Statistics::getStddev | ( | const vector< double > & | v,
|  | double | mean = -1 )

static

calculate standart deviation of a given vector

## getVariance() [1/2]

double BALL::QSAR::Statistics::getVariance | ( | const Eigen::MatrixXd & | m,
|  | int | col,
|  | double | mean = -1 )

static

calculates variance of column col of newmat-matrix m

## getVariance() [2/2]

double BALL::QSAR::Statistics::getVariance | ( | const std::vector< double > & | v,
|  | double | mean = -1 )

static

calculate variance of a given vector

## scalarProduct()

double BALL::QSAR::Statistics::scalarProduct | ( | const Eigen::VectorXd & | cv | ) |

static

returns the scalar product

## scaling() [1/2]

void BALL::QSAR::Statistics::scaling | ( | std::vector< double > & | v | ) |

static

scales the given vector to a variance of 1

## scaling() [2/2]

void BALL::QSAR::Statistics::scaling | ( | std::vector< std::vector< double > > & | m | ) |

static

scales each column of the given vector-based matrix to a variance of 1

## sq()

double BALL::QSAR::Statistics::sq | ( | const Eigen::MatrixXd & | m,
|  | int | col,
|  | double | mean = -1 )

static

calculates the sum-of-square of column col of newmat-matrix m