22 #ifndef EDSP_STATISTICAL_SKEWNESS_H 23 #define EDSP_STATISTICAL_SKEWNESS_H 26 #include <edsp/meta/iterator.hpp> 29 namespace edsp {
namespace statistics {
46 template <
typename ForwardIt>
47 constexpr meta::value_type_t<ForwardIt>
skewness(ForwardIt first, ForwardIt last) {
48 const auto m =
mean(first, last);
49 const auto m3 = moment<3>(first, last, m);
50 const auto m2 = moment<2>(first, last, m);
51 return m3 / (m2 * std::sqrt(m2));
55 #endif // EDSP_STATISTICAL_SKEWNESS_H constexpr meta::value_type_t< ForwardIt > skewness(ForwardIt first, ForwardIt last)
Computes the skewness of the range [first, last)
Definition: skewness.hpp:47
Definition: amplifier.hpp:29
constexpr meta::value_type_t< ForwardIt > mean(ForwardIt first, ForwardIt last)
Computes the average or mean value of the range [first, last)
Definition: mean.hpp:44