Start here, this one m-file, and the "how-to", is probably all you need.
DAMP (Version 2.0) : DAMP 2.0.m
Instructions for DAMP 2.0: DAMP_2.0 How To Use.pptx
Sample dataset: BourkeStreetMall.txt
The below are more advanced and experimental and will be folded into the main DAMP code in the future.
DAMP - topK : DAMP_topK.m
DAMP - fullMP : DAMP_fullMP.m
X-Lag-Amnesic DAMP: DAMP_X_Lag_Amnesic.m
Golden DAMP: DAMP_Golden.m
Multidimensional DAMP: DAMP_Multidim.m
Sample dataset : UCR_TimeSeriesAnomalyDatasets2021.zip
% FOR GOLDEN DAMP% T is the time series to be tested and golden_batch is a long vector that contains all legal patternstic; DAMP_Golden(T,golden_batch); toc;
% FOR MULTIDIM DAMP% T is an N by D matrix, where N is the length of each time series and D is the number of dimensionstic; DAMP_Multidim(T,D); toc;
How to read an aMP generated by DAMP?
The time series and its corresponding Left-aMP are shown on the left. The red curve in the figure is the time series and the blue curve is the Left-aMP.
When you search for the top-k left-discords, the k highest peaks do correctly show the location and strength (the height of the peaks) of the top-k left-discords. However, the remaining peaks in the aMP should not be assumed to indicate slightly smaller anomalies. They may indicate slightly smaller anomalies, but they also simply indicate regions that were pruned by encountering a matching subsequence that was just below the current Best-So-Far.
It is easy to see from the blue curve in the figure that there are many nearly constant regions with a slight downward trend. These regions reflect the approximate discord scores of the pruned subsequences, and the downward trend in the aMP is designed to avoid the pruned subsequence having the same discord score as the real top discords. Therefore these nearly constant regions have no practical significance and there is no need to interpret them.
NOTE: The DAMP algorithm has a parameter called CurrentIndex, corresponding to spIndex in the paper, which specifies the initial position of the split point between the training and test data. Since the training data is not involved in any computation, in a Left MP generated by DAMP, the value before CurrentIndex is hard-coded to 0.