statcpp
C++17 Header-Only Statistics Library
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
frequency_distribution.hpp File Reference

Frequency distribution table creation and frequency-related calculations. More...

#include <cstddef>
#include <functional>
#include <iterator>
#include <map>
#include <type_traits>
#include <unordered_map>
#include <utility>
#include <vector>
Include dependency graph for frequency_distribution.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  statcpp::frequency_entry< T >
 Frequency table entry. More...
 
struct  statcpp::frequency_table_result< T >
 Frequency table result. More...
 

Namespaces

namespace  statcpp
 

Functions

template<typename Iterator >
auto statcpp::frequency_table (Iterator first, Iterator last) -> frequency_table_result< typename std::iterator_traits< Iterator >::value_type >
 Create frequency table (returned with sorted keys)
 
template<typename Iterator , typename Projection >
auto statcpp::frequency_table (Iterator first, Iterator last, Projection proj) -> frequency_table_result< std::invoke_result_t< Projection, typename std::iterator_traits< Iterator >::value_type > >
 Frequency table with projection.
 
template<typename Iterator >
auto statcpp::frequency_count (Iterator first, Iterator last) -> std::unordered_map< typename std::iterator_traits< Iterator >::value_type, std::size_t >
 Return frequency for each value (unordered_map version, fast)
 
template<typename Iterator , typename Projection >
auto statcpp::frequency_count (Iterator first, Iterator last, Projection proj) -> std::unordered_map< std::invoke_result_t< Projection, typename std::iterator_traits< Iterator >::value_type >, std::size_t >
 Frequency count with projection.
 
template<typename Iterator >
auto statcpp::relative_frequency (Iterator first, Iterator last) -> std::unordered_map< typename std::iterator_traits< Iterator >::value_type, double >
 Return relative frequency for each value.
 
template<typename Iterator , typename Projection >
auto statcpp::relative_frequency (Iterator first, Iterator last, Projection proj) -> std::unordered_map< std::invoke_result_t< Projection, typename std::iterator_traits< Iterator >::value_type >, double >
 Relative frequency with projection.
 
template<typename Iterator >
auto statcpp::cumulative_frequency (Iterator first, Iterator last) -> std::vector< std::pair< typename std::iterator_traits< Iterator >::value_type, std::size_t > >
 Return cumulative frequency (for sorted values)
 
template<typename Iterator , typename Projection >
auto statcpp::cumulative_frequency (Iterator first, Iterator last, Projection proj) -> std::vector< std::pair< std::invoke_result_t< Projection, typename std::iterator_traits< Iterator >::value_type >, std::size_t > >
 Cumulative frequency with projection.
 
template<typename Iterator >
auto statcpp::cumulative_relative_frequency (Iterator first, Iterator last) -> std::vector< std::pair< typename std::iterator_traits< Iterator >::value_type, double > >
 Return cumulative relative frequency (for sorted values)
 
template<typename Iterator , typename Projection >
auto statcpp::cumulative_relative_frequency (Iterator first, Iterator last, Projection proj) -> std::vector< std::pair< std::invoke_result_t< Projection, typename std::iterator_traits< Iterator >::value_type >, double > >
 Cumulative relative frequency with projection.
 

Detailed Description

Frequency distribution table creation and frequency-related calculations.

Provides functions for frequency distribution including frequency tables, relative frequency, cumulative frequency, etc. Useful for analyzing categorical and discrete data.

Definition in file frequency_distribution.hpp.