Convolve two time series, using a backward-looking method.
This function provides a straightforward convolution, which may be useful to
those who prefer not to use convolve()
and filter
in the
stats
package.
oceConvolve(x, f, end = 2)
a numerical vector of observations.
a numerical vector of filter coefficients.
a flag that controls how to handle the points of the x
series that have indices less than the length of f
. If end=0
,
the values are set to 0. If end=1
, the original x values are used
there. If end=2
, that fraction of the f
values that overlap
with x
are used.
A vector of the convolution output.