Skip to contents

The rolling_variance() is a generic S3 function that builds upon 'type-safe'-esque workflows limited to classes in in base R, and the package-wide dependencies. Ie. class in, class out.

Usage

rolling_variance(x, n = 10, k = 1)

Arguments

x

(double). A vector.

n

(integer). An integer of length 1.

k

multiplier

Value

A double vector with the same length of x

Author

Serkan Korkmaz

Examples

## load Bitcoin (BTC)
## series
data(BTC, package = "talib")

## calculate the indicator
## Open
output <- talib::rolling_variance(x = BTC[[1]])

## display the results
utils::tail(output)
#> [1] 14255653  9774488  3711983  2842938  3495055  4198248