cmav {tsutils}R Documentation

Centred moving average

Description

Calculate the Centred Moving Average (CMA) for time series.

Usage

cmav(
  y,
  ma = NULL,
  fill = c(TRUE, FALSE),
  outplot = c(FALSE, TRUE),
  fast = c(TRUE, FALSE)
)

Arguments

y

input time series. Can be ts or msts object.

ma

length of centred moving average. If y is a ts object then the default is its frequency. If it is a msts object the default is the maximum frequency.

fill

if TRUE, then fill first and last ma/2 observations using exponential smoothing.

outplot

if TRUE, then output a plot of the time series and the moving average.

fast

if TRUE, then only a limited set of models are evaluated for CMA extrapolation.

Value

Centred moving average. If y is a ts object, then cma has the same properties.

Author(s)

Nikolaos Kourentzes, nikolaos@kourentzes.com.

References

Ord K., Fildes R., Kourentzes N. (2017) Principles of Business Forecasting, 2e. Wessex Press Publishing Co., p.109.

Examples

cmav(referrals,outplot=TRUE)


[Package tsutils version 0.9.4 Index]