Template Function beluga::estimate(Scalars&&, Weights&&)
Defined in File estimation.hpp
Function Documentation
-
template<class Scalars, class Weights, class Scalar = ranges::range_value_t<Scalars>, typename = std::enable_if_t<std::is_arithmetic_v<Scalar>>>
std::pair<Scalar, Scalar> beluga::estimate(Scalars &&scalars, Weights &&weights) Computes mean and variance of a range of weighted scalars.
Given a range of scalars, computes the scalar mean and variance.
- Template Parameters:
Scalars – A sized range type whose value type is
std::vector<Scalar>
.Weights – A sized range type whose value type is
Scalar
.Scalar – The scalar value type of the given range of Scalars.
- Parameters:
scalars – Range of scalars.
weights – Range of weights.
- Returns:
The estimated mean and variance.