tricubeMovingAverage: Moving Average Smoother With Tricube Weights
Description
Apply a moving average smoother with tricube distance weights to the columns of a matrix.
Usage
tricubeMovingAverage(x,span=0.5,full.length=TRUE)
Arguments
x
numeric vector
span
proportion of points included in the local window
full.length
logical value, should output have same number of length as input?
Value
Numeric vector of smoothed values.
If full.length=TRUE, of same length as x.
If full.length=FALSE, has width-1 fewer rows than x.
Details
This function smooths a vector (considered as a time series) using a moving average with tricube weights.
This is similar to a loess curve of degree zero, with a couple of differences:
a continuity correction is applied when computing the neighbouring points and, when full.length=TRUE, the span halves at the end points.
The filter function in the stats package is called to do the low-level calculations.
This function is used by barcodeplot to compute enrichment worms.