38#include <gtest/gtest.h>
60 vector<double> v = {5.0};
66 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0};
72 vector<double> v = {-1.0, -2.0, 3.0};
78 vector<int> v = {1, 2, 3, 4, 5};
94 vector<double> v = {5.0};
100 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0};
106 vector<double> v = {-10.0, 10.0};
112 list<double>
l = {1.0, 2.0, 3.0};
128 vector<double> v = {5.0};
134 vector<double> v = {5.0};
140 vector<double> v = {0.0, 2.0};
147 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0};
156 vector<double> v = {5.0, 5.0, 5.0, 5.0};
163 vector<double> v = {1
e10, 1
e10 + 1, 1
e10 + 2};
174 vector<double> v = {2.0, 4.0, 4.0, 4.0, 5.0, 5.0, 7.0, 9.0};
182 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0};
200 vector<double> v = {5.0};
210 vector<double> v = {3.0, 1.0, 4.0, 1.0, 5.0, 9.0, 2.0};
220 vector<double> v = {-5.0, -1.0, -10.0, -3.0};
237 vector<double> v = {1.0, 2.0, 3.0};
244 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0};
250 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0};
256 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0};
262 vector<double> v = {5.0, 1.0, 3.0, 2.0, 4.0};
278 vector<double> v = {5.0};
284 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0};
290 vector<double> v = {1.0, 2.0, 3.0, 4.0};
296 vector<double> v = {5.0, 1.0, 3.0};
306 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0};
315 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0};
338 vector<int> v = {1, 2, 3, 4, 5};
346 vector<int> v = {1, 2, 2, 3, 3, 3, 4};
352 vector<int> v = {1, 1, 2, 2, 3};
358 vector<int> v = {1, 2, 2, 3};
368 vector<double> v = {1.0, 2.0};
374 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0};
380 vector<double> v = {1.0, 1.0, 1.0, 1.0, 10.0};
386 vector<double> v = {10.0, 10.0, 10.0, 10.0, 1.0};
392 vector<double> v = {5.0, 5.0, 5.0, 5.0};
402 vector<double> v = {1.0, 2.0, 3.0};
409 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0};
416 vector<double> v = {5.0, 5.0, 5.0, 5.0, 5.0};
426 vector<double> v = {-1.0, 1.0};
432 vector<double> v = {10.0, 10.0, 10.0, 10.0};
438 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0};
449 vector<double> x = {1.0, 2.0, 3.0};
450 vector<double>
y = {1.0, 2.0};
456 vector<double> x = {1.0};
457 vector<double>
y = {1.0};
463 vector<double> x = {1.0, 2.0, 3.0, 4.0, 5.0};
464 vector<double>
y = {1.0, 2.0, 3.0, 4.0, 5.0};
470 vector<double> x = {1.0, 2.0, 3.0, 4.0, 5.0};
471 vector<double>
y = {5.0, 4.0, 3.0, 2.0, 1.0};
477 vector<double> x = {1.0, 2.0, 3.0};
478 vector<double>
y = {2.0, 2.0, 2.0};
488 vector<double> x = {1.0, 2.0, 3.0, 4.0, 5.0};
489 vector<double>
y = {2.0, 4.0, 6.0, 8.0, 10.0};
495 vector<double> x = {1.0, 2.0, 3.0, 4.0, 5.0};
496 vector<double>
y = {10.0, 8.0, 6.0, 4.0, 2.0};
502 vector<double> x = {1.0, 1.0, 1.0};
503 vector<double>
y = {1.0, 2.0, 3.0};
509 vector<double> x = {1.0, 2.0, 3.0, 4.0, 5.0};
510 vector<double>
y = {1.0, 2.0, 1.5, 3.5, 5.0};
522 vector<double> v = {1.0, 2.0, 3.0};
534 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0};
542 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0};
547 for (
const auto & [center,
count] :
h)
554 vector<double> v = {5.0, 5.0, 5.0, 5.0};
594 vector<double> v = {5.0};
607 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0};
623 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0};
633 vector<double> v = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0};
649 double data[] = {5.0, 1.0, 3.0, 2.0, 4.0};
663 double data[] = {100.0, 1.0, 2.0, 3.0, 100.0};
677 vector<double> v = {5.0, 1.0, 3.0, 2.0, 4.0};
690 double data[] = {1.0, 2.0, 3.0, 4.0};
700 double data[] = {1.0, 2.0, 3.0};
728 vector<double> v = {1e-15, 2e-15, 3e-15, 4e-15, 5e-15};
737 vector<double> v = {-100.0, -50.0, 0.0, 50.0, 100.0};
757 list<double>
l = {1.0, 2.0, 3.0, 4.0, 5.0};
782 vector<int> v = {1, 2, 3, 4, 5};
795 ::testing::InitGoogleTest(&
argc,
argv);
T & append()
Allocate a new entry to the end of array.
__gmp_expr< T, __gmp_unary_expr< __gmp_expr< T, U >, __gmp_sqrt_function > > sqrt(const __gmp_expr< T, U > &expr)
Main namespace for Aleph-w library functions.
auto percentile(const Container &data, double p) -> std::decay_t< decltype(*std::begin(data))>
Compute a percentile value.
auto histogram(const Container &data, size_t num_bins) -> std::vector< std::pair< std::decay_t< decltype(*std::begin(data))>, size_t > >
Compute a histogram of the data.
auto variance(const Container &data, bool population=false) -> std::decay_t< decltype(*std::begin(data))>
Compute variance using Welford's numerically stable algorithm.
auto kurtosis(const Container &data) -> std::decay_t< decltype(*std::begin(data))>
Compute excess kurtosis (measure of tailedness).
const T * median(const T &a, const T &b, const T &c, const Compare &cmp=Compare())
Return a pointer to the median value among three elements.
auto covariance(const Container1 &x, const Container2 &y, bool population=false) -> std::decay_t< decltype(*std::begin(x))>
Compute covariance between two datasets.
auto stddev(const Container &data, bool population=false) -> std::decay_t< decltype(*std::begin(data))>
Compute standard deviation.
auto mean(const Container &data) -> std::decay_t< decltype(*std::begin(data))>
Compute the arithmetic mean.
auto min_max(const Container &data) -> std::pair< std::decay_t< decltype(*std::begin(data))>, std::decay_t< decltype(*std::begin(data))> >
Compute minimum and maximum values in one pass.
auto min_value(const Container &data) -> std::decay_t< decltype(*std::begin(data))>
Compute minimum value.
auto skewness(const Container &data) -> std::decay_t< decltype(*std::begin(data))>
Compute skewness (measure of asymmetry).
auto iqr(const Container &data) -> std::decay_t< decltype(*std::begin(data))>
Compute the interquartile range (IQR = Q3 - Q1).
auto compute_all_stats(const Container &data) -> Stats< std::decay_t< decltype(*std::begin(data))> >
Compute all statistics for a dataset.
auto correlation(const Container1 &x, const Container2 &y) -> std::decay_t< decltype(*std::begin(x))>
Compute Pearson correlation coefficient.
bool is_multimodal(const Container &data)
Check if data is multimodal.
auto coefficient_of_variation(const Container &data) -> std::decay_t< decltype(*std::begin(data))>
Compute coefficient of variation (CV = stddev / mean).
auto mode(const Container &data) -> std::decay_t< decltype(*std::begin(data))>
Compute the mode (most frequent value).
auto quartiles(const Container &data) -> std::tuple< std::decay_t< decltype(*std::begin(data))>, std::decay_t< decltype(*std::begin(data))>, std::decay_t< decltype(*std::begin(data))> >
Compute quartiles (Q1, Q2, Q3).
auto max_value(const Container &data) -> std::decay_t< decltype(*std::begin(data))>
Compute maximum value.
void compute_stats(T *data, int l, int r, T &avg, T &var, T &med, T &_min, T &_max)
Compute basic descriptive statistics for an array range.
DynList< T > maps(const C &c, Op op)
Classic map operation.
Itor::difference_type count(const Itor &beg, const Itor &end, const T &value)
Count elements equal to a value.
T sum(const Container &container, const T &init=T{})
Compute sum of all elements.
Comprehensive statistical utilities for numeric data.
Container for comprehensive statistical results.
size_t count
Number of elements.
bool is_valid() const noexcept
Check if statistics are valid.
T range() const noexcept
Get the range (max - min).