vstat
Loading...
Searching...
No Matches
Univariate statistics

Functions

template<std::floating_point T, stats Stats = stats::variance, std::random_access_iterator I, typename F = std::identity>
requires concepts::arithmetic_projection<F, std::iter_value_t<I>>
auto accumulate (I first, I last, F &&f=F {}) noexcept -> univariate_statistics
 
template<std::floating_point T, stats Stats = stats::variance, std::random_access_iterator I, std::random_access_iterator J, typename F = std::identity>
requires concepts::arithmetic_projection<F, std::iter_value_t<I>>
and std::is_arithmetic_v< std::iter_value_t< J > > auto accumulate (I first1, I last1, J first2, F &&f=F {}) noexcept -> univariate_statistics
 
template<std::floating_point T, stats Stats = stats::variance, nan_policy Policy = nan_policy::propagate, std::random_access_iterator I, std::random_access_iterator J, typename BinaryOp , typename F1 = std::identity, typename F2 = std::identity>
requires std::is_invocable_v<F1, std::iter_value_t<I>>
and std::is_invocable_v< F2, std::iter_value_t< J > > and std::is_invocable_v< BinaryOp, std::invoke_result_t< F1, std::iter_value_t< I > >, std::invoke_result_t< F2, std::iter_value_t< J > > > and concepts::arithmetic_projection< BinaryOp, std::invoke_result_t< F1, std::iter_value_t< I > >, std::invoke_result_t< F2, std::iter_value_t< J > > > auto accumulate (I first1, I last1, J first2, BinaryOp &&op=BinaryOp {}, F1 &&f1=F1 {}, F2 &&f2=F2 {}) noexcept -> std::conditional_t< Policy==nan_policy::omit, std::pair< univariate_statistics, std::size_t >, univariate_statistics >
 
template<std::floating_point T, stats Stats = stats::variance, nan_policy Policy = nan_policy::propagate, std::random_access_iterator I, std::random_access_iterator J, std::random_access_iterator K, typename BinaryOp , typename F1 = std::identity, typename F2 = std::identity>
requires std::is_arithmetic_v<std::iter_value_t<K>> && std::is_invocable_v<F1, std::iter_value_t<I>> && std::is_invocable_v<F2, std::iter_value_t<J>> && std::is_invocable_v<BinaryOp, std::invoke_result_t<F1, std::iter_value_t<I>>, std::invoke_result_t<F2, std::iter_value_t<J>>> && concepts::arithmetic_projection<BinaryOp, std::invoke_result_t<F1, std::iter_value_t<I>>, std::invoke_result_t<F2, std::iter_value_t<J>>>
auto accumulate (I first1, I last1, J first2, K first3, BinaryOp &&op=BinaryOp {}, F1 &&f1=F1 {}, F2 &&f2=F2 {}) noexcept -> std::conditional_t< Policy==nan_policy::omit, std::pair< univariate_statistics, std::size_t >, univariate_statistics >
 

Detailed Description

Methods for univariate statistics.

Function Documentation

◆ accumulate() [1/4]

template<std::floating_point T, stats Stats = stats::variance, std::random_access_iterator I, typename F = std::identity>
requires concepts::arithmetic_projection<F, std::iter_value_t<I>>
auto accumulate ( first,
last,
F &&  f = F {} 
) -> univariate_statistics
inlinenoexcept

Accumulates a sequence of (projected) values.

Template Parameters
TThe scalar value type underlying the eve::wide<T> SIMD type used to compute the stats.
Parameters
firstThe begin iterator for the first sequence
lastThe end iterator for the first sequence
fA projection mapping std::iter_value_t<I> to a scalar value

◆ accumulate() [2/4]

