mstomp: Multivariate STOMP algorithm Parallel version

View source: R/mstomp.R

mstomp_parR Documentation

Multivariate STOMP algorithm Parallel version

Description

Computes the Matrix Profile and Profile Index for Multivariate Time Series.

Usage

mstomp_par(
  data,
  window_size,
  exclusion_zone = getOption("tsmp.exclusion_zone", 1/2),
  verbose = getOption("tsmp.verbose", 2),
  must_dim = NULL,
  exc_dim = NULL,
  n_workers = 2
)

mstomp(
  data,
  window_size,
  exclusion_zone = getOption("tsmp.exclusion_zone", 1/2),
  verbose = getOption("tsmp.verbose", 2),
  must_dim = NULL,
  exc_dim = NULL
)

Arguments

data

a matrix of numeric, where each column is a time series. Accepts vector (see details), list and data.frame too.

window_size

an int with the size of the sliding window.

exclusion_zone

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

verbose

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

must_dim

an int or vector of which dimensions to forcibly include (default is NULL).

exc_dim

an int or vector of which dimensions to exclude (default is NULL).

n_workers

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

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 MSTOMP computes the Matrix Profile and Profile Index for Multivariate Time Series that is meaningful for multidimensional MOTIF discovery. It uses the STOMP algorithm that is faster than STAMP but lacks its anytime property.

Although this functions handles Multivariate Time Series, it can also be used to handle Univariate Time Series. 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.

Value

Returns a MultiMatrixProfile 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, number of dimensions n_dim, exclusion zone ez, must dimensions must and excluded dimensions exc.

If the input has only one dimension, returns the same as stomp().

Functions

  • mstomp_par(): Parallel version.

  • mstomp(): Single thread version.

References

  • Yeh CM, Kavantzas N, Keogh E. Matrix Profile VI : Meaningful Multidimensional Motif Discovery.

  • 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: https://sites.google.com/view/mstamp/

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

See Also

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

Examples

# using all dimensions
mp <- mstomp(mp_toy_data$data[1:150, ], 30, verbose = 0)

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

# force using dimensions 1 and 2
mp <- mstomp(mp_toy_data$data[1:200, ], 30, must_dim = c(1, 2))
# exclude dimensions 2 and 3
mp2 <- mstomp(mp_toy_data$data[1:200, ], 30, exc_dim = c(2, 3))



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