BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members
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

BALL::QSAR::Statistics::Statistics ( )
inline

defaut constructor

Definition at line 29 of file statistics.h.

BALL::QSAR::Statistics::~Statistics ( )
inline

defaut destructor

Definition at line 32 of file statistics.h.

Member Function Documentation

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

calculate Spearman's rank correlation

static 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

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

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

static 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
meanthe mean of v will be saved here
stdthe standart deviation of v will be saved here
static void BALL::QSAR::Statistics::centering ( Eigen::MatrixXd &  m)
static

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

static 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

static 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

static 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.

static 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
fequation 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"
gequation 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"
static 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 $ sqrt(\sum_i (row1_i-row2_i)^2) $
m1 and m2 must therefore have the same number of columns.

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

Returns the euclidician difference between two ColumnVectors as $ sqrt(\sum_i (cv1_i-cv2_i)^2) $

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

Returns the euclidic norm of a ColumnVector as $ sqrt(\sum_i cv_i^2) $

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

calculate covariance between two given vectors

static 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

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

calculate mean of given vector

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

calculates mean of column col of newmat-matrix m

static 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_useif specified, only the contained features are used for calculation of the covariance
static 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_useif specified, only the contained features are used for calculation of the mean
static 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_useif specified, only the contained features are used for calculation of the standard deviation
static 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_useif specified, only the contained features are used for calculation of the variance
static double BALL::QSAR::Statistics::getStddev ( const vector< double > &  v,
double  mean = -1 
)
static

calculate standart deviation of a given vector

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

calculated standard deviation of column col of matrix m

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

calculate variance of a given vector

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

calculates variance of column col of newmat-matrix m

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

returns the scalar product $ cv^T*cv = \sum_i cv_i^2 $

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

scales the given vector to a variance of 1

static 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

static 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