BALL 1.5.0
Loading...
Searching...
No Matches
statistics.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4//
5
6#ifndef STATISTICS
7#define STATISTICS
8
9#include <vector>
10#include <iostream>
11#include <cmath>
13
14#include <set>
15#include <Eigen/Core>
16
17namespace BALL
18{
19 namespace QSAR
20 {
23 {
24 public:
30
34
35
36
41 static void scaling(std::vector<double>& v);
42
44 static void scaling(std::vector<std::vector<double> >& m);
45
47 static void centering(std::vector<std::vector<double> >& m);
48
50 static void centering(std::vector<double>& v);
51
55 static void centering(vector<double>& v, double& mean, double& std);
56
58 static double getVariance(const std::vector<double>& v, double mean=-1);
59
61 static double getStddev(const vector<double>& v, double mean=-1);
62
64 static double getCovariance(const vector<double>& v1, const vector<double>& v2, double mean1, double mean2);
65
67 static double getMean(const std::vector<double>& v);
68
70 static double calculateRankCorrelation(vector<double>& observed_values, vector<double>& expected_values);
71 //--- methods for calculating mean, covar, var of matrix-ROWS ---
72
75 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);
76
79 static double getRowMean(const vector<vector<double> >& v, int row, std::multiset<int>* features_to_use=0);
80
83 static double getRowVariance(const vector<vector<double> >& v, int row, double mean=-1, std::multiset<int>* features_to_use=0);
84
87 static double getRowStddev(const vector<vector<double> >& v, int row, double mean=-1, std::multiset<int>* features_to_use=0);
88
89 // ------------------------
90
91
93 static void centering(Eigen::MatrixXd& m);
94
96 static void centering(Eigen::MatrixXd& m, int col);
97
99 static double getMean(const Eigen::MatrixXd& m, int col);
100
102 static double getVariance(const Eigen::MatrixXd& m, int col, double mean=-1);
103
105 static double getStddev(const Eigen::MatrixXd& m, int col, double mean=-1);
106
108 static double getCovariance(const Eigen::MatrixXd& m, int col1, int col2, double mean1=-1, double mean2=-1);
109
111 static double sq(const Eigen::MatrixXd& m, int col, double mean=-1);
112
114 static double distance(const Eigen::MatrixXd& m, int& row1, int& row2, double& p);
115
118 static double distance(const Eigen::MatrixXd& m1, const Eigen::MatrixXd& m2, int& row1, int& row2, double& p);
119
120
124 static double distance(const Eigen::MatrixXd& m1, const Eigen::MatrixXd& m2, int& row1, int& row2, String& f, String& g);
125
126
129 static double euclDistance(const Eigen::MatrixXd& m1, const Eigen::MatrixXd& m2, int row1, int row2);
130
132 static double euclNorm(const Eigen::VectorXd& cv);
133
135 static double euclDistance(const Eigen::VectorXd& c1, const Eigen::VectorXd& c2);
136
138 static double scalarProduct(const Eigen::VectorXd& cv);
140
141 };
142 }
143}
144
145
146#endif // STATISTICS
STL namespace.
static double distance(const Eigen::MatrixXd &m, int &row1, int &row2, double &p)
static double getMean(const std::vector< double > &v)
static double scalarProduct(const Eigen::VectorXd &cv)
static double getVariance(const std::vector< double > &v, double mean=-1)
static double euclDistance(const Eigen::VectorXd &c1, const Eigen::VectorXd &c2)
static double getStddev(const Eigen::MatrixXd &m, int col, double mean=-1)
static double sq(const Eigen::MatrixXd &m, int col, double mean=-1)
static void centering(vector< double > &v, double &mean, double &std)
static double getVariance(const Eigen::MatrixXd &m, int col, double mean=-1)
static double getRowVariance(const vector< vector< double > > &v, int row, double mean=-1, std::multiset< int > *features_to_use=0)
static double getMean(const Eigen::MatrixXd &m, int col)
static double euclDistance(const Eigen::MatrixXd &m1, const Eigen::MatrixXd &m2, int row1, int row2)
static double getCovariance(const Eigen::MatrixXd &m, int col1, int col2, double mean1=-1, double mean2=-1)
static double getStddev(const vector< double > &v, double mean=-1)
static double distance(const Eigen::MatrixXd &m1, const Eigen::MatrixXd &m2, int &row1, int &row2, String &f, String &g)
static double getCovariance(const vector< double > &v1, const vector< double > &v2, double mean1, double mean2)
static double euclNorm(const Eigen::VectorXd &cv)
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(std::vector< std::vector< double > > &m)
static void scaling(std::vector< double > &v)
static double distance(const Eigen::MatrixXd &m1, const Eigen::MatrixXd &m2, int &row1, int &row2, double &p)
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 void scaling(std::vector< std::vector< double > > &m)
static void centering(Eigen::MatrixXd &m, int col)
static void centering(std::vector< double > &v)
static double getRowMean(const vector< vector< double > > &v, int row, std::multiset< int > *features_to_use=0)
static double calculateRankCorrelation(vector< double > &observed_values, vector< double > &expected_values)
#define BALL_EXPORT