Skip to main content
. Author manuscript; available in PMC: 2017 Jun 1.
Published in final edited form as: Pervasive Mob Comput. 2016 Jun;28:51–68. doi: 10.1016/j.pmcj.2015.09.007

Algorithm 2.

Empirical Distribution(Σ1, Σ2, NP)

1: // Build empirical distribution Dîst of the test statistic.
2: Σ1, Σ2 = two sets of activity curves
3: Np = number of permutations
4: initialize Dîst as Np × m matrix m is # activity distributions in the activity curves
5: initialize i = 0
6: while i < Np do :
7:   Shuffle the activity curves.
8:   Generate aggregated activity curves CΣ1 and CΣ2 by aggregating the distributions in Σ1, Σ2
9:   Using the time interval-based alignment technique, align the two aggregated activity curves to obtain an alignment vector Γ
10:   for all alignment pairs (u, u) in Γ do :
11:     Find a distance SDKL(D1,uD2,u) between uth activity distributions in two activity curves.
12:     Insert SDKL (D1,uD2,u) to empirical distribution Dîst at location [i, u].
13:   end for
14:   i = i+1
15: end while
16: return Dîst