Skip to main content
. 2021 Oct 6;23(10):1309. doi: 10.3390/e23101309
Algorithm 4: PE [34]
Input: The time series x, the embedding dimension m.
Output: PE (x, m).
Define:πmk is the k-th permutation of πm, time delay τ = 1.
1: function PE (x, m)
2:  PE0
3:  Nlength (x)
4:   c0m!
5:   p0m!
6:   πm0,1,,m1
7:   Πmπm,πm1,,πmm!1
8:  for j = 0j= Nm do
9:    xjmxj,xj+1,,xj+m1
10:    sortxjm,πmyjm,πjm
11:   for i = 0i = m!1 do
12:   if πjm==Πim then
13:     ci=ci+1
14:   break
15:   end for
16:  end for
17: for k = 0k = m!1 do
18:     pkckNm1
19:   if pk>0 then
20:     PE=PE+pklog2pk
21:   end if
22:  end for
23:  return PE
24: end function