Namespace stats¶
Public Functions¶
| Type | Name |
|---|---|
| double | mean (const std::vector< T > & x) |
| double | median (const std::vector< T > & x) |
| double | quantile (std::vector< T > x, double q) |
| double | sd (const std::vector< T > & x) |
| double | variance (const std::vector< T > & x) |
Public Functions Documentation¶
function mean¶
Mean of x, accumulated in double (NaN if empty).
function median¶
Median of x (NaN if empty).
function quantile¶
Quantile q in [0, 1] of x, interpolating linearly between the order statistics (R's type 7). NaN if x is empty. The vector is taken by value and sorted.
function sd¶
Sample standard deviation of x.
function variance¶
Sample variance of x, with the n - 1 denominator (NaN if n < 2).
The documentation for this class was generated from the following file include/stats/stats.hpp