## Matrix Profiles Are Cool ... and I've been interested in them going on a year now. The mathematics involved are deceptively simple, relying only on a z-normalized euclidean distance comparison between Fourier transformed subsequences. After wrapping my head around that primitive I dove into [the literature][1]. Much of the early academic literature regarding the MP is devoted to speeding up the calculation of Fourier transformations on a sliding window of subsequences and other novel improvements and shortcuts in the mathematics. This repository is a collection of code relating to the [stumpy tutorial][2]. Some of it is simply copied in as I follow along, I have tried to mark as clearly as possible where I make my own extrapolations. All data related to the tutorial is also mirrored in a data directory for each entry. ## 1 - STUMPY Basics Above what was seen in the tutorial I started on a general purpose motif function which takes the dataset and a computed matrix profile and returns possibly multiple motif groups. It takes 2 threshold parameters, one for the absolute value of the matrix profile at the given point and the other for a percentage of the maximum data magnitude. ### TODO I remember reading somewhere about an upper bound on matrix profile values. I should find that again and calculate a percentage of the upper bound rather than having mp_thresh be an absolute value. The Motifs class and function should be broken off into their own module for re-use elsewhere, including Jupyter. [1]: https://www.cs.ucr.edu/%7Eeamonn/MatrixProfile.html "Resources and papers on the Matrix Profile" [2]: https://stumpy.readthedocs.io/en/latest/tutorials.html "stumpy tutorial"