Skip to main content
. 2024 Jan 31;10:e1851. doi: 10.7717/peerj-cs.1851

Algorithm 1. Relative entropy based periodicity detection algorithm.

Input: a binary mobility intention sequence X, Maximal potential period Tmax
Output: the true period T0 of X
1:  T0=2, RH=0,T=2
2: while TTmax do
3:   compute Si(T) as Eq. (6)
4:   compute pi(T) as Eq. (7)
5:   compute KL(T) as Eq. (10)
6:   if RH<KL(T) then
7:      RH=KL(T)
8:      T0=T
9:   end if
10: end while
11: return T0