stamp: Anytime univariate STAMP algorithm Parallel version

View source: R/stamp.R

stamp_parR Documentation

Anytime univariate STAMP algorithm Parallel version

Description

Computes the best so far Matrix Profile and Profile Index for Univariate Time Series.

Usage

stamp_par(
  ...,
  window_size,
  exclusion_zone = getOption("tsmp.exclusion_zone", 1/2),
  verbose = getOption("tsmp.verbose", 2),
  s_size = Inf,
  n_workers = 2,
  weight = NULL
)

stamp(
  ...,
  window_size,
  exclusion_zone = getOption("tsmp.exclusion_zone", 1/2),
  verbose = getOption("tsmp.verbose", 2),
  s_size = Inf,
  weight = NULL
)

Arguments

...

a matrix or a vector. If a second time series is supplied it will be a join matrix profile.

window_size

an int. Size of the sliding window.

exclusion_zone

a numeric. Size of the exclusion zone, based on window size (default is 1/2). See details.

verbose

an int. See details. (Default is 2).

s_size

a numeric. for anytime algorithm, represents the size (in observations) the random calculation will occur (default is Inf).

n_workers

an int. Number of workers for parallel. (Default is 2).

weight

a vector of numeric or NULL with the same length of the window_size. This is a MASS extension to weight the query.

Details

The Matrix Profile, has the potential to revolutionize time series data mining because of its generality, versatility, simplicity and scalability. In particular it has implications for time series motif discovery, time series joins, shapelet discovery (classification), density estimation, semantic segmentation, visualization, rule discovery, clustering etc. The anytime STAMP computes the Matrix Profile and Profile Index in such manner that it can be stopped before its complete calculation and return the best so far results allowing ultra-fast approximate solutions. verbose changes how much information is printed by this function; 0 means nothing, 1 means text, 2 adds the progress bar, 3 adds the finish sound. exclusion_zone is used to avoid trivial matches; if a query data is provided (join similarity), this parameter is ignored.

Value

Returns a MatrixProfile object, a list with the matrix profile mp, profile index pi left and right matrix profile lmp, rmp and profile index lpi, rpi, window size w and exclusion zone ez.

Functions

  • stamp_par(): Parallel version.

  • stamp(): Single thread version.

References

  • Yeh CCM, Zhu Y, Ulanova L, Begum N, Ding Y, Dau HA, et al. Matrix profile I: All pairs similarity joins for time series: A unifying view that includes motifs, discords and shapelets. Proc - IEEE Int Conf Data Mining, ICDM. 2017;1317-22.

  • Zhu Y, Imamura M, Nikovski D, Keogh E. Matrix Profile VII: Time Series Chains: A New Primitive for Time Series Data Mining. Knowl Inf Syst. 2018 Jun 2;1-27.

Website: http://www.cs.ucr.edu/~eamonn/MatrixProfile.html

See Also

Other matrix profile computations: mstomp_par(), scrimp(), stomp_par(), tsmp(), valmod()

Examples

mp <- stamp(mp_toy_data$data[1:200, 1], window_size = 30, verbose = 0)


#' # using threads
mp <- stamp_par(mp_toy_data$data[1:200, 1], window_size = 30, verbose = 0)

ref_data <- mp_toy_data$data[, 1]
query_data <- mp_toy_data$data[, 2]
# self similarity
mp <- stamp(ref_data, window_size = 30, s_size = round(nrow(ref_data) * 0.1))
# join similarity
mp <- stamp(ref_data, query_data, window_size = 30, s_size = round(nrow(query_data) * 0.1))



tsmp documentation built on Aug. 21, 2022, 1:13 a.m.