Displaying 1 result from an estimated 1 matches for "convolveslow".
2011 Feb 04
2
Avoiding two loops
Hello,
I have a R code for doing convolution of two functions:
convolveSlow <- function(x, y) {
nx <- length(x); ny <- length(y)
xy <- numeric(nx + ny - 1)
for(i in seq(length = nx)) {
xi <- x[[i]]
for(j in seq(length = ny)) {
ij <- i+j-1
xy[[ij]] <- xy[[ij]] + xi * y[[j]]
}
}
xy
}
Ho...