convolution of vector with matrix
Usage
convolve_matrix(x, y, remove_partial, reverse)
Arguments
- x
vector to convolve with y (numeric vector)
- y
numeric matrix to convolve with x (column by column convolution)
(numeric matrix)
- remove_partial
keep the end values or fill with NA (boolean)
- reverse
should x be reversed before convolution (boolean)
Value
numeric matrix of convolved values
Examples
a <- convolve_matrix(x = 1:100,
y = as.matrix(1:10),
remove_partial = FALSE,
reverse = TRUE)
b <- stats::convolve(1:100, rev(1:10), type = 'filter')