Pattern Matching
4 algorithms in Geometric Chart Patterns.
In this family#
-
Normalized Template Matching contract
Slides a template over a series and finds the window whose shape is closest to it. Both the template and every candidate window are z-normalized with the population standard deviation first, so the match is on shape alone and is blind to level and scale.
match(series, template) -
Dynamic-Time-Warping Pattern Match contract
Measures how far a query is from a candidate under dynamic time warping, which lets the two series stretch against each other in time instead of comparing them bar for bar. It returns the distance together with the warping path and the full cost matrix that produced it.
match(query, candidate, radius, normalize) -
Matrix-Profile Motif Discovery contract
Computes the matrix profile of a series for a given subsequence length - for each window, the distance to its nearest non-overlapping neighbour - and reports the closest pair, the motif. Every subsequence is z-normalized first, so repeated shapes are found regardless of level.
discover(series, window, exclusionZone) -
Shapelet Pattern Classifier contract
Labels a series by how closely its best-matching window resembles a shapelet. It slides the z-normalized shapelet across the series, takes the smallest Euclidean distance, and turns that into a class by comparing it against a threshold.
classify(series, shapelet, threshold, belowLabel)
What they share#
Every topic here is a record-transform</code> or <code>row-classify, so once you have
called one the rest follow the same shape. Import paths differ only in the final segment:
import { match } from "fintech-algorithms/geometric-chart-patterns/pattern-matching/normalized-template-matching";
import { match } from "fintech-algorithms/geometric-chart-patterns/pattern-matching/dynamic-time-warping-pattern-match";Read them in the order above — the sequence is pedagogical, not alphabetical.
Where this sits#
Geometric Chart Patterns collects 64 algorithms across 7 families. For the concept behind this family rather than the call signatures, see the concept guides.