Skip to main content
. Author manuscript; available in PMC: 2016 Mar 11.
Published in final edited form as: Proc ACM Int Conf Inf Knowl Manag. 2015 Oct;2015:1001–1010. doi: 10.1145/2806416.2806441

Algorithm 2 Distance-based Sampling with Adaptive Threshold Algorithm (DSAT)

Input: D = {Di|1 ≤ i ≤ N, i ∈ Z}, T, C and ε.
Output: D̃ = {D̃i|1 ≤ i ≤ N, i ∈ Z}
1: Run step 1,2,3,4 in Algorithm 1;
2: Skip the first M timestamps;
3: for each time point ti with i > M do
4:  if count ≥ C, then set D̃i = D̃j
5:  Set d∼(Di,D∼j)=d(Di,D∼j)+Lap(2CΔε1)
6:  Set Ei=|counti−CN|,ei=|Ei−δ|δ, and ui = θei;
7:  if countt−CN≤0, then set T̃i = max{0, T̃i−1 − ui}
8:  else set T̃i = min{2, T̃i−1 + ui};
9:  if d̃(Di, D̃j) ≥ T̃i then
10:   release a DP dataset D̃i at ti with ε2C budget, and set count = count + 1, j = i;
11:  else
12:   release D̃j;
13:  end if
14:  if i == N and count < C then
15:   release D̃N with all remaining privacy budget;
16:  end if
17: end for