Table of Contents
Fetching ...

A General Metric-Space Formulation of the Time Warp Edit Distance (TWED)

Zhen Yi Lau

TL;DR

This work extends the Time Warp Edit Distance (TWED) to arbitrary metric spaces by formulating the General Time Warp Edit Distance (GTWED) on observations in a metric space $(\mathcal{X},d)$ and indices in a metric time domain $(\mathcal{T},\Delta)$. By introducing a local product-space cost $D(a_{t(i)}, b_{s(j)}) = d(a_{t(i)}, b_{s(j)}) + \gamma\Delta(t_i, s_j)$ and its regularized form $\tilde{D} = g(D)$, GTWED constructs a recursive, additive edit-distance-like metric with gap penalties $\lambda$ and stiffness $\gamma$, and proves that it remains a true metric under mild conditions. The paper shows TWED as a special case when $X=\mathbb{R}^d$, $T$ is a subset of $\mathbb{R}$, and $g(x)=x$, thus subsuming classical TWED; it also provides a dynamic-programming algorithm with $O(pq)$ time and space. A key contribution is enabling TWED-like elastic distances over sequences on symbolic domains, manifolds, or embeddings, broadening applicability while noting that certain $L_p$-based bounds from TWED do not generalize to GTWED.

Abstract

This short technical note presents a formal generalization of the Time Warp Edit Distance (TWED) proposed by Marteau (2009) to arbitrary metric spaces. By viewing both the observation and temporal domains as metric spaces $(X, d)$ and $(T, Δ)$, we define a Generalized TWED (GTWED) that remains a true metric under mild assumptions. We provide self-contained proofs of its metric properties and show that the classical TWED is recovered as a special case when $X = \mathbb{R}^d$, $T \subset \mathbb{R}$, and $g(x) = x$. This note focuses on the theoretical structure of GTWED and its implications for extending elastic distances beyond time series, which enables the use of TWED-like metrics on sequences over arbitrary domains such as symbolic data, manifolds, or embeddings.

A General Metric-Space Formulation of the Time Warp Edit Distance (TWED)

TL;DR

This work extends the Time Warp Edit Distance (TWED) to arbitrary metric spaces by formulating the General Time Warp Edit Distance (GTWED) on observations in a metric space and indices in a metric time domain . By introducing a local product-space cost and its regularized form , GTWED constructs a recursive, additive edit-distance-like metric with gap penalties and stiffness , and proves that it remains a true metric under mild conditions. The paper shows TWED as a special case when , is a subset of , and , thus subsuming classical TWED; it also provides a dynamic-programming algorithm with time and space. A key contribution is enabling TWED-like elastic distances over sequences on symbolic domains, manifolds, or embeddings, broadening applicability while noting that certain -based bounds from TWED do not generalize to GTWED.

Abstract

This short technical note presents a formal generalization of the Time Warp Edit Distance (TWED) proposed by Marteau (2009) to arbitrary metric spaces. By viewing both the observation and temporal domains as metric spaces and , we define a Generalized TWED (GTWED) that remains a true metric under mild assumptions. We provide self-contained proofs of its metric properties and show that the classical TWED is recovered as a special case when , , and . This note focuses on the theoretical structure of GTWED and its implications for extending elastic distances beyond time series, which enables the use of TWED-like metrics on sequences over arbitrary domains such as symbolic data, manifolds, or embeddings.
Paper Structure (17 sections, 7 theorems, 25 equations, 1 algorithm)

This paper contains 17 sections, 7 theorems, 25 equations, 1 algorithm.

Key Result

Proposition 3.2

If $d$ is a metric and $\gamma>0$, $\lambda\ge0$, then $\delta_{\lambda,\gamma}^{\mathrm{TWED}}$ is a metric on the set of finite time series $\mathcal{U}$.

Theorems & Definitions (16)

  • Definition 3.1: Traditional TWED, marteau2009twed
  • Proposition 3.2: TWED is a metric
  • proof
  • Lemma 3.3: Metric Transform Lemma
  • proof
  • Lemma 3.4: Positivity of Local Gap Costs
  • Lemma 3.5: Sum of metrics
  • proof
  • Corollary 3.6: Product-space metric for observations and time
  • proof
  • ...and 6 more