RunningSd: Fast Running Standard Deviation Computation

Description Usage Arguments Details Value Examples

View source: R/core_func.R

Description

Computes running sample standard deviation of a time-series x in a fixed length window.

Usage

1
RunningSd(x, W, circular = FALSE)

Arguments

x

A numeric vector.

W

A numeric scalar; length of x window over which sample variance is computed.

circular

Logical; whether running sample standard deviation is computed assuming circular nature of x time-series (see Details).

Details

The length of output vector equals the length of x vector. Parameter circular determines whether x time-series is assumed to have a circular nature. Assume l_x is the length of time-series x, W is a fixed length of x time-series window.

If circular equals TRUE then

If circular equals FALSE then

See runstats.demo(func.name = "RunningSd") for a detailed presentation.

Value

A numeric vector.

Examples

1
2
3
x <- rnorm(10)
RunningSd(x, 3, circular = FALSE)
RunningSd(x, 3, circular = FALSE)

runstats documentation built on Jan. 11, 2020, 9:17 a.m.