openGPMP
Open Source Mathematics Package
|
A class providing methods for descriptive statistics. More...
#include <describe.hpp>
Public Member Functions | |
double | mean_geo (const std::vector< double > &data) |
Calculates the geometric mean of a given dataset. More... | |
double | mean_cubic (const std::vector< double > &data, double p) |
Calculates the cubic generalized mean of a given dataset with a specified power. More... | |
double | mean_geo_pow (const std::vector< double > &data, double p) |
Calculates the power geometric mean of a given dataset with a specified power. More... | |
double | mean_harmonic (const std::vector< double > &data) |
Calculates the harmonic mean of a given dataset. More... | |
double | mean_heronian (const std::vector< double > &data) |
Calculates the Heronian mean of a given dataset. More... | |
double | mean_heinz (const std::vector< double > &data) |
Calculates the Heinz mean of a given dataset. More... | |
double | mean_lehmer (const std::vector< double > &data, double p) |
Calculates the Lehmer mean of a given dataset with a specified power. More... | |
double | Median (std::vector< double > data) |
Calculates the median of a given dataset. More... | |
double | avg_abs_dev (const std::vector< double > &data) |
Calculates the average absolute deviation of a given dataset. More... | |
double | var_coeff (const std::vector< double > &data) |
Calculates the coefficient of variation of a given dataset. More... | |
double | iq_range (const std::vector< double > &data) |
Calculates the interquartile range of a given dataset. More... | |
double | percentile (const std::vector< double > &data, double percentile) |
Calculates the specified percentile of a given dataset. More... | |
double | range (const std::vector< double > &data) |
Calculates the range of a given dataset. More... | |
double | clt (const std::vector< double > &data, int numSamples) |
Calculates the standard error of the mean using the Central Limit Theorem. More... | |
double | kurtosis (const std::vector< double > &data, double mean) |
Calculates the kurtosis of a given dataset. More... | |
double | lmoment1 (const std::vector< double > &data, double mean) |
Calculates the first L-moment of a given dataset. More... | |
double | lmoment2 (const std::vector< double > &data, double mean) |
Calculates the second L-moment of a given dataset. More... | |
double | skewness (const std::vector< double > &data, double mean, double stddev) |
Calculates the skewness of a given dataset. More... | |
std::vector< size_t > | rank_data (const std::vector< double > &data) |
Ranks the data in ascending order. More... | |
double | partial_corr (const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &z) |
Calculates the partial correlation coefficient between two variables, controlling for a third variable. More... | |
double | ppmc (const std::vector< double > &x, const std::vector< double > &y) |
Calculates the Pearson Product-Moment Correlation between two variables. More... | |
double | kendalls_tau (const std::vector< double > &x, const std::vector< double > &y) |
Calculates Kendall's Tau Rank Correlation between two variables. More... | |
double | spearmans_rho (const std::vector< double > &x, const std::vector< double > &y) |
Calculates Spearman's Rank Correlation between two variables. More... | |
Static Public Member Functions | |
static double | u_stat (const std::vector< double > &sample1, const std::vector< double > &sample2) |
Calculates U statistic given two samples. More... | |
static double | mean_arith (const std::vector< double > &data) |
Calculates the arithmetic mean of a given dataset. More... | |
static double | stdev (const std::vector< double > &data, double mean) |
Calculates the standard deviation of a given dataset, given the mean. More... | |
static double | variance (const std::vector< double > &data, double mean) |
Calculates the variance of a given dataset, given the mean. More... | |
A class providing methods for descriptive statistics.
Definition at line 44 of file describe.hpp.
double gpmp::stats::Describe::avg_abs_dev | ( | const std::vector< double > & | data | ) |
Calculates the average absolute deviation of a given dataset.
data | The input dataset |
Definition at line 138 of file describe.cpp.
double gpmp::stats::Describe::clt | ( | const std::vector< double > & | data, |
int | numSamples | ||
) |
Calculates the standard error of the mean using the Central Limit Theorem.
This method estimates the standard error of the mean based on the Central Limit Theorem
data | The input dataset |
numSamples | The number of samples for the Central Limit Theorem |
Definition at line 204 of file describe.cpp.
double gpmp::stats::Describe::iq_range | ( | const std::vector< double > & | data | ) |
Calculates the interquartile range of a given dataset.
data | The input dataset |
Definition at line 155 of file describe.cpp.
double gpmp::stats::Describe::kendalls_tau | ( | const std::vector< double > & | x, |
const std::vector< double > & | y | ||
) |
Calculates Kendall's Tau Rank Correlation between two variables.
This method measures the strength and direction of monotonic relationships between variables X and Y
x | The values of variable X |
y | The values of variable Y |
Definition at line 300 of file describe.cpp.
double gpmp::stats::Describe::kurtosis | ( | const std::vector< double > & | data, |
double | mean | ||
) |
Calculates the kurtosis of a given dataset.
This method measures the "tailedness" or sharpness of the dataset's peak
data | The input dataset |
mean | The mean of the dataset |
Definition at line 212 of file describe.cpp.
double gpmp::stats::Describe::lmoment1 | ( | const std::vector< double > & | data, |
double | mean | ||
) |
Calculates the first L-moment of a given dataset.
L-moments are used to estimate the parameters of a probability distribution
data | The input dataset |
mean | The mean of the dataset |
Definition at line 223 of file describe.cpp.
double gpmp::stats::Describe::lmoment2 | ( | const std::vector< double > & | data, |
double | mean | ||
) |
Calculates the second L-moment of a given dataset.
L-moments are used to estimate the parameters of a probability distribution
data | The input dataset |
mean | The mean of the dataset |
Definition at line 232 of file describe.cpp.
|
static |
Calculates the arithmetic mean of a given dataset.
data | The input dataset |
Definition at line 52 of file describe.cpp.
Referenced by gpmp::stats::HypothesisTest::ANOVA(), gpmp::stats::ProbDist::ConfidenceInterval(), gpmp::stats::ProbDist::mom(), gpmp::stats::HypothesisTest::one_sample_ttest(), gpmp::stats::ProbDist::PivotFunctionForConfidenceInterval(), and gpmp::stats::HypothesisTest::two_sample_ttest().
double gpmp::stats::Describe::mean_cubic | ( | const std::vector< double > & | data, |
double | p | ||
) |
Calculates the cubic generalized mean of a given dataset with a specified power.
data | The input dataset |
p | The power parameter |
Definition at line 70 of file describe.cpp.
double gpmp::stats::Describe::mean_geo | ( | const std::vector< double > & | data | ) |
Calculates the geometric mean of a given dataset.
data | The input dataset |
Definition at line 61 of file describe.cpp.
double gpmp::stats::Describe::mean_geo_pow | ( | const std::vector< double > & | data, |
double | p | ||
) |
Calculates the power geometric mean of a given dataset with a specified power.
data | The input dataset |
p | The power parameter |
Definition at line 80 of file describe.cpp.
double gpmp::stats::Describe::mean_harmonic | ( | const std::vector< double > & | data | ) |
Calculates the harmonic mean of a given dataset.
data | The input dataset |
Definition at line 90 of file describe.cpp.
double gpmp::stats::Describe::mean_heinz | ( | const std::vector< double > & | data | ) |
Calculates the Heinz mean of a given dataset.
data | The input dataset |
Definition at line 108 of file describe.cpp.
double gpmp::stats::Describe::mean_heronian | ( | const std::vector< double > & | data | ) |
Calculates the Heronian mean of a given dataset.
data | The input dataset |
Definition at line 99 of file describe.cpp.
double gpmp::stats::Describe::mean_lehmer | ( | const std::vector< double > & | data, |
double | p | ||
) |
Calculates the Lehmer mean of a given dataset with a specified power.
data | The input dataset |
p | The power parameter |
Definition at line 117 of file describe.cpp.
double gpmp::stats::Describe::Median | ( | std::vector< double > | data | ) |
Calculates the median of a given dataset.
data | The input dataset |
Definition at line 127 of file describe.cpp.
double gpmp::stats::Describe::partial_corr | ( | const std::vector< double > & | x, |
const std::vector< double > & | y, | ||
const std::vector< double > & | z | ||
) |
Calculates the partial correlation coefficient between two variables, controlling for a third variable.
This method computes the partial correlation between variables X and Y, controlling for variable Z
x | The values of variable X |
y | The values of variable Y |
z | The values of control variable Z |
Definition at line 269 of file describe.cpp.
double gpmp::stats::Describe::percentile | ( | const std::vector< double > & | data, |
double | percentile | ||
) |
Calculates the specified percentile of a given dataset.
data | The input dataset |
percentile | The desired percentile (00 to 10) |
Definition at line 167 of file describe.cpp.
double gpmp::stats::Describe::ppmc | ( | const std::vector< double > & | x, |
const std::vector< double > & | y | ||
) |
Calculates the Pearson Product-Moment Correlation between two variables.
This method measures the linear relationship between variables X and Y
x | The values of variable X |
y | The values of variable Y |
Definition at line 281 of file describe.cpp.
double gpmp::stats::Describe::range | ( | const std::vector< double > & | data | ) |
Calculates the range of a given dataset.
data | The input dataset |
Definition at line 178 of file describe.cpp.
std::vector< size_t > gpmp::stats::Describe::rank_data | ( | const std::vector< double > & | data | ) |
Ranks the data in ascending order.
This method assigns ranks to the data, where the smallest value gets rank 1, the second smallest gets rank 2, and so on
data | The input dataset |
Definition at line 253 of file describe.cpp.
double gpmp::stats::Describe::skewness | ( | const std::vector< double > & | data, |
double | mean, | ||
double | stddev | ||
) |
Calculates the skewness of a given dataset.
This method measures the asymmetry of the dataset's distribution
data | The input dataset |
mean | The mean of the dataset |
stddev | The standard deviation of the dataset |
Definition at line 242 of file describe.cpp.
double gpmp::stats::Describe::spearmans_rho | ( | const std::vector< double > & | x, |
const std::vector< double > & | y | ||
) |
Calculates Spearman's Rank Correlation between two variables.
This method measures the strength and direction of monotonic relationships between variables X and Y
x | The values of variable X |
y | The values of variable Y |
Definition at line 322 of file describe.cpp.
|
static |
Calculates the standard deviation of a given dataset, given the mean.
data | The input dataset |
mean | The mean of the dataset |
Definition at line 184 of file describe.cpp.
Referenced by gpmp::stats::ProbDist::ConfidenceInterval(), gpmp::stats::HypothesisTest::one_sample_ttest(), and gpmp::stats::ProbDist::PivotFunctionForConfidenceInterval().
|
static |
Calculates U statistic given two samples.
sample1 | |
sample2 |
Definition at line 38 of file describe.cpp.
Referenced by gpmp::stats::HypothesisTest::mann_whitney_test().
double gpmp::stats::Describe::var_coeff | ( | const std::vector< double > & | data | ) |
Calculates the coefficient of variation of a given dataset.
data | The input dataset |
Definition at line 148 of file describe.cpp.
|
static |
Calculates the variance of a given dataset, given the mean.
data | The input dataset |
mean | The mean of the dataset |
Definition at line 194 of file describe.cpp.
Referenced by gpmp::stats::ProbDist::mom(), and gpmp::stats::HypothesisTest::two_sample_ttest().