A toolkit for working with phylogenetic data.
v0.20.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
matrix.cpp File Reference
#include "genesis/utils/math/matrix.hpp"
#include "genesis/utils/math/common.hpp"
#include <algorithm>
#include <cassert>
#include <cmath>
#include <stdexcept>

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