Learn R Programming

jmotif (version 1.3.2)

find_discords_hotsax: Finds a discord (i.e. time series anomaly) with HOT-SAX. Usually works the best with lower sizes of discretization parameters: PAA and Alphabet.

Description

Finds a discord (i.e. time series anomaly) with HOT-SAX. Usually works the best with lower sizes of discretization parameters: PAA and Alphabet.

Usage

find_discords_hotsax(
  ts,
  w_size,
  paa_size,
  a_size,
  n_threshold,
  discords_num,
  seed = -1L
)

Arguments

ts

the input timeseries.

w_size

the sliding window size.

paa_size

the PAA size.

a_size

the alphabet size.

n_threshold

the normalization threshold.

discords_num

the number of discords to report.

seed

the random seed for the random-search visit order; a negative value (the default) leaves it non-reproducible, a non-negative value makes the search trajectory (and its distance-call count) reproducible. The reported discords are identical either way.

References

Keogh, E., Lin, J., Fu, A., HOT SAX: Efficiently finding the most unusual time series subsequence. Proceeding ICDM '05 Proceedings of the Fifth IEEE International Conference on Data Mining

Examples

Run this code
discords = find_discords_hotsax(ecg0606, 100, 3, 3, 0.01, 1)
plot(ecg0606, type = "l", col = "cornflowerblue", main = "ECG 0606")
lines(x=c(discords[1,2]:(discords[1,2]+100)),
   y=ecg0606[discords[1,2]:(discords[1,2]+100)], col="red")

Run the code above in your browser using DataLab