|
statcpp
C++17 Header-Only Statistics Library
|
Dispersion and variance calculation functions. More...
#include <algorithm>#include <cmath>#include <cstddef>#include <functional>#include <iterator>#include <stdexcept>#include <type_traits>#include <vector>#include "statcpp/basic_statistics.hpp"#include "statcpp/order_statistics.hpp"Go to the source code of this file.
Namespaces | |
| namespace | statcpp |
Functions | |
| template<typename Iterator > | |
| double | statcpp::range (Iterator first, Iterator last) |
| Range (maximum - minimum) | |
| template<typename Iterator , typename Projection > | |
| double | statcpp::range (Iterator first, Iterator last, Projection proj) |
| Range of projected values using a lambda expression. | |
| template<typename Iterator > | |
| double | statcpp::var (Iterator first, Iterator last, std::size_t ddof=0) |
| Variance (ddof = Delta Degrees of Freedom) | |
| template<typename Iterator > | |
| double | statcpp::var (Iterator first, Iterator last, double precomputed_mean, std::size_t ddof) |
| Variance using precomputed mean (with ddof) | |
| template<typename Iterator , typename Projection , typename = std::enable_if_t< std::is_invocable_v<Projection, typename std::iterator_traits<Iterator>::value_type>>> | |
| double | statcpp::var (Iterator first, Iterator last, Projection proj, std::size_t ddof=0) |
| Variance of projected values using a lambda expression (with ddof) | |
| template<typename Iterator , typename Projection > | |
| double | statcpp::var (Iterator first, Iterator last, Projection proj, double precomputed_mean, std::size_t ddof) |
| Variance of projected values using precomputed mean (with ddof) | |
| template<typename Iterator > | |
| double | statcpp::population_variance (Iterator first, Iterator last) |
| Population variance. | |
| template<typename Iterator > | |
| double | statcpp::population_variance (Iterator first, Iterator last, double precomputed_mean) |
| Population variance using precomputed mean. | |
| template<typename Iterator , typename Projection , typename = std::enable_if_t< std::is_invocable_v<Projection, typename std::iterator_traits<Iterator>::value_type>>> | |
| double | statcpp::population_variance (Iterator first, Iterator last, Projection proj) |
| Population variance of projected values using a lambda expression. | |
| template<typename Iterator , typename Projection > | |
| double | statcpp::population_variance (Iterator first, Iterator last, Projection proj, double precomputed_mean) |
| Population variance of projected values using precomputed mean. | |
| template<typename Iterator > | |
| double | statcpp::sample_variance (Iterator first, Iterator last) |
| Sample variance (unbiased variance) | |
| template<typename Iterator > | |
| double | statcpp::sample_variance (Iterator first, Iterator last, double precomputed_mean) |
| Sample variance using precomputed mean. | |
| template<typename Iterator , typename Projection , typename = std::enable_if_t< std::is_invocable_v<Projection, typename std::iterator_traits<Iterator>::value_type>>> | |
| double | statcpp::sample_variance (Iterator first, Iterator last, Projection proj) |
| Sample variance of projected values using a lambda expression. | |
| template<typename Iterator , typename Projection > | |
| double | statcpp::sample_variance (Iterator first, Iterator last, Projection proj, double precomputed_mean) |
| Sample variance of projected values using precomputed mean. | |
| template<typename Iterator > | |
| double | statcpp::variance (Iterator first, Iterator last) |
| Variance (alias for sample_variance) | |
| template<typename Iterator > | |
| double | statcpp::variance (Iterator first, Iterator last, double precomputed_mean) |
| Variance using precomputed mean. | |
| template<typename Iterator , typename Projection , typename = std::enable_if_t< std::is_invocable_v<Projection, typename std::iterator_traits<Iterator>::value_type>>> | |
| double | statcpp::variance (Iterator first, Iterator last, Projection proj) |
| Variance of projected values using a lambda expression. | |
| template<typename Iterator , typename Projection > | |
| double | statcpp::variance (Iterator first, Iterator last, Projection proj, double precomputed_mean) |
| Variance of projected values using precomputed mean. | |
| template<typename Iterator > | |
| double | statcpp::stdev (Iterator first, Iterator last, std::size_t ddof=0) |
| Standard deviation (ddof = Delta Degrees of Freedom) | |
| template<typename Iterator > | |
| double | statcpp::stdev (Iterator first, Iterator last, double precomputed_mean, std::size_t ddof) |
| Standard deviation using precomputed mean (with ddof) | |
| template<typename Iterator , typename Projection , typename = std::enable_if_t< std::is_invocable_v<Projection, typename std::iterator_traits<Iterator>::value_type>>> | |
| double | statcpp::stdev (Iterator first, Iterator last, Projection proj, std::size_t ddof=0) |
| Standard deviation of projected values using a lambda expression (with ddof) | |
| template<typename Iterator , typename Projection > | |
| double | statcpp::stdev (Iterator first, Iterator last, Projection proj, double precomputed_mean, std::size_t ddof) |
| Standard deviation of projected values using precomputed mean (with ddof) | |
| template<typename Iterator > | |
| double | statcpp::population_stddev (Iterator first, Iterator last) |
| Population standard deviation. | |
| template<typename Iterator > | |
| double | statcpp::population_stddev (Iterator first, Iterator last, double precomputed_mean) |
| Population standard deviation using precomputed mean. | |
| template<typename Iterator , typename Projection , typename = std::enable_if_t< std::is_invocable_v<Projection, typename std::iterator_traits<Iterator>::value_type>>> | |
| double | statcpp::population_stddev (Iterator first, Iterator last, Projection proj) |
| Population standard deviation of projected values using a lambda expression. | |
| template<typename Iterator , typename Projection > | |
| double | statcpp::population_stddev (Iterator first, Iterator last, Projection proj, double precomputed_mean) |
| Population standard deviation of projected values using precomputed mean. | |
| template<typename Iterator > | |
| double | statcpp::sample_stddev (Iterator first, Iterator last) |
| Sample standard deviation. | |
| template<typename Iterator > | |
| double | statcpp::sample_stddev (Iterator first, Iterator last, double precomputed_mean) |
| Sample standard deviation using precomputed mean. | |
| template<typename Iterator , typename Projection , typename = std::enable_if_t< std::is_invocable_v<Projection, typename std::iterator_traits<Iterator>::value_type>>> | |
| double | statcpp::sample_stddev (Iterator first, Iterator last, Projection proj) |
| Sample standard deviation of projected values using a lambda expression. | |
| template<typename Iterator , typename Projection > | |
| double | statcpp::sample_stddev (Iterator first, Iterator last, Projection proj, double precomputed_mean) |
| Sample standard deviation of projected values using precomputed mean. | |
| template<typename Iterator > | |
| double | statcpp::stddev (Iterator first, Iterator last) |
| Standard deviation (alias for sample_stddev) | |
| template<typename Iterator > | |
| double | statcpp::stddev (Iterator first, Iterator last, double precomputed_mean) |
| Standard deviation using precomputed mean. | |
| template<typename Iterator , typename Projection , typename = std::enable_if_t< std::is_invocable_v<Projection, typename std::iterator_traits<Iterator>::value_type>>> | |
| double | statcpp::stddev (Iterator first, Iterator last, Projection proj) |
| Standard deviation of projected values using a lambda expression. | |
| template<typename Iterator , typename Projection > | |
| double | statcpp::stddev (Iterator first, Iterator last, Projection proj, double precomputed_mean) |
| Standard deviation of projected values using precomputed mean. | |
| template<typename Iterator > | |
| double | statcpp::coefficient_of_variation (Iterator first, Iterator last) |
| Coefficient of variation. | |
| template<typename Iterator > | |
| double | statcpp::coefficient_of_variation (Iterator first, Iterator last, double precomputed_mean) |
| Coefficient of variation using precomputed mean. | |
| template<typename Iterator , typename Projection , typename = std::enable_if_t< std::is_invocable_v<Projection, typename std::iterator_traits<Iterator>::value_type>>> | |
| double | statcpp::coefficient_of_variation (Iterator first, Iterator last, Projection proj) |
| Coefficient of variation of projected values using a lambda expression. | |
| template<typename Iterator , typename Projection > | |
| double | statcpp::coefficient_of_variation (Iterator first, Iterator last, Projection proj, double precomputed_mean) |
| Coefficient of variation of projected values using precomputed mean. | |
| template<typename Iterator > | |
| double | statcpp::iqr (Iterator first, Iterator last) |
| Interquartile range (accepts a sorted range) | |
| template<typename Iterator , typename Projection > | |
| double | statcpp::iqr (Iterator first, Iterator last, Projection proj) |
| Interquartile range of projected values (projection results must be in sorted order) | |
| template<typename Iterator > | |
| double | statcpp::mean_absolute_deviation (Iterator first, Iterator last) |
| Mean absolute deviation. | |
| template<typename Iterator > | |
| double | statcpp::mean_absolute_deviation (Iterator first, Iterator last, double precomputed_mean) |
| Mean absolute deviation using precomputed mean. | |
| template<typename Iterator , typename Projection , typename = std::enable_if_t< std::is_invocable_v<Projection, typename std::iterator_traits<Iterator>::value_type>>> | |
| double | statcpp::mean_absolute_deviation (Iterator first, Iterator last, Projection proj) |
| Mean absolute deviation of projected values using a lambda expression. | |
| template<typename Iterator , typename Projection > | |
| double | statcpp::mean_absolute_deviation (Iterator first, Iterator last, Projection proj, double precomputed_mean) |
| Mean absolute deviation of projected values using precomputed mean. | |
| template<typename Iterator , typename WeightIterator > | |
| double | statcpp::weighted_variance (Iterator first, Iterator last, WeightIterator weight_first, WeightIterator weight_last) |
| Weighted variance (reliability weights / analytic weights) | |
| template<typename Iterator , typename WeightIterator > | |
| double | statcpp::weighted_variance (Iterator first, Iterator last, WeightIterator weight_first) |
| Weighted variance (reliability weights / analytic weights) | |
| template<typename Iterator , typename WeightIterator , typename Projection > | |
| double | statcpp::weighted_variance (Iterator first, Iterator last, WeightIterator weight_first, WeightIterator weight_last, Projection proj) |
| Weighted variance (projection version) | |
| template<typename Iterator , typename WeightIterator , typename Projection > | |
| double | statcpp::weighted_variance (Iterator first, Iterator last, WeightIterator weight_first, Projection proj) |
| Weighted variance (projection version) | |
| template<typename Iterator , typename WeightIterator > | |
| double | statcpp::weighted_stddev (Iterator first, Iterator last, WeightIterator weight_first, WeightIterator weight_last) |
| Weighted standard deviation. | |
| template<typename Iterator , typename WeightIterator > | |
| double | statcpp::weighted_stddev (Iterator first, Iterator last, WeightIterator weight_first) |
| Weighted standard deviation. | |
| template<typename Iterator , typename WeightIterator , typename Projection > | |
| double | statcpp::weighted_stddev (Iterator first, Iterator last, WeightIterator weight_first, WeightIterator weight_last, Projection proj) |
| Weighted standard deviation (projection version) | |
| template<typename Iterator , typename WeightIterator , typename Projection > | |
| double | statcpp::weighted_stddev (Iterator first, Iterator last, WeightIterator weight_first, Projection proj) |
| Weighted standard deviation (projection version) | |
| template<typename Iterator > | |
| double | statcpp::geometric_stddev (Iterator first, Iterator last) |
| Geometric standard deviation. | |
| template<typename Iterator , typename Projection > | |
| double | statcpp::geometric_stddev (Iterator first, Iterator last, Projection proj) |
| Geometric standard deviation (projection version) | |
Dispersion and variance calculation functions.
Provides functions for measuring data spread, including variance, standard deviation, range, and interquartile range. Uses iterator-based interface compatible with various containers.
Definition in file dispersion_spread.hpp.