smoothra {lazy.tools} | R Documentation |
Running Average Smooth
smoothra(x, bandwid = 3, maxiter = 1)
x |
a univariate time series. |
bandwid |
# of the neighbouring elements to be averaged. Must be a positive odd number. |
maxiter |
# of repetitions. |
The following code will be repeated maxiter times:
filter(x,rep(1/bandwid,bandwid), sides=2)
x[1:m] and x[(length(x)-m+1):length(x)] will remain unchanged.
where m=(bandwid-1)/2
.
a vector of the same length as x.
x <- c(4, 1, 3, 6, 6, 4, 1, 6, 2, 4, 2)
y <- smoothra( x, bandwid=3, 2 )
Print(x,y)