ma {forecast}R Documentation

Moving-average smoothing

Description

Computes a simple moving average smoother.

Usage

ma(x, order, centre=TRUE)

Arguments

x

Univariate time series

order

Order of moving average smoother

centre

If TRUE, then the moving average is centred.

Value

Numerical time series object containing the smoothed values.

Author(s)

Rob J Hyndman

See Also

ksmooth, decompose

Examples

plot(wineind)
sm <- ma(wineind,order=12)
lines(sm,col="red")

[Package forecast version 3.24 Index]