template<std::floating_point T, stats Stats = stats::variance, nan_policy Policy = nan_policy::propagate, std::random_access_iterator I, std::random_access_iterator J, typename BinaryOp , typename F1 = std::identity, typename F2 = std::identity>
requires std::is_invocable_v<F1, std::iter_value_t<I>>
and std::is_invocable_v< F2, std::iter_value_t< J > > and std::is_invocable_v< BinaryOp, std::invoke_result_t< F1, std::iter_value_t< I > >, std::invoke_result_t< F2, std::iter_value_t< J > > > and concepts::arithmetic_projection< BinaryOp, std::invoke_result_t< F1, std::iter_value_t< I > >, std::invoke_result_t< F2, std::iter_value_t< J > > > auto accumulate ( first1,
last1,
first2,
BinaryOp &&  op = BinaryOp {},
F1 &&  f1 = F1 {},
F2 &&  f2 = F2 {} 
) -> std::conditional_t<Policy == nan_policy::omit, std::pair<univariate_statistics, std::size_t>, univariate_statistics>
inlinenoexcept

Accumulates over the projected values from applying BinaryOp on the input sequences.

Template Parameters
TThe scalar value type underlying the eve::wide<T> SIMD type used to compute the stats
StatsWhich stats to compute
Policynan_policy::propagate (default): a non-finite projected value poisons the whole result, like the rest of this library. nan_policy::omit: positions where either raw input is non-finite are skipped (zero-weighted) instead, and the count of skipped pairs is additionally returned.
BinaryOpBinary projection \(op(a,b) \to c\)
F1Unary projection \(f(x_1) \to a\)
F2Unary projection \(f(x_2) \to b\)
Parameters
first1The begin iterator for the first sequence
last1The end iterator for the first sequence
first2The begin iterator for the second sequence
opA binary projection mapping a tuple \((f_1(\cdot), f_2(\cdot))\) to a scalar value
f1A projection mapping std::iter_value_t<I> to a scalar value
f2A projection mapping std::iter_value_t<J> to a scalar value
Returns
nan_policy::propagate: the accumulated statistics. nan_policy::omit: the accumulated statistics over finite pairs, and the count of skipped (non-finite) pairs.

◆ accumulate() [3/4]

template<std::floating_point T, stats Stats = stats::variance, std::random_access_iterator I, std::random_access_iterator J, typename F = std::identity>
requires concepts::arithmetic_projection<F, std::iter_value_t<I>>
and std::is_arithmetic_v< std::iter_value_t< J > > auto accumulate ( first1,
last1,
first2,
F &&  f = F {} 
) -> univariate_statistics
inlinenoexcept

Accumulates a sequence of (projected) values.

Template Parameters
TThe scalar value type underlying the eve::wide<T> SIMD type used to compute the stats.
Parameters
first1The begin iterator for the first sequence
last1The end iterator for the first sequence
first2The begin iterator for the second (weights) sequence
fA projection mapping std::iter_value_t<I> to a scalar value

◆ accumulate() [4/4]

template<std::floating_point T, stats Stats = stats::variance, nan_policy Policy = nan_policy::propagate, std::random_access_iterator I, std::random_access_iterator J, std::random_access_iterator K, typename BinaryOp , typename F1 = std::identity, typename F2 = std::identity>
requires std::is_arithmetic_v<std::iter_value_t<K>> && std::is_invocable_v<F1, std::iter_value_t<I>> && std::is_invocable_v<F2, std::iter_value_t<J>> && std::is_invocable_v<BinaryOp, std::invoke_result_t<F1, std::iter_value_t<I>>, std::invoke_result_t<F2, std::iter_value_t<J>>> && concepts::arithmetic_projection<BinaryOp, std::invoke_result_t<F1, std::iter_value_t<I>>, std::invoke_result_t<F2, std::iter_value_t<J>>>
auto accumulate ( first1,
last1,
first2,
first3,
BinaryOp &&  op = BinaryOp {},
F1 &&  f1 = F1 {},
F2 &&  f2 = F2 {} 
) -> std::conditional_t<Policy == nan_policy::omit, std::pair<univariate_statistics, std::size_t>, univariate_statistics>
inlinenoexcept

Weighted variant of accumulate (BinaryOp overload): folds a caller-supplied weight in, and (under nan_policy::omit) into the finite mask (‘w’ = finite ? w : 0`) instead of a flat 0/1 weight.

Parameters
first3The begin iterator for the caller-supplied weights