A toolkit for working with phylogenetic data.
v0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
statistics.hpp File Reference
#include "genesis/utils/core/algorithm.hpp"
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstddef>
#include <limits>
#include <stdexcept>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

struct  MeanStddevPair
 Store a mean and a standard deviation value. More...
 
struct  MinMaxPair< T >
 Store a pair of min and max values. More...
 
struct  Quartiles
 Store the values of quartiles: q0 == min, q1 == 25%, q2 == 50%, q3 == 75%, q4 == max. More...
 

Namespaces

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

Functions

double coefficient_of_variation (MeanStddevPair const &ms)
 Calculate the index of dispersion. More...
 
std::vector< double > coefficient_of_variation (std::vector< MeanStddevPair > const &ms)
 Calculate the index of dispersion. More...
 
template<class ForwardIteratorA , class ForwardIteratorB >
std::pair< std::vector< double >
, std::vector< double > > 
finite_pairs (ForwardIteratorA first_a, ForwardIteratorA last_a, ForwardIteratorB first_b, ForwardIteratorB last_b)
 Helper function that cleans two ranges of double of the same length from non-finite values. More...
 
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...
 
double index_of_dispersion (MeanStddevPair const &ms)
 Calculate the index of dispersion. More...
 
std::vector< double > index_of_dispersion (std::vector< MeanStddevPair > const &ms)
 Calculate the index of dispersion. More...
 
template<class ForwardIterator >
MeanStddevPair mean_stddev (ForwardIterator first, ForwardIterator last, double epsilon=-1.0)
 Calculate the mean and standard deviation of a range of double elements. More...
 
MeanStddevPair mean_stddev (std::vector< double > const &vec, double epsilon=-1.0)
 Calculate the mean and standard deviation of a vector of double elements. More...
 
template<class RandomAccessIterator >
double median (RandomAccessIterator first, RandomAccessIterator last, size_t l, size_t r)
 Helper function to get the median in between a range. Both l and r are inclusive. More...
 
template<class RandomAccessIterator >
double median (RandomAccessIterator first, RandomAccessIterator last)
 Calculate the median value of a range of double. More...
 
double median (std::vector< double > const &vec)
 Calculate the median value of a vector of double. 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...
 
double quartile_coefficient_of_dispersion (Quartiles const &q)
 Calculate the quartile_coefficient_of_dispersion. More...
 
std::vector< double > quartile_coefficient_of_dispersion (std::vector< Quartiles > const &q)
 Calculate the quartile_coefficient_of_dispersion. More...
 
template<class RandomAccessIterator >
Quartiles quartiles (RandomAccessIterator first, RandomAccessIterator last)
 
Quartiles quartiles (std::vector< double > const &vec)
 Calculate the Quartiles of a vector of double. More...
 
template<class RandomAccessIterator >
std::vector< size_t > ranking_dense (RandomAccessIterator first, RandomAccessIterator last)
 Return the ranking of the values in the given range, using Dense ranking ("1223" ranking). More...
 
std::vector< size_t > ranking_dense (std::vector< double > const &vec)
 Return the ranking of the values in the given range, using Dense ranking ("1223" ranking). More...
 
std::vector< double > ranking_fractional (std::vector< double > const &vec)
 Return the ranking of the values in the given range, using Fractional ranking ("1 2.5 2.5 4" ranking). More...
 
template<class RandomAccessIterator >
std::vector< double > ranking_fractional (RandomAccessIterator first, RandomAccessIterator last)
 Return the ranking of the values in the given range, using Fractional ranking ("1 2.5 2.5 4" ranking). More...
 
template<class RandomAccessIterator >
std::vector< size_t > ranking_modified (RandomAccessIterator first, RandomAccessIterator last)
 Return the ranking of the values in the given range, using Modified competition ranking ("1334" ranking). More...
 
std::vector< size_t > ranking_modified (std::vector< double > const &vec)
 Return the ranking of the values in the given range, using Modified competition ranking ("1334" ranking). More...
 
template<class RandomAccessIterator >
std::vector< size_t > ranking_ordinal (RandomAccessIterator first, RandomAccessIterator last)
 Return the ranking of the values in the given range, using Ordinal ranking ("1234" ranking). More...
 
std::vector< size_t > ranking_ordinal (std::vector< double > const &vec)
 Return the ranking of the values in the given range, using Ordinal ranking ("1234" ranking). More...
 
template<class RandomAccessIterator >
std::vector< size_t > ranking_standard (RandomAccessIterator first, RandomAccessIterator last)
 Return the ranking of the values in the given range, using Standard competition ranking ("1224" ranking). More...
 
std::vector< size_t > ranking_standard (std::vector< double > const &vec)
 Return the ranking of the values in the given range, using Standard competition ranking ("1224" ranking). 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...