| Algorithm 3. Overlap Algorithm. To transform a finite time series of elements into a sequence of non-negative integers representing the ordinal patterns of the time series, select a pattern order and time lag . Then, proceed as follows. |
| 1 function encode_sequence 2 input 3 with and 4 m with m 5 with 6 output 7 with and 8 locals 9 with and 10 begin 11 for all and all 12 13 /* Obtain initial right inversion counts */ 14 for to τ do 15 for to do 16 for to do 17 18 end 19 end 20 end 21 22 /* Extract and encode ordinal patterns */ 23 24 for to do 25 for to do 26 27 28 end 29 /* Increment circular buffer index */ 30 end 31 end. |