moving_average: Weighted moving average

View source: R/deepML.r

moving_averageR Documentation

Weighted moving average

Description

Weighted moving average

Usage

moving_average(x, n = 3L, weights = NULL)

Arguments

x

A numeric vector.

n

The order of the moving average.

weights

Optional weights.

Value

A vector with the (weighted) moving average.

See Also

Other Machine Learning: cross_validation_split(), decision_tree(), k_nearest_neighbors(), naive_bayes(), naive_forecast(), predict.decisiontree(), predict.kmeans(), predict.naivebayes()

Examples

  x <- c(855, 847, 1000, 635, 346, 2146, 1328, 1322, 3124, 1012, 1280, 2435, 1016, 3465, 1107, 1172, 3432, 836, 142, 345, 2603, 739, 716, 880, 1008, 112, 361)
  moving_average(x)
  moving_average(x, weights = c(1L, 2L, 3L))

stschn/deepANN documentation built on June 25, 2024, 7:27 a.m.