Single-pass two-step C++ kernel with optional ddof correction.
Arguments
- x
numeric vector
- ddof
integer; default 1 (sample variance)
Value
A numeric scalar: the variance of x.
Examples
abs(rmorie:::morie_var(c(1, 2, 3, 4, 5), ddof = 1) - 2.5) < 1e-9
#> [1] TRUE