R/fsDistance.R

Defines functions fsDistance

fsDistance <- function(mts, max.lag, shortest, step=1) {
  n <- ncol(mts)
  lagMatrix <- round(shortest / step)
  lagMatrix[is.infinite(lagMatrix)]<-0
  res<-data.frame()
  for (i in 1:max.lag){
    res<-rbind(res,ifelse(lagMatrix==i,1,0))
  }
  res <- fsNames(as.matrix(res), mts, max.lag)
  return (res)
}

Try the fsMTS package in your browser

Any scripts or data that you put into this service are public.

fsMTS documentation built on March 25, 2020, 5:12 p.m.