stamp: Scalable Time series Anytime Matrix Profile (stamp)

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Calculates a matrix profile of given data using STAMP algorithm.

Usage

1
stamp(q, t, by = 10, isPlot = FALSE)

Arguments

q

A query data for dot product.

t

A timeseries data for analysis.

by

A parameter that indicates the progress of the process in the process of calculating the matrix profile. For example, if by is 10, the text is displayed in the console window every 10 percent.

isPlot

A parameter that determines whether or not to draw a plot in the middle of calculating a matrix profile. The default value is FALSE.

Details

The matrix profile is calculated by the self join method using the STAMP algorithm. One of the key features of the STAMP algorithm is the attribute anytime. In other words, because the matrix profile is computed rather than randomly, the computation speed is the same, but it is quickly optimized.

Value

An object of class stamp.models.

MP

A matrix profile computed by given data.

MPI

A matrix profile index computed by given data.

MTI

A motif index of matrix profile. Unlike in the original paper, it denotes the pair of motif index with the smallest value of matrix profile.

Note

This package is an early version and will be updated in the neae future. Also note that it is very slow for data with more than 10,000 data points. Since it is not optimized basic functions(e.g. movmean, movstd) for computation and is due to R's own limitations.

Author(s)

Donghwan Kim
ainsuotain@hanmail.net donhkim9714@korea.ac.kr dhkim2@bistel.com

References

Yeh, C. C. M., Zhu, Y., Ulanova, L., Begum, N., Ding, Y., Dau, H. A., ... & Keogh, E. (2016) <DOI:10.1109/ICDM.2016.0179>. 2016 IEEE 16th International Conference on Data Mining (ICDM), Barcelona, 2016, pp. 1317-1322.
http://www.cs.ucr.edu/~eamonn/MatrixProfile.html

See Also

mass (in package matrixProfile)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# data input
dt = AirPassengers
dt = as.vector(dt)

# generates matrix profile
stamp <- stamp(q = dt[1:12], t = dt[-c(1:12)])

# plotting
par(mfrow = c(2,1))
plot(dt, type = "l", main = "Original Timeseries")
plot(stamp$MP, type = "l", main = "Matrix Profile", xlim = c(0, length(dt)))

Example output

Loading required package: TTR
Loading required package: zoo

Attaching package:zooThe following objects are masked frompackage:base:

    as.Date, as.Date.numeric

Loading required package: fftw
Loading required package: signal

Attaching package:signalThe following objects are masked frompackage:stats:

    filter, poly

0 % completed 
10 % completed 
20 % completed 
30 % completed 
40 % completed 
50 % completed 
60 % completed 
70 % completed 
80 % completed 
90 % completed 
100% comleted

matrixProfile documentation built on May 2, 2019, 9:43 a.m.