Piecewise Linear Time-Series Representation for Anomaly Detection
Summary
This article explains bidirectional piecewise linear representation (BPLR), a way to compress a time series into line segments while retaining its broad shape. For anomaly detection, the described method divides cyclic data into non-overlapping subsequences, identifies trend turning points, ranks them by deviation from the subsequence mean, and expands segments around important turning points subject to a maximum deviation threshold. It compares subsequences using a piecewise integration similarity measure, then flags those whose aggregate distance from other subsequences is unusual.
The article also describes a partial MQL5 and OpenCL implementation that adapts piecewise linear segmentation for representing financial series. It explicitly sets aside anomaly detection for markets, reasoning that disjoint financial subsequences can naturally differ, and instead explores dynamic segment lengths as a compact input representation for modeling. Experiments are reported as indicating potential, with examples of predicted price and indicator trajectories described as directionally aligned but imperfect. The method assumes useful cyclic structure for its anomaly-detection setup, and the article does not establish robust out-of-sample or trading profitability evidence.
Key ideas
- BPLR compresses a time series into segments whose lengths adapt to the observed shape.
- Trend turning points are selected and expanded into segments under a deviation threshold.
- A piecewise integration distance compares subsequences, and aggregate distance is used to identify unusual ones.
- The anomaly-detection method assumes a cycle length that can be estimated or known in advance.
- The financial application explores representation for modeling rather than claiming a validated anomaly detector or profitable strategy.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.