Skip to content
Prev 377225 / 398502 Next

Application of rolling window in entropy analysis

Dear all R users,

I want to apply the entropy methods in rolling window analysis. I tried
with the rollapply function, but it is not working. For your convenience, I
am providing my code so that you can easily suggest me the application of
rolling window in the particular methodology. Here is my code

N<-nrow(ts)
r<-matrix(0, nrow = N, ncol = 1)
for (i in 1:N){
     r[i]<-approx_entropy(ts[,i], edim = 2, r = 0.2*sd(ts[,i]), elag = 1)
}

Kindly suggest me how to apply rolling window size of 500 in the particular
time series model?

I expect positive help from you.

Thanks in advance.