Applies a convolution filter to a univariate time series.
cfilter(x, filter, sides, circular)
A column vector
of length T
A column vector
of length f
An int
that takes either 1:for using past values only or 2: filter coefficients are centered around lag 0.
A bool
that indicates if the filter should be wrapped around the ends of the time series.
A column vec
that contains the results of the filtering process.
This is a port of the cfilter function harnessed by the filter function in stats. It is about 5-7 times faster than R's base function. The benchmark was done on iMac Late 2013 using vecLib as the BLAS.