This repository contains Matrix Profile algorithms implemented in Java. It is an attempt to port algorithms presented in tsmp.
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.
This library includes the following algorithms to compute matrix profile:
Z-Normalized Euclidean Distance:
- STAMP - Anytime matrix profile algorithm
- STOMP - Scalable ordered matrix profile algorithm
- STOMPI - Incremental matrix profile algorithm
- SKIMP - Pan matrix profile algorithm
- MPX - Matrix profile algorithm not based on FFT
- MP-DIST (MASS2) - Fast distance search algorithm based on FFT
- ContrastProfile
- PanContrastProfile
- RelativeFrequencyMatrixProfile
- RelativeFrequencyContrastProfile
- FLUSS - timeseries segmentation based on matrix profile
Pure Euclidean Distance:
Additionally, this library includes extra algorithms not related to matrix profile:
- MWF - Domain agnostic window size finder
- trendSegmentR - Detection of linear trend changes for univariate time series
- TGUW - Tail-Greedy Unbalance Haar Wavelet decomposition
More algorithms will be added in the future.
All algorithms for matrix profile are built around RollingWindowStatistics object. It simply computes statistics required to run Matrix Profile algorithms on the fly, in a circular buffer manner, hence allows streaming data processing out of the box.
DoubleStream stream = ... // your data stream
var bs = 1024; // statistics buffer size
var w = 10; // window for MP algorithm
var stamp = new STAMP(w, bs);
stream.forEach(stamp::update); // it keeps statistics updated, not the matrix profile
var matrixProfile = stamp.get(); // execute MP algorithm for statistics collected
double[] data = ... // your data
var w = 10; // window for MP algorithm
var matrixProfile = STAMP.of(data, w);
Please refer to tests for more examples.