Loading...
Searching...
No Matches
statistics.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
//
#ifndef STATISTICS
#define STATISTICS
#include <vector>
#include <iostream>
#include <cmath>
#include <BALL/MATHS/parsedFunction.h>
#include <set>
#include <Eigen/Core>
namespace BALL
{
namespace QSAR
{
class BALL_EXPORT Statistics
{
public:
Statistics(){};
~Statistics(){};
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);
//--- methods for calculating mean, covar, var of matrix-ROWS ---
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);
};
}
}
#endif // STATISTICS
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::QSAR::Statistics::distance
static double distance(const Eigen::MatrixXd &m, int &row1, int &row2, double &p)
BALL::QSAR::Statistics::getMean
static double getMean(const std::vector< double > &v)
BALL::QSAR::Statistics::scalarProduct
static double scalarProduct(const Eigen::VectorXd &cv)
BALL::QSAR::Statistics::getVariance
static double getVariance(const std::vector< double > &v, double mean=-1)
BALL::QSAR::Statistics::euclDistance
static double euclDistance(const Eigen::VectorXd &c1, const Eigen::VectorXd &c2)
BALL::QSAR::Statistics::getStddev
static double getStddev(const Eigen::MatrixXd &m, int col, double mean=-1)
BALL::QSAR::Statistics::sq
static double sq(const Eigen::MatrixXd &m, int col, double mean=-1)
BALL::QSAR::Statistics::centering
static void centering(vector< double > &v, double &mean, double &std)
BALL::QSAR::Statistics::getVariance
static double getVariance(const Eigen::MatrixXd &m, int col, double mean=-1)
BALL::QSAR::Statistics::getRowVariance
static double getRowVariance(const vector< vector< double > > &v, int row, double mean=-1, std::multiset< int > *features_to_use=0)
BALL::QSAR::Statistics::getMean
static double getMean(const Eigen::MatrixXd &m, int col)
BALL::QSAR::Statistics::euclDistance
static double euclDistance(const Eigen::MatrixXd &m1, const Eigen::MatrixXd &m2, int row1, int row2)
BALL::QSAR::Statistics::getCovariance
static double getCovariance(const Eigen::MatrixXd &m, int col1, int col2, double mean1=-1, double mean2=-1)
BALL::QSAR::Statistics::~Statistics
~Statistics()
Definition statistics.h:32
BALL::QSAR::Statistics::getStddev
static double getStddev(const vector< double > &v, double mean=-1)
BALL::QSAR::Statistics::distance
static double distance(const Eigen::MatrixXd &m1, const Eigen::MatrixXd &m2, int &row1, int &row2, String &f, String &g)
BALL::QSAR::Statistics::getCovariance
static double getCovariance(const vector< double > &v1, const vector< double > &v2, double mean1, double mean2)
BALL::QSAR::Statistics::euclNorm
static double euclNorm(const Eigen::VectorXd &cv)
BALL::QSAR::Statistics::Statistics
Statistics()
Definition statistics.h:29
BALL::QSAR::Statistics::getRowStddev
static double getRowStddev(const vector< vector< double > > &v, int row, double mean=-1, std::multiset< int > *features_to_use=0)
BALL::QSAR::Statistics::centering
static void centering(Eigen::MatrixXd &m)
BALL::QSAR::Statistics::centering
static void centering(std::vector< std::vector< double > > &m)
BALL::QSAR::Statistics::scaling
static void scaling(std::vector< double > &v)
BALL::QSAR::Statistics::distance
static double distance(const Eigen::MatrixXd &m1, const Eigen::MatrixXd &m2, int &row1, int &row2, double &p)
BALL::QSAR::Statistics::getRowCovariance
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)
BALL::QSAR::Statistics::scaling
static void scaling(std::vector< std::vector< double > > &m)
BALL::QSAR::Statistics::centering
static void centering(Eigen::MatrixXd &m, int col)
BALL::QSAR::Statistics::centering
static void centering(std::vector< double > &v)
BALL::QSAR::Statistics::getRowMean
static double getRowMean(const vector< vector< double > > &v, int row, std::multiset< int > *features_to_use=0)
BALL::QSAR::Statistics::calculateRankCorrelation
static double calculateRankCorrelation(vector< double > &observed_values, vector< double > &expected_values)
BALL::String
Definition string.h:57
BALL::QSAR
Definition allModel.h:17
BALL
Definition constants.h:13
std
STL namespace.
parsedFunction.h