| Algorithm 4.Lookup Algorithm. To transform a finite time series into a sequence of non-negative integers representing its ordinal patterns, select a pattern order and time lag . In addition, prepare a lookup table according to Equation (21) that matches the encode_pattern function to be used. This can be the sym-function given by Equation (11), the -function of Equation (9), or any other bijective map yielding . Then, proceed as follows. |
| 1 function encode_sequence 2 input 3 with and 4 m with m 5 with 6 output 7 with and t 8 locals 9 with and i and 10 begin 11 12 13 /* Encode first τ ordinal patterns */ 14 for to τ do 15 16 end 17 18 /* Encode all remaining patterns */ 19 for to do 24 20 21 for to do 22 23 end 25 26 end 27 end. |