moving_average: Moving Average

View source: R/moving_average.R

moving_averageR Documentation

Moving Average

Description

This function calculates the moving average of a time series.

Usage

moving_average(timeseries, window)

Arguments

timeseries

Vector of doubles representing a timeseries.

window

Double, the time-window to average over (in timesteps).

Value

A vector of doubles (average over the window).

Author(s)

Marina Papadopoulou m.papadopoulou.rug@gmail.com

Examples

bs <- rnorm(20, mean = 10, sd = 1)
moving_average(bs, 5)


swaRmverse documentation built on Oct. 10, 2024, 5:08 p.m.