Learn R Programming

diagis (version 0.2.3)

running_var: Running variance of a vector

Description

Computes running variance of a vector, returning the values from each step.

Usage

running_var(x, method = c("moment", "unbiased"), na.rm = FALSE)

Value

A vector containing the recursive variance estimates.

Arguments

x

A numeric vector or object that can be coerced to such.

method

Estimator type, either "moment" (default) or "unbiased", which is unbiased only in case of frequency weights.

na.rm

If TRUE, NA values in x are omitted from the computation. Default is FALSE.