CRP toolbox general question regarding Window Size

General discussions and questions about recurrence plot and recurrence network related methods.
Post Reply
angelova
Junior
Posts: 1
Joined: Sat Jan 4, 2014 17:27
Affiliation (Univ., Inst., Dept.): Lafayette College
Location: Easton, PA, USA
Research field: Quantitative Finance

CRP toolbox general question regarding Window Size

Post by angelova »

Dear all,


regarding the window size in the GUI, the RQA measures calculated from the software (LAM, DET, ENTR, etc.) end before the Raw, input, Data ends, i.e. are shorter than the Raw Data. That, I explain to myself by thinking that, assuming our window size is 250, in order to calculate the first value of any RQA measure, the software needs 250 data points form Raw Data , creates a Recurrence Plot for these 250 data points and extracts the measures. Now, from all these 250 points, only 1RQA measure value is extracted, and it is assigned the date, point in time, which the last 250th data point from the RAW data corresponds to. So, the plots on the GUI should start at the point in time at which the 250th RAW data point starts, and not, as they do, start when the RAW data starts in time. Is this correct?

Furthermore, there should be a length difference (between RQA measures and RAW data) of exactly 249 (Window size - 1) data points. I ran 20k data set and it turned out that there is a 250, not 249, difference in length (between RQA measures and RAW data). Why is this so?

Thank you for your time and consideration,
AA
User avatar
Norbert
Expert
Posts: 194
Joined: Wed Jan 4, 2006 11:03
Affiliation (Univ., Inst., Dept.): Potsdam Institute for Climate Impact Research, Germany
Location: Potsdam, Germany
Location: Potsdam Institute for Climate Impact Research, Germany

Re: CRP toolbox general question regarding Window Size

Post by Norbert »

angelova wrote:regarding the window size in the GUI, the RQA measures calculated from the software (LAM, DET, ENTR, etc.) end before the Raw, input, Data ends, i.e. are shorter than the Raw Data. That, I explain to myself by thinking that, assuming our window size is 250, in order to calculate the first value of any RQA measure, the software needs 250 data points form Raw Data , creates a Recurrence Plot for these 250 data points and extracts the measures. Now, from all these 250 points, only 1RQA measure value is extracted, and it is assigned the date, point in time, which the last 250th data point from the RAW data corresponds to. So, the plots on the GUI should start at the point in time at which the 250th RAW data point starts, and not, as they do, start when the RAW data starts in time. Is this correct?
Not at all. It depends on the application and desired interpretation. Usually, the time point assigned to the window should be the mid point of the window. Some statements appear here:
N. Marwan: How to avoid potential pitfalls in recurrence plot based data analysis, International Journal of Bifurcation and Chaos, 21(4), 1003–1017 (2011). http://dx.doi.org/10.1142/S0218127411029008
angelova wrote:Furthermore, there should be a length difference (between RQA measures and RAW data) of exactly 249 (Window size - 1) data points. I ran 20k data set and it turned out that there is a 250, not 249, difference in length (between RQA measures and RAW data). Why is this so?
Yes, you are right. The very last window was missed. Incredible that more than 10 years nobody has found this bug. Thank you very much for your sharp eye!

Nevertheless, the command line output of the CRQA function will be as long as the time series was minus the length of the window plus 1. All missing values due to the window step or the embedding will be filled by zeros and have to be neglected by the approriate Matlab function, e.g.,

Code: Select all

w=100; ws=50;
Y=crqa(rand(1000,1),1,1,1,w,ws);
plot(Y(1:ws:end,2)
You should also be aware that due to embedding the number of resulting windows can be less.
Post Reply