A toolkit for working with phylogenetic data.
v0.18.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
statistics.hpp File Reference

Detailed Description

Matrix statstic functions.

Definition in file statistics.hpp.

#include "genesis/utils/math/common.hpp"
#include "genesis/utils/math/matrix.hpp"
#include <utility>
#include <vector>

Go to the source code of this file.

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::utils
 

Functions

Matrix< double > correlation_matrix (Matrix< double > const &data)
 Calculate the correlation Matrix of a given data Matrix. More...
 
Matrix< double > covariance_matrix (Matrix< double > const &data)
 Calculate the covariance Matrix of a given data Matrix. More...
 
std::vector< MeanStddevPair > matrix_col_mean_stddev (Matrix< double > const &data, double epsilon=-1.0)
 Calcualte the column-wise mean and standard deviation of a Matrix. More...
 
template<typename T >
std::vector< MinMaxPair< T > > matrix_col_minmax (Matrix< T > const &data)
 Calculate the column-wise min and max values of a Matrix. More...
 
double matrix_col_pearson_correlation_coefficient (Matrix< double > const &mat1, size_t col1, Matrix< double > const &mat2, size_t col2)
 Calculate the Pearson Correlation Coefficient between two columns of two Matrices. More...
 
Quartiles matrix_col_quartiles (Matrix< double > const &data, size_t col)
 
std::vector< Quartiles > matrix_col_quartiles (Matrix< double > const &data)
 
double matrix_col_spearmans_rank_correlation_coefficient (Matrix< double > const &mat1, size_t col1, Matrix< double > const &mat2, size_t col2)
 Calculate Spearman's Rank Correlation Coefficient between two columns of two Matrices. More...
 
template<typename T >
std::vector< T > matrix_col_sums (Matrix< T > const &data)
 Calculate the sum of each column and return the result as a vector. More...
 
MeanStddevPair matrix_mean_stddev (Matrix< double > const &data, double epsilon=-1.0)
 Calcualte the mean and standard deviation of all elements in a Matrix. More...
 
template<typename T >
MinMaxPair< T > matrix_minmax (Matrix< T > const &data)
 Calculate the min and max values of a Matrix. More...
 
Quartiles matrix_quartiles (Matrix< double > const &data)
 Calculate the Quartiles of the elmements in Matrix of double. More...
 
std::vector< MeanStddevPair > matrix_row_mean_stddev (Matrix< double > const &data, double epsilon=-1.0)
 Calcualte the row-wise mean and standard deviation of a Matrix. More...
 
template<typename T >
std::vector< MinMaxPair< T > > matrix_row_minmax (Matrix< T > const &data)
 Calculate the row-wise min and max values of a Matrix. More...
 
double matrix_row_pearson_correlation_coefficient (Matrix< double > const &mat1, size_t row1, Matrix< double > const &mat2, size_t row2)
 Calculate the Pearson Correlation Coefficient between two row of two Matrices. More...
 
Quartiles matrix_row_quartiles (Matrix< double > const &data, size_t row)
 
std::vector< Quartiles > matrix_row_quartiles (Matrix< double > const &data)
 
double matrix_row_spearmans_rank_correlation_coefficient (Matrix< double > const &mat1, size_t row1, Matrix< double > const &mat2, size_t row2)
 Calculate Spearman's Rank Correlation Coefficient between two row of two Matrices. More...
 
template<typename T >
std::vector< T > matrix_row_sums (Matrix< T > const &data)
 Calculate the sum of each row and return the result as a vector. More...
 
template<typename T >
matrix_sum (Matrix< T > const &data)
 Calculate the sum of all elements in a Matrix. More...
 
std::vector< MinMaxPair< double > > normalize_cols (Matrix< double > &data)
 Normalize the columns of a Matrix so that all values are in the range [ 0.0, 1.0 ]. More...
 
std::vector< MinMaxPair< double > > normalize_rows (Matrix< double > &data)
 Normalize the rows of a Matrix so that all values are in the range [ 0.0, 1.0 ]. More...
 
std::vector< MeanStddevPair > standardize_cols (Matrix< double > &data, bool scale_means=true, bool scale_std=true)
 Standardize the columns of a Matrix by subtracting the mean and scaling to unit variance. More...
 
std::vector< MeanStddevPair > standardize_rows (Matrix< double > &data, bool scale_means=true, bool scale_std=true)
 Standardize the rows of a Matrix by subtracting the mean and scaling to unit variance. More...
 
Matrix< double > sums_of_squares_and_cross_products_matrix (Matrix< double > const &data)
 Calculate the Sums of Squares and Cross Products Matrix (SSCP Matrix). More...