Computes running weighted variance of a vector, returning the values from each step.
running_weighted_var(x, w, method = c("moment", "unbiased"), na.rm = FALSE)
A vector containing the recursive weighted variance estimates.
A numeric vector or object that can be coerced to such.
A numeric vector of non-negative weights. Will be automatically normalised to sum to one.
Estimator type, either "moment"
(default) or
"unbiased"
, which is unbiased only in case of frequency weights.
If TRUE
, NA
values in x
(and corresponding weights in w
) are
omitted from the computation. Default is FALSE
.