Skip to contents

Finds the subsequence whose distance to its nearest non-self-match is largest – the discord of Keogh, Lin and Fu (2005). The ordering heuristic of their Table 2 makes the search fast without changing the answer: it is exact, not approximate, because the early abandon only discards candidates that provably cannot win.

Usage

morie_hot(x, window, alphabet = 3L, word_length = NULL)

Arguments

x

Numeric series.

window

Subsequence length; needs \(2 <= window <= length(x)/2\).

alphabet

SAX alphabet size for the ordering heuristic, default 3.

word_length

SAX word length; NULL (default) picks the largest of 3 then 2 that divides window, else 1.

Value

A list with location (1-based start of the discord), distance, neighbor (1-based start of its nearest neighbour), window, estimate, n, method.

References

Keogh, E., Lin, J. and Fu, A. (2005). HOT SAX: efficiently finding the most unusual time series subsequence. ICDM 2005, 226-233.

Examples

morie_hot(x = c(1, 2, 3, 4, 5, 6, 7, 8), window = 3L)
#> $location
#> [1] 1
#> 
#> $distance
#> [1] 0
#> 
#> $neighbor
#> [1] 4
#> 
#> $window
#> [1] 3
#> 
#> $estimate
#> [1] 1
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "HOT SAX discord (Keogh-Lin-Fu 2005)"
#>