|
|
Algorithm 3 Motif selection algorithm with prediction. |
|
|
Require:
B, the Codebook of the motifs; S(i), the segment to be compressed; d(·), a dissimilarity metric; dth, the compression distortion threshold; PM, the prediction matrix; X⌂(i−N), the previous best motif. |
| dmin ← ∞ |
|
|
| G̅ ← Q(GAIN(S(i))) |
| sort B according to the row of PM related to X̅(i−N)
|
| for all
X(k) ∈ B
do
|
| XR(k) ← X(k)G̅ + O̅
|
| if
d(S(i),XR(k)) < dminthen
|
| X̂(i) = XR (k) |
| dmin = d(S(i),XR(k)) |
| end if
|
| if
dmin ≤ dth
then
|
| Break |
| end if
|
| end for
|
| Return k
|
|