rolling_sd_3: Calculate Standard Deviation Over a Rolling Window of 3

View source: R/utils.R

rolling_sd_3R Documentation

Calculate Standard Deviation Over a Rolling Window of 3

Description

This function is called within the third filter, and used to calculate a rolling standard deviation with a window including the 2 leading values.

Usage

rolling_sd_3(x)

Arguments

x

an indexed position of a value in a vector for which the rolling standard deviation is needed

Value

the standard deviation of x, and the two leading values

Examples

# Calculate rolling Standard Deviation
set.seed(1234)
x <- rnorm(n = 100, mean = 10, sd = 1)
rolling_sd_3(x)

filteRjsats documentation built on April 10, 2023, 5:07 p.m.