Faster alternative to function 'rollapply'
问题 I need to run rolling window function on a xts data which contains about 7,000 rows and 11,000 columns. I did the following: require(PerformanceAnalytics) ssd60<-rollapply(wddxts,width=60,FUN=function(x) SemiDeviation(x),by.column=TRUE) I waited till 12 hours but the computation did not finish. However, when I tried with small dataset as follows: sample<-wddxts[,1:5] ssd60<-rollapply(sample,width=60,FUN=function(x) SemiDeviation(x),by.column=TRUE) the computation was done within 60 seconds. I