To split two time series into intersecting windows of length 10, you can use the slider
package in R. Here's an example of how to do it:
580 chars24 lines
Next, to find the 5 closest neighbors for one time series from the other time series, you can use the dist()
function in R to calculate the distance between each window of the two time series. Here's an example of how to do it:
374 chars15 lines
This will give you a data frame with the intersecting windows of the two time series, along with the 5 closest neighbors in the other time series for each window.
gistlibby LogSnag