Skip to main content
QUICK REVIEW

[Paper Review] Efficient Matrix Profile Computation Using Different Distance Functions

Reza Akbarinia, Bertrand Cloez|arXiv (Cornell University)|Jan 17, 2019
Time Series Analysis and ForecastingComputer Science10 references6 citations
TL;DR

This paper proposes AAMP and ACAMP, efficient exact algorithms for computing matrix profiles using pure Euclidean and z-normalized Euclidean distances, respectively, leveraging incremental distance computation to achieve significant speedups. AAMP is up to several times faster than SCRIMP++ for non-normalized distances, while ACAMP outperforms SCRIMP++ by over 50% on z-normalized Euclidean distance, enabling faster motif and discord discovery across diverse time series datasets.

ABSTRACT

Matrix profile has been recently proposed as a promising technique to the problem of all-pairs-similarity search on time series. Efficient algorithms have been proposed for computing it, e.g., STAMP, STOMP and SCRIMP++. All these algorithms use the z-normalized Euclidean distance to measure the distance between subsequences. However, as we observed, for some datasets other Euclidean measurements are more useful for knowledge discovery from time series. In this paper, we propose efficient algorithms for computing matrix profile for a general class of Euclidean distances. We first propose a simple but efficient algorithm called AAMP for computing matrix profile with the "pure" (non-normalized) Euclidean distance. Then, we extend our algorithm for the p-norm distance. We also propose an algorithm, called ACAMP, that uses the same principle as AAMP, but for the case of z-normalized Euclidean distance. We implemented our algorithms, and evaluated their performance through experimentation. The experiments show excellent performance results. For example, they show that AAMP is very efficient for computing matrix profile for non-normalized Euclidean distances. The results also show that the ACAMP algorithm is significantly faster than SCRIMP++ (the state of the art matrix profile algorithm) for the case of z-normalized Euclidean distance.

Motivation & Objective

  • Address the limitation of existing matrix profile algorithms that rely exclusively on z-normalized Euclidean distance, which fails on subsequences with zero standard deviation.
  • Enable efficient computation of matrix profiles using a broader class of Euclidean distances, including pure (non-normalized) and p-norm distances, to improve knowledge discovery in diverse time series.
  • Develop algorithms that are exact, anytime, incrementally maintainable, and deterministic, with execution time dependent only on input size and subsequence length.
  • Outperform the state-of-the-art SCRIMP++ algorithm in terms of execution time for both non-normalized and z-normalized Euclidean distance computations.

Proposed method

  • Propose AAMP, an incremental algorithm that computes the pure Euclidean distance between subsequences using a sliding window and maintains running sums to avoid recomputation.
  • Extend AAMP to handle p-norm distances by generalizing the incremental distance formula to any p ≥ 1, preserving efficiency.
  • Design ACAMP using the same incremental principle as AAMP but adapted for z-normalized Euclidean distance, avoiding costly FFT computations used in SCRIMP++.
  • Maintain auxiliary variables (sum, sum of squares) in a sliding window to compute z-normalized distances incrementally, reducing redundant calculations.
  • Ensure algorithms are exact and anytime by computing the full matrix profile in a single pass with deterministic time complexity.
  • Implement and evaluate the algorithms using real-world time series data, comparing execution times against SCRIMP++ across varying time series and subsequence lengths.

Experimental results

Research questions

  • RQ1Can an efficient, exact algorithm be designed for computing matrix profiles using pure (non-normalized) Euclidean distance?
  • RQ2Can the incremental computation technique used in AAMP be generalized to support p-norm distances?
  • RQ3Can an efficient algorithm be developed for z-normalized Euclidean distance that avoids FFT and outperforms SCRIMP++?
  • RQ4How do the proposed algorithms perform in comparison to SCRIMP++ across different time series lengths and subsequence lengths?
  • RQ5Does using alternative distance functions (e.g., pure Euclidean) yield better anomaly detection or motif discovery than z-normalized Euclidean in real datasets?

Key findings

  • AAMP achieves significantly lower execution time than SCRIMP++ for computing matrix profiles using pure Euclidean distance, with performance gains increasing as time series length grows.
  • ACAMP outperforms SCRIMP++ by a factor of more than 50% on average for z-normalized Euclidean distance computation, demonstrating superior efficiency.
  • The execution time of AAMP and ACAMP scales linearly with time series length, and both algorithms become more efficient as subsequence length increases, approaching O(n) complexity when m is close to n.
  • The proposed algorithms maintain exactness and incremental maintainability, with deterministic execution times that depend only on input size and subsequence length.
  • Experiments show that pure Euclidean distance can preserve critical anomalies (e.g., around position 500 in Figure 1) that are lost when using z-normalized distance, validating the need for alternative distance functions.
  • The performance advantage of AAMP and ACAMP is most pronounced on large datasets, with the gap between their execution time and that of SCRIMP++ widening as n increases.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.