forecast (version 3.21)

ma: 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.

See Also

ksmooth, decompose

Examples

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

Run the code above in your browser using DataCamp Workspace