A library for working with phylogenetic and population genetic data.
v0.32.0
correlation.hpp File Reference
#include "genesis/utils/core/algorithm.hpp"
#include "genesis/utils/math/common.hpp"
#include "genesis/utils/math/ranking.hpp"
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <limits>
#include <stdexcept>
#include <string>
#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
 

Enumerations

enum  KendallsTauMethod { kTauA, kTauB, kTauC }
 Method for computing Kendall's Tau. More...
 

Functions

double fisher_transformation (double correlation_coefficient)
 Apply Fisher z-transformation to a correlation coefficient. More...
 
std::vector< double > fisher_transformation (std::vector< double > const &correlation_coefficients)
 Apply Fisher z-transformation to a vector of correlation coefficients. More...
 
template<class InputIteratorA , class InputIteratorB >
double kendalls_tau_correlation_coefficient (InputIteratorA first_a, InputIteratorA last_a, InputIteratorB first_b, InputIteratorB last_b, KendallsTauMethod method=KendallsTauMethod::kTauB)
 
double kendalls_tau_correlation_coefficient (std::vector< double > const &x, std::vector< double > const &y, KendallsTauMethod method=KendallsTauMethod::kTauB)
 Compute Kendall's Tau Correlation Coefficient. More...
 
double kendalls_tau_correlation_coefficient_naive (std::vector< double > const &x, std::vector< double > const &y, KendallsTauMethod method=KendallsTauMethod::kTauB)
 Compute a simple version of Kendall's Tau Correlation Coefficient. More...
 
template<class ForwardIteratorA , class ForwardIteratorB >
double pearson_correlation_coefficient (ForwardIteratorA first_a, ForwardIteratorA last_a, ForwardIteratorB first_b, ForwardIteratorB last_b)
 Calculate the Pearson Correlation Coefficient between two ranges of double. More...
 
double pearson_correlation_coefficient (std::vector< double > const &vec_a, std::vector< double > const &vec_b)
 Calculate the Pearson Correlation Coefficient between the entries of two vectors. More...
 
template<class RandomAccessIteratorA , class RandomAccessIteratorB >
double spearmans_rank_correlation_coefficient (RandomAccessIteratorA first_a, RandomAccessIteratorA last_a, RandomAccessIteratorB first_b, RandomAccessIteratorB last_b)
 Calculate Spearman's Rank Correlation Coefficient between two ranges of double. More...
 
double spearmans_rank_correlation_coefficient (std::vector< double > const &vec_a, std::vector< double > const &vec_b)
 Calculate Spearman's Rank Correlation Coefficient between the entries of two vectors. More...