| Algorithm 2. Plain Algorithm. To transform a finite time series of elements from a totally ordered set X into a sequence of non-negative integers , select a pattern order and a time lag , and proceed according to the pseudocode below. The value then uniquely identifies the ordinal pattern of order m, which is extracted from the time series at time index t using the time lag . The function encode_pattern is specified in Algorithm 1. |
| 1 function encode_sequence 2 input 3 m with m 4 with 5 with and 6 output 7 with and 8 begin 9 for to do 10 encode_pattern 11 end 12 end. |