smoothra {lazy.tools}R Documentation

Running Average Smooth

Description

Running Average Smooth

Usage

smoothra(x, bandwid = 3, maxiter = 1)

Arguments

x

a univariate time series.

bandwid

# of the neighbouring elements to be averaged. Must be a positive odd number.

maxiter

# of repetitions.

Details

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.

Value

a vector of the same length as x.

Examples

x <- c(4, 1, 3, 6, 6, 4, 1, 6, 2, 4, 2)
y <- smoothra( x, bandwid=3, 2 )
Print(x,y)


[Package lazy.tools version 0.1.3 Index]