Hi, You have some problems with your setup. You set N based on the number of rows in ts, but then in the call to approx_entropy you write ts[,i]. Note that ts[,i] is the i'th column of ts, whereas your definition of i implies it is based on row numbers.
Maybe this is leading you to see problems elsewhere. From the rollapply documentation I don't see any reason why it would not work with the approx_entropy function. Best, Eric On Fri, Nov 2, 2018 at 11:16 AM Subhamitra Patra <subhamitra.pa...@gmail.com> wrote: > 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. > > -- > *Best Regards,* > *Subhamitra Patra* > *Phd. Research Scholar* > *Department of Humanities and Social Sciences* > *Indian Institute of Technology, Kharagpur* > *INDIA* > > > [image: Mailtrack] > < > https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5& > > > Sender > notified by > Mailtrack > < > https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5& > > > 11/02/18, > 2:44:12 PM > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.