Time-series data downsampling: LTTB & MinMaxLTTB
Background
Recently, I needed to process some time-series data at work and perform downsampling. To do this, I dug into the LTTB (Largest-Triangle-Three-Buckets) and MinMaxLTTB algorithms.
Technically speaking, time-series downsampling generally falls into two categories1:
- Characteristic Preserving: The goal is to keep statistical properties (like mean, variance, etc.) as consistent as possible before and after downsampling.
- Value Preserving: This approach selects representative data points directly from the raw dataset to preserve the overall visual shape.
Both LTTB and MinMaxLTTB are essentially value-preserving algorithms—their core objective is to retain the original trend and shape of the data after downsampling.