EchoTime logo Explainable time-series similarity for humans and agents.
Documentation

Similarity Methods Atlas

A full audit of EchoTime's current comparison math plus the 127 extracted time-series similarity methods from ts_similarity_package_v2_pkg, each with an explicit mathematical expression.

Audit summary

This page imports the full method registry from `ts_similarity_package_v2_pkg` and audits which parts fit EchoTime's report-first product direction.

EchoTime native 10 Extracted methods 127 Families 7 High-fit / implemented 14 Version 0.17.1
Implemented in EchoTime 14Conceptually covered 13Possible addition 39Low-priority addition 61

Explore 137 animated explanations / 查看全部方法动图 →

Compare methods on the same curves / 同一组曲线交互对照 · Read the mechanism tour · Discuss

What EchoTime now exposes
  • max_ncc / best_shift / sbd now cover explicit lead-lag and shift-aware similarity.
  • independent_max_ncc / independent_sbd now cover the channel-independent multivariate sliding variants highlighted by the v2 package.
  • periodogram_distance and trend_distance now add direct frequency-domain and trend-feature distances.
  • ordinal_pattern_js_distance and linear_trend_model_distance now cover symbolic rhythm comparison and lightweight trend-model comparison.
  • twed_distance now covers timestamp-aware elastic comparison for irregular series.
  • erp_distance, lcss_similarity, lcss_distance, and edr_distance now cover robust partial-match and gap-aware elastic matching.
  • acf_distance now adds a rhythm-focused structural distance beside the existing report-level spectral view.
Literature anchors

These references anchor the major method families in the atlas. They support the method inventory; they do not imply that every listed method is implemented as a standalone EchoTime API.

For checked titles, publication status, claims, and limitations, use the verified reading list with BibTeX and JSON. The method selection guide separates whole-series comparison, subsequence retrieval, dataset comparison, and learning losses.

Current EchoTime comparison layer

These are the similarity characterizations EchoTime already uses in raw-series comparison reports. Every entry below includes the mathematical expression used or approximated by the current code path.

shape_similarity

Family: EchoTime native component

Kind: similarity

s_shape = GM(clip(r(x,y), 0, 1), clip(r(Delta x, Delta y), 0, 1))

Combines level correlation with first-difference correlation so the headline match does not ignore local dynamics.

Animated explanation / 动图详解
dtw_similarity

Family: EchoTime native component

Kind: similarity

s_dtw = GM(exp(-aDTW_w(x,y)/0.45), exp(-aDTW_w(z(Delta x), z(Delta y))/0.35)); aDTW = min_path sum |x_i-y_j| / (n+m)

A package-specific blend on resampled, z-normalized series and re-normalized first differences. Uses absolute local costs and divides accumulated cost by n+m; it is not the common square-root-of-squared-cost DTW distance or a calibrated probability.

Animated explanation / 动图详解
trend_similarity

Family: EchoTime native component

Kind: similarity

s_trend = GM(clip(r(T(x), T(y)), 0, 1), clip(r(Delta T(x), Delta T(y)), 0, 1))

Smooths both series first, then compares both the trend level and the trend slope.

Animated explanation / 动图详解
derivative_similarity

Family: EchoTime native component

Kind: similarity

s_diff = clip(r(Delta x, Delta y), 0, 1)

Focuses on whether local changes move together even when the levels differ.

Animated explanation / 动图详解
spectral_similarity

Family: EchoTime native component

Kind: similarity

s_spec = GM(1 - JSD(P_x, P_y), clip(r(P_x - U, P_y - U), 0, 1))

Compares normalized spectra of differenced series, mixing JS overlap with structural similarity relative to a uniform spectrum U.

Animated explanation / 动图详解
pearson_r

Family: EchoTime reference metric

Kind: similarity

r(x,y) = sum_t (x_t - x_bar)(y_t - y_bar) / sqrt(sum_t (x_t - x_bar)^2 sum_t (y_t - y_bar)^2)

Familiar linear correlation exposed directly in every raw-series similarity report.

Animated explanation / 动图详解
spearman_rho

Family: EchoTime reference metric

Kind: similarity

rho(x,y) = corr(rank(x), rank(y))

Rank-order correlation used as a robustness check against nonlinear monotone relationships.

Animated explanation / 动图详解
kendall_tau

Family: EchoTime reference metric

Kind: similarity

tau_b(x,y) = (C - D) / sqrt((C + D + T_x)(C + D + T_y))

Kendall tau-b uses tie corrections: T_x and T_y count pairs tied only in x or only in y. EchoTime retains a zero-score convention for constant inputs, where statistical correlation is undefined.

Animated explanation / 动图详解
best_lag_pearson_r

Family: EchoTime reference metric

Kind: similarity

max_lag_r(x,y) = max_ell r(x_t, y_{t-ell})

Searches over a bounded lag window to show whether a shift-aware linear relationship is stronger than the aligned one.

Animated explanation / 动图详解
normalized_mutual_information

Family: EchoTime reference metric

Kind: similarity

NMI(X,Y) = I(X;Y) / sqrt(H(X) H(Y))

Histogram-based nonlinear dependence score used as a familiar cross-check against linear metrics.

Animated explanation / 动图详解
Animated method explanations / 方法动图详解

Watch the calculation, then read its assumptions

Each of the 137 entries has a GIF, a static summary, four explanatory stages and a reproducible numerical trace. Inputs are small, synthetic teaching examples. Scores describe those examples and carry no performance ranking.

这里覆盖 10 个原生分项与 127 个方法条目。每项包含动图、静态总结、四步说明及可复现的计算过程。示例使用小规模合成序列,分数只描述对应示例。图中会标明当前实现、参考公式或具体流程设定。

Animations stay still until requested. Play one at a time; Stop restores the static summary. / 动图默认静止;可逐项播放和停止。

137 method explanations

EchoTime comparison layer / EchoTime 原生比较分项 10
EchoTime shape similarity shape_similarityChecked against EchoTime
EchoTime shape similarity: static final state of the documented numerical example. similarity = 0.894045.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.89404489 —

EchoTime coverage: EchoTime report component / reference metric · shape_similarity

sqrt(max(r(x,y),0)*max(r(z(diff(x)),z(diff(y))),0))

Demonstration: Checked against EchoTime

EchoTime's shape component combines agreement in standardized levels with agreement in their first differences. Negative correlations are clipped to zero, and a geometric mean requires both views to contribute positively. The animation reproduces these intermediate views and their actual component scores on a 24-point example, making the package-specific blend explicit.

How the calculation works

  1. Resample and standardize each channel with the same declared point count.
  2. Compute Pearson correlation of aligned levels.
  3. Compute Pearson correlation of standardized first differences.
  4. Clip correlations to [0,1] and take their geometric mean.

Interpretation and limits

  • Clipping makes anticorrelation and zero correlation equally contribute zero.
  • This is a package-specific similarity component, not a calibrated probability.
  • The 24-point demonstration changes resolution from the default 256-point pipeline.

示例性质: 已与 EchoTime 计算核对

EchoTime 的形状分项结合标准化水平值和一阶差分的一致性。负相关先截为零,几何平均要求两个视角都具有正贡献。动图使用 24 点示例复现各中间表示与真实分项数值,明确展示这个软件特有的组合。

计算步骤

  1. 按声明的点数重采样并分别标准化通道。
  2. 计算对齐水平值的 Pearson 相关。
  3. 计算标准化一阶差分的 Pearson 相关。
  4. 将相关截至 [0,1] 后取几何平均。

解释与使用边界

  • 截断使负相关和零相关都贡献零。
  • 这是软件特定的相似性分项,不是校准概率。
  • 24 点演示采用的分辨率与默认 256 点流程不同。
Example parameters / 示例参数
{
  "n_points": 24,
  "default_n_points": 256,
  "channels": 1,
  "preprocessing": "compare_series linear resampling followed by per-channel population z-score",
  "demonstration_note": "24 points expose the computation; production default is 256"
}

Definition sources / 定义来源: EchoTime comparison implementation

EchoTime DTW similarity dtw_similarityChecked against EchoTime
EchoTime DTW similarity: static final state of the documented numerical example. similarity = 0.651076.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.65107619 —

EchoTime coverage: EchoTime report component / reference metric · dtw_similarity

sqrt(exp(-aDTW_w(x,y)/0.45)*exp(-aDTW_v(z(diff(x)),z(diff(y)))/0.35)); aDTW=sum_path abs(gap)/(n+m)

Demonstration: Checked against EchoTime

The native DTW component runs constrained alignments on both standardized levels and standardized first differences. Each local cost is an absolute gap; the accumulated path cost is divided by the sum of sequence lengths. Two different exponential scales convert those costs into scores, whose geometric mean is the reported component. The animation reconstructs both actual dynamic programs.

How the calculation works

  1. Standardize levels and first differences separately.
  2. Accumulate absolute local costs within the level warping band.
  3. Run the same recurrence on differences with their declared band.
  4. Normalize costs by n+m, use scales 0.45 and 0.35, and combine geometrically.

Interpretation and limits

  • This native score differs from square-root-of-squared-cost DTW distances in other libraries.
  • The band, resampling resolution, derivative normalization and scales affect the value.
  • A high score does not imply causal correspondence or a probability of identity.

示例性质: 已与 EchoTime 计算核对

原生 DTW 分项对标准化水平值和标准化一阶差分分别执行有约束对齐。局部代价是绝对差,累计路径代价除以两序列长度之和,再通过不同尺度的指数函数转成分数,最终取几何平均。动图重建这两个实际动态规划。

计算步骤

  1. 分别标准化水平值与一阶差分。
  2. 在水平值规整窗口内累加绝对局部代价。
  3. 对差分按其窗口执行同样递推。
  4. 按 n+m 归一化,以 0.45 和 0.35 指数映射后取几何平均。

解释与使用边界

  • 此原生分数与其他库常用的平方代价开根号 DTW 距离不同。
  • 窗口、重采样分辨率、差分标准化和指数尺度都会影响数值。
  • 高分不表示因果对应或同一性的概率。
Example parameters / 示例参数
{
  "n_points": 24,
  "default_n_points": 256,
  "channels": 1,
  "preprocessing": "compare_series linear resampling followed by per-channel population z-score",
  "demonstration_note": "24 points expose the computation; production default is 256",
  "level_band": 3,
  "difference_band": 3,
  "level_scale": 0.45,
  "difference_scale": 0.35,
  "level_cost": 0.09157025962848607,
  "difference_cost": 0.22916870927834282
}

Definition sources / 定义来源: EchoTime comparison implementation

EchoTime trend similarity trend_similarityChecked against EchoTime
EchoTime trend similarity: static final state of the documented numerical example. similarity = 0.986975.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.9869748 —

EchoTime coverage: EchoTime report component / reference metric · trend_similarity

sqrt(max(corr(T(x),T(y)),0)*max(corr(z(diff(T(x))),z(diff(T(y)))),0))

Demonstration: Checked against EchoTime

The trend component smooths each standardized input with the package's Savitzky-Golay settings. It compares both the smoothed levels and their standardized first differences, then combines clipped correlations geometrically. The animation reveals the fitted trend before comparison. This separates the declared smoothing scale from a claim that the observed signal has one uniquely identifiable trend.

How the calculation works

  1. Apply the declared Savitzky-Golay smoother to both standardized inputs.
  2. Measure correlation between the smooth level curves.
  3. Measure correlation between standardized first differences of those curves.
  4. Clip both correlations and take their geometric mean.

Interpretation and limits

  • The window is length-dependent, so changing n_points changes the smoothing scale.
  • Smoothing can conceal short events that still matter for the application.
  • Endpoint interpolation is part of the displayed Savitzky-Golay convention.

示例性质: 已与 EchoTime 计算核对

趋势分项按软件的 Savitzky-Golay 设置平滑各标准化输入,分别比较平滑后的水平值和标准化一阶差分,再对截断相关取几何平均。动画先展示拟合趋势,再比较两侧;所声明的平滑尺度不意味着信号存在唯一可识别的趋势。

计算步骤

  1. 按所声明参数对两侧标准化输入进行 Savitzky-Golay 平滑。
  2. 比较平滑水平曲线的相关。
  3. 比较平滑曲线标准化一阶差分的相关。
  4. 截断两个相关并取几何平均。

解释与使用边界

  • 窗口随长度变化,改变 n_points 会改变平滑尺度。
  • 平滑可能掩盖应用中重要的短暂事件。
  • 端点插值属于此 Savitzky-Golay 实现约定。
Example parameters / 示例参数
{
  "n_points": 24,
  "default_n_points": 256,
  "channels": 1,
  "preprocessing": "compare_series linear resampling followed by per-channel population z-score",
  "demonstration_note": "24 points expose the computation; production default is 256",
  "window_length": 9,
  "polyorder": 3,
  "mode": "interp"
}

Definition sources / 定义来源: EchoTime comparison implementation; SciPy: Savitzky-Golay filter

EchoTime derivative similarity derivative_similarityChecked against EchoTime
EchoTime derivative similarity: static final state of the documented numerical example. similarity = 0.819272.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.81927245 —

EchoTime coverage: EchoTime report component / reference metric · derivative_similarity

max(corr(z(diff(x)),z(diff(y))),0)

Demonstration: Checked against EchoTime

The derivative component compares local increments after standardizing the input and then standardizing its first differences. It reports the positive part of their Pearson correlation. The animation follows the difference vectors and their normalized product terms, exposing why two signals can share a slow level pattern while differing substantially in their local changes.

How the calculation works

  1. Resample and standardize each original series.
  2. Take first differences and standardize those differences separately.
  3. Compute Pearson correlation of the aligned change vectors.
  4. Clip the correlation to [0,1].

Interpretation and limits

  • Differencing can amplify measurement noise and reduces the sample count by one.
  • Anticorrelated changes receive zero similarity after clipping.
  • Sampling resolution determines which changes are treated as local.

示例性质: 已与 EchoTime 计算核对

差分分项先标准化输入,再标准化其一阶差分,以两组差分 Pearson 相关的正部分作为相似度。动画追踪差分向量及归一化乘积,说明两条序列即使共享缓慢变化的水平形状,局部变化仍可能不同。

计算步骤

  1. 重采样并标准化原序列。
  2. 取一阶差分并分别标准化。
  3. 计算对齐变化向量的 Pearson 相关。
  4. 将相关截至 [0,1]。

解释与使用边界

  • 差分可能放大测量噪声,并使样本数减少一个。
  • 反向相关的变化经截断后获得零相似度。
  • 采样分辨率决定哪些变化被视为局部。
Example parameters / 示例参数
{
  "n_points": 24,
  "default_n_points": 256,
  "channels": 1,
  "preprocessing": "compare_series linear resampling followed by per-channel population z-score",
  "demonstration_note": "24 points expose the computation; production default is 256"
}

Definition sources / 定义来源: EchoTime comparison implementation

EchoTime spectral similarity spectral_similarityChecked against EchoTime
EchoTime spectral similarity: static final state of the documented numerical example. similarity = 0.994235.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.99423541 —

EchoTime coverage: EchoTime report component / reference metric · spectral_similarity

sqrt(clip(1-JS_base2(Px,Py),0,1)*max(corr(Px-U,Py-U),0)); spectra of z(diff(x))

Demonstration: Checked against EchoTime

EchoTime's spectral component works on standardized first differences. It linearly detrends the periodogram input, drops the zero-frequency bin, and normalizes the remaining power. One term measures one minus base-two JS divergence; another measures positive correlation of spectral structure. Their geometric mean produces the actual score shown by the animation.

How the calculation works

  1. Use standardized first differences as spectral input.
  2. Compute linearly detrended periodograms, remove DC and normalize power.
  3. Calculate 1-JS divergence in bits and positive spectral correlation.
  4. Take the geometric mean of overlap and structure scores.

Interpretation and limits

  • Power spectra discard phase; similar spectra do not ensure aligned waveforms.
  • The JS term here is a divergence in bits, not the square-root JS distance in another atlas card.
  • Resampling, differentiation and detrending all change the spectral object being compared.

示例性质: 已与 EchoTime 计算核对

EchoTime 的频谱分项作用于标准化一阶差分。周期图计算使用线性去趋势,去除零频箱并归一化其余功率。一个分项取 1 减二进制 JS 散度,另一个衡量频谱结构的正相关,动图展示两者几何平均得到的实际分数。

计算步骤

  1. 以标准化一阶差分作为频谱输入。
  2. 计算线性去趋势周期图,去除零频并归一化功率。
  3. 计算二进制 1−JS 散度与频谱正相关。
  4. 对重叠和结构分数取几何平均。

解释与使用边界

  • 功率谱舍弃相位,频谱相似不保证波形对齐。
  • 这里的 JS 项是以比特为单位的散度,与另一条目的平方根 JS 距离不同。
  • 重采样、差分和去趋势都会改变所比较的频谱对象。
Example parameters / 示例参数
{
  "n_points": 24,
  "default_n_points": 256,
  "channels": 1,
  "preprocessing": "compare_series linear resampling followed by per-channel population z-score",
  "demonstration_note": "24 points expose the computation; production default is 256",
  "periodogram_detrend": "linear",
  "drop_DC": true,
  "JS_log_base": 2,
  "frequency_grid": [
    0.043478260869565216,
    0.08695652173913043,
    0.13043478260869565,
    0.17391304347826086,
    0.21739130434782608,
    0.2608695652173913,
    0.30434782608695654,
    0.34782608695652173,
    0.3913043478260869,
    0.43478260869565216,
    0.4782608695652174
  ]
}

Definition sources / 定义来源: EchoTime comparison implementation; EchoTime spectral preprocessing and JS definition

EchoTime reference: Pearson r pearson_rChecked against EchoTime
EchoTime reference: Pearson r: static final state of the documented numerical example. similarity = 0.975642.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.97564158 —

EchoTime coverage: EchoTime report component / reference metric · pearson_r

corr(x,y) after compare_series preprocessing

Demonstration: Checked against EchoTime

The native report includes signed Pearson correlation as a familiar reference alongside its clipped component scores. It is evaluated after the same resampling and per-channel standardization as the other report terms. This animation reveals centered products on that actual comparison grid and retains negative values instead of interpreting them as positive shape agreement.

How the calculation works

  1. Use the report's resampled, standardized input arrays.
  2. Center the paired observations.
  3. Normalize their product sum by both centered norms.
  4. Keep the signed coefficient in the reference-metric section.

Interpretation and limits

  • EchoTime assigns zero for constant inputs; statistical correlation is undefined in that case.
  • These are dependence summaries, not causal tests or identity probabilities.
  • The illustrative report explicitly uses n_points=24; the default is 256.

示例性质: 已与 EchoTime 计算核对

原生报告保留带符号 Pearson 相关作为参照,与截断后的分项并列。其输入经过相同的重采样和逐通道标准化。动画在实际比较网格上展示中心化乘积,并保留负值的含义。

计算步骤

  1. 使用报告经过重采样和标准化的输入。
  2. 对配对观测去均值。
  3. 按中心化范数归一化点积。
  4. 在参照指标中保留带符号系数。

解释与使用边界

  • EchoTime 对常量输入赋零;此时统计相关本身未定义。
  • 这些是依赖关系摘要,不是因果检验或同一性概率。
  • 演示报告显式使用 n_points=24,默认值为 256。
Example parameters / 示例参数
{
  "n_points": 24,
  "default_n_points": 256,
  "channels": 1,
  "preprocessing": "compare_series linear resampling followed by per-channel population z-score",
  "demonstration_note": "24 points expose the computation; production default is 256"
}

Definition sources / 定义来源: EchoTime comparison implementation; SciPy: correlation

EchoTime reference: Spearman rho spearman_rhoChecked against EchoTime
EchoTime reference: Spearman rho: static final state of the documented numerical example. similarity = 0.985646.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.98564603 —

EchoTime coverage: EchoTime report component / reference metric · spearman_rho

corr(rank_average(x),rank_average(y)) after compare_series preprocessing

Demonstration: Checked against EchoTime

The native Spearman reference converts the report's resampled observations to average ranks and correlates those ranks. It complements amplitude-based comparisons by exposing monotone agreement on the same grid. The animation makes the ranking operation visible, including ties, and retains a signed coefficient; its value depends on the observations created by the chosen interpolation resolution.

How the calculation works

  1. Use the same resampled observations as the native report.
  2. Assign average ranks independently, retaining paired sample identities.
  3. Center ranks and normalize their product sum.
  4. Report the signed rank coefficient.

Interpretation and limits

  • EchoTime assigns zero for constant inputs; statistical correlation is undefined in that case.
  • These are dependence summaries, not causal tests or identity probabilities.
  • The illustrative report explicitly uses n_points=24; the default is 256.

示例性质: 已与 EchoTime 计算核对

原生 Spearman 参照把报告重采样后的观测转换为平均排名,再计算相关。它在相同网格上展示单调一致性,补充幅值比较。动画显示含并列处理的排名操作并保留符号;结果依赖所选插值分辨率产生的观测。

计算步骤

  1. 使用原生报告相同的重采样观测。
  2. 独立赋予平均排名,保留配对身份。
  3. 对排名去均值并归一化乘积。
  4. 报告带符号排名系数。

解释与使用边界

  • EchoTime 对常量输入赋零;此时统计相关本身未定义。
  • 这些是依赖关系摘要,不是因果检验或同一性概率。
  • 演示报告显式使用 n_points=24,默认值为 256。
Example parameters / 示例参数
{
  "n_points": 24,
  "default_n_points": 256,
  "channels": 1,
  "preprocessing": "compare_series linear resampling followed by per-channel population z-score",
  "demonstration_note": "24 points expose the computation; production default is 256"
}

Definition sources / 定义来源: EchoTime comparison implementation; SciPy: spearmanr

EchoTime reference: Kendall tau-b kendall_tauChecked against EchoTime
EchoTime reference: Kendall tau-b: static final state of the documented numerical example. similarity = 0.923642.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.92364247 —

EchoTime coverage: EchoTime report component / reference metric · kendall_tau

(C-D)/sqrt((C+D+T_x)*(C+D+T_y)) on resampled observations

Demonstration: Checked against EchoTime

The native Kendall reference uses tau-b, including corrections for one-sided ties, on the resampled input grid. It counts ordering agreements and disagreements rather than amplitude gaps. The animation reconstructs its pair classifications and normalization. This explanatory enumeration matches the score while leaving the numerical library free to use a more efficient algorithm internally.

How the calculation works

  1. Use the native report's resampled observations.
  2. Compare relative orders for observation pairs.
  3. Count concordance, discordance and one-sided ties.
  4. Apply tau-b normalization and keep its sign.

Interpretation and limits

  • EchoTime assigns zero for constant inputs; statistical correlation is undefined in that case.
  • These are dependence summaries, not causal tests or identity probabilities.
  • The illustrative report explicitly uses n_points=24; the default is 256.

示例性质: 已与 EchoTime 计算核对

原生 Kendall 参照在重采样网格上使用包含单侧并列校正的 tau-b,统计顺序同向与反向关系,不比较幅值差。动画重建配对分类和归一化;这种教学枚举与实际分数一致,数值库内部可以使用更高效算法。

计算步骤

  1. 使用原生报告重采样后的观测。
  2. 比较观测对的相对顺序。
  3. 统计同序、逆序和单侧并列。
  4. 应用 tau-b 归一化并保留符号。

解释与使用边界

  • EchoTime 对常量输入赋零;此时统计相关本身未定义。
  • 这些是依赖关系摘要,不是因果检验或同一性概率。
  • 演示报告显式使用 n_points=24,默认值为 256。
Example parameters / 示例参数
{
  "n_points": 24,
  "default_n_points": 256,
  "channels": 1,
  "preprocessing": "compare_series linear resampling followed by per-channel population z-score",
  "demonstration_note": "24 points expose the computation; production default is 256"
}

Definition sources / 定义来源: EchoTime comparison implementation; SciPy: kendalltau

EchoTime reference: best-lag Pearson best_lag_pearson_rChecked against EchoTime
EchoTime reference: best-lag Pearson: static final state of the documented numerical example. similarity = 0.997635.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.99763515 —

EchoTime coverage: EchoTime report component / reference metric · best_lag_pearson_r

max_{|lag|<=max(1,min(24,n//10))} corr(x_overlap,y_overlap)

Demonstration: Checked against EchoTime

The native best-lag reference scans a bounded set of shifts on the report's resampled grid. Pearson correlation is recomputed on each actual overlap, including a separate overlap mean and norm. The animation uses a delayed illustrative series to show the improvement from lag zero to the selected lag while keeping the finite search window explicit.

How the calculation works

  1. Resample both inputs; derive the native maximum lag from n_points.
  2. At every admitted lag, take the actual overlap.
  3. Recompute centered Pearson correlation on each overlap.
  4. Return the maximum signed coefficient and interpret its lag in resampled points.

Interpretation and limits

  • The selected lag is measured on the normalized/resampled axis, not automatically in physical time.
  • Searching several lags changes the interpretation from a prespecified single correlation.
  • Overlap-specific centering differs from full-norm normalized cross-correlation.

示例性质: 已与 EchoTime 计算核对

原生最佳滞后参照在报告重采样网格上扫描有限平移。每个实际重叠片段重新计算 Pearson 相关,使用各自均值和范数。动画以延迟序列展示零滞后到最佳滞后的变化,并明确有限搜索窗口。

计算步骤

  1. 重采样两侧输入,按 n_points 得到原生最大滞后。
  2. 对每个允许滞后取实际重叠。
  3. 在各重叠片段重新计算中心化 Pearson 相关。
  4. 返回最大带符号系数,滞后单位为重采样点。

解释与使用边界

  • 所选滞后以归一化重采样轴为单位,不能自动解释为实际时间。
  • 搜索多个滞后与事先指定单个相关的统计解释不同。
  • 逐重叠去均值与全范数归一化互相关不同。
Example parameters / 示例参数
{
  "n_points": 24,
  "default_n_points": 256,
  "channels": 1,
  "preprocessing": "compare_series linear resampling followed by per-channel population z-score",
  "demonstration_note": "24 points expose the computation; production default is 256",
  "max_lag": 2,
  "selected_lag": -2
}

Definition sources / 定义来源: EchoTime comparison implementation

EchoTime reference: normalized mutual information normalized_mutual_informationChecked against EchoTime
EchoTime reference: normalized mutual information: static final state of the documented numerical example. similarity = 0.682841.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.68284131 —

EchoTime coverage: EchoTime report component / reference metric · normalized_mutual_information

I(X;Y)/sqrt(H(X)*H(Y)); bins=clip(round(sqrt(n/4)),4,20); natural logarithms

Demonstration: Checked against EchoTime

EchoTime estimates mutual information from a joint histogram of aligned, resampled observations. It compares observed joint mass with the product of marginal masses, then divides by the geometric mean of marginal entropies. The animation shows the actual bin counts and information terms. The resulting finite-sample dependence estimate is sensitive to the declared binning rule.

How the calculation works

  1. Use the aligned resampled observations and the native bin-count rule.
  2. Count their joint histogram and normalize it to probability mass.
  3. Compute MI from joint-versus-independent mass and both marginal entropies.
  4. Divide MI by sqrt(Hx*Hy) and clip to [0,1].

Interpretation and limits

  • Binning and finite sample size introduce estimation bias; a nonzero score is not a significance test.
  • The native function needs at least twelve finite paired observations and gives constant inputs a zero convention.
  • Dependence does not establish causality, waveform equality or temporal forecasting ability.

示例性质: 已与 EchoTime 计算核对

EchoTime 通过对齐且重采样观测的联合直方图估计互信息,比较联合概率与边缘概率乘积,再除以两侧熵的几何平均。动画显示真实箱计数及信息贡献项。有限样本依赖估计对所声明的分箱规则敏感。

计算步骤

  1. 使用对齐的重采样观测和原生分箱数规则。
  2. 计算联合直方图并归一化为概率。
  3. 由联合质量与独立质量比较得到 MI,同时计算边缘熵。
  4. 以 sqrt(Hx*Hy) 归一化 MI 并截至 [0,1]。

解释与使用边界

  • 分箱和有限样本引入估计偏差;非零分数不是显著性检验。
  • 原生函数要求至少十二对有限观测,并对常量输入约定为零。
  • 依赖关系不证明因果、波形相等或时间预测能力。
Example parameters / 示例参数
{
  "n_points": 24,
  "default_n_points": 256,
  "channels": 1,
  "preprocessing": "compare_series linear resampling followed by per-channel population z-score",
  "demonstration_note": "24 points expose the computation; production default is 256",
  "bins_per_axis": 4,
  "x_bin_edges": [
    -1.9249938311141905,
    -0.9791700904722576,
    -0.033346349830324584,
    0.9124773908116084,
    1.8583011314535414
  ],
  "y_bin_edges": [
    -2.010364037206175,
    -1.0094117352307777,
    -0.008459433255380233,
    0.9924928687200172,
    1.9934451706954148
  ],
  "log_base": "e"
}

Definition sources / 定义来源: EchoTime comparison implementation

Aligned, pointwise comparison / 逐点比较 34
Euclidean distance euclideanReference-formula demonstration
Euclidean distance: static final state of the documented numerical example. distance = 1.66132.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 1.6613248 — Exact formula evaluation on the displayed aligned vectors.

EchoTime coverage: Low-priority addition

sqrt(sum_i (x_i-y_i)^2)

Demonstration: Reference-formula demonstration

Euclidean distance treats an aligned time series as one vector. Every vertical gap contributes a squared cost, and the final square root returns the result to the original amplitude units. The animation shows exactly which sample differences produce the final distance; no temporal realignment is performed.

How the calculation works

  1. Keep the two series on the same sample grid; no shift or warping is estimated.
  2. Square each residual; the highlighted point supplies one coordinate contribution.
  3. Accumulate the coordinate contributions in sample order.
  4. Take the square root of the total squared gap.

Interpretation and limits

  • A single large residual can dominate the squared sum.
  • Sample alignment and amplitude units are part of the comparison protocol.

示例性质: 参考公式演示

欧氏距离把已经对齐的时间序列视为向量。每个时刻的垂直差先平方后累加,再开平方回到原始幅值单位。动图展示各时刻如何贡献最终距离,整个计算不重新对齐时间。

计算步骤

  1. 在同一采样网格上比较两条序列,不估计平移或时间规整。
  2. 计算各坐标残差的平方。
  3. 按采样顺序累积局部贡献。
  4. 对平方差总和开平方。

解释与使用边界

  • 单个大误差可能主导平方和。
  • 采样对齐和幅值单位属于比较协议的一部分。
Example parameters / 示例参数
{
  "samples": 12,
  "preprocessing": "none",
  "domain": "strictly positive illustration"
}

Definition sources / 定义来源: SciPy: euclidean

Squared Euclidean squared_euclideanReference-formula demonstration
Squared Euclidean: static final state of the documented numerical example. distance = 2.76.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 2.76 — Exact formula evaluation on the displayed aligned vectors.

EchoTime coverage: Low-priority addition

sum_i (x_i-y_i)^2

Demonstration: Reference-formula demonstration

Squared Euclidean distance accumulates squared residuals without taking a square root. This makes coordinate contributions additive and keeps large errors prominent. It has the same nearest-neighbour ordering as Euclidean distance on the same vectors, but the output has squared amplitude units and is not a metric.

How the calculation works

  1. Keep the two series on the same sample grid; no shift or warping is estimated.
  2. Square each residual; the highlighted point supplies one coordinate contribution.
  3. Accumulate the coordinate contributions in sample order.
  4. Keep the squared sum; do not take a square root.

Interpretation and limits

  • Squaring a metric does not generally preserve the triangle inequality.
  • Sample alignment and amplitude units are part of the comparison protocol.

示例性质: 参考公式演示

平方欧氏距离直接累加平方残差,不再开平方。因此各坐标贡献可相加,大误差受到更强惩罚。在同一组向量上,它与欧氏距离给出相同的近邻排序,但结果单位为幅值平方,也不满足一般的三角不等式。

计算步骤

  1. 在同一采样网格上比较两条序列,不估计平移或时间规整。
  2. 计算各坐标残差的平方。
  3. 按采样顺序累积局部贡献。
  4. 直接保留平方差总和,不开平方。

解释与使用边界

  • 对度量取平方通常不保留三角不等式。
  • 采样对齐和幅值单位属于比较协议的一部分。
Example parameters / 示例参数
{
  "samples": 12,
  "preprocessing": "none",
  "domain": "strictly positive illustration"
}

Definition sources / 定义来源: SciPy: sqeuclidean

Root mean square error rmse_distanceReference-formula demonstration
Root mean square error: static final state of the documented numerical example. distance = 0.479583.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.47958315 — Exact formula evaluation on the displayed aligned vectors.

EchoTime coverage: Low-priority addition

sqrt(mean_i (x_i-y_i)^2)

Demonstration: Reference-formula demonstration

RMSE averages squared residuals before taking a square root. For vectors of one fixed length it is Euclidean distance divided by the square root of that length. The animation separates the squared-error accumulation, averaging, and final root so its difference from a raw Euclidean total is visible.

How the calculation works

  1. Keep the two series on the same sample grid; no shift or warping is estimated.
  2. Square each residual; the highlighted point supplies one coordinate contribution.
  3. Accumulate the coordinate contributions in sample order.
  4. Divide by sample count, then take the square root.

Interpretation and limits

  • The fixed-length equivalence does not justify comparing different missing-data or alignment protocols.
  • Sample alignment and amplitude units are part of the comparison protocol.

示例性质: 参考公式演示

RMSE 先对平方误差取平均,再开平方。向量长度固定时,它等于欧氏距离除以长度的平方根。动图将平方累加、求平均和开平方分开,说明它与未归一化欧氏距离的关系。

计算步骤

  1. 在同一采样网格上比较两条序列,不估计平移或时间规整。
  2. 计算各坐标残差的平方。
  3. 按采样顺序累积局部贡献。
  4. 平方差总和除以样本数后,再开平方。

解释与使用边界

  • 固定长度下的等价关系不能代替缺失值和对齐协议的一致性。
  • 采样对齐和幅值单位属于比较协议的一部分。
Example parameters / 示例参数
{
  "samples": 12,
  "preprocessing": "none",
  "domain": "strictly positive illustration"
}

Definition sources / 定义来源: SciPy: euclidean

Manhattan distance manhattanReference-formula demonstration
Manhattan distance: static final state of the documented numerical example. distance = 5.4.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 5.4 — Exact formula evaluation on the displayed aligned vectors.

EchoTime coverage: Low-priority addition

sum_i abs(x_i-y_i)

Demonstration: Reference-formula demonstration

Manhattan distance adds the absolute gap at every aligned time point. Positive and negative errors cannot cancel, and the penalty grows linearly with each residual. Its animation accumulates visible vertical discrepancies one by one. Longer vectors can produce larger totals even when their typical per-sample discrepancy is unchanged.

How the calculation works

  1. Keep the two series on the same sample grid; no shift or warping is estimated.
  2. Take each absolute residual; the highlighted point supplies one coordinate contribution.
  3. Accumulate the coordinate contributions in sample order.
  4. Sum the absolute gaps.

Interpretation and limits

  • The sum depends on the number of compared coordinates.
  • Sample alignment and amplitude units are part of the comparison protocol.

示例性质: 参考公式演示

曼哈顿距离累加每个对齐时刻的绝对差。正负误差不会抵消,每个残差的惩罚线性增长。动图逐项累积垂直差;即使平均误差不变,序列更长也可能产生更大的总距离。

计算步骤

  1. 在同一采样网格上比较两条序列,不估计平移或时间规整。
  2. 计算各坐标的绝对残差。
  3. 按采样顺序累积局部贡献。
  4. 直接保留绝对差总和。

解释与使用边界

  • 总和依赖比较的坐标数量。
  • 采样对齐和幅值单位属于比较协议的一部分。
Example parameters / 示例参数
{
  "samples": 12,
  "preprocessing": "none",
  "domain": "strictly positive illustration"
}

Definition sources / 定义来源: SciPy: cityblock

Mean absolute error mae_distanceReference-formula demonstration
Mean absolute error: static final state of the documented numerical example. distance = 0.45.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.45 — Exact formula evaluation on the displayed aligned vectors.

EchoTime coverage: Low-priority addition

mean_i abs(x_i-y_i)

Demonstration: Reference-formula demonstration

MAE reports the average absolute discrepancy on an aligned time axis. It divides the Manhattan total by the number of compared coordinates, retaining the original amplitude units. The animation shows both the individual absolute gaps and the average, making clear why the same total can imply different typical errors at different lengths.

How the calculation works

  1. Keep the two series on the same sample grid; no shift or warping is estimated.
  2. Take each absolute residual; the highlighted point supplies one coordinate contribution.
  3. Accumulate the coordinate contributions in sample order.
  4. Divide the absolute-error sum by sample count.

Interpretation and limits

  • Averaging does not remove sensitivity to a systematic time shift.
  • Sample alignment and amplitude units are part of the comparison protocol.

示例性质: 参考公式演示

MAE 表示对齐时间轴上的平均绝对差。它将曼哈顿总距离除以比较坐标数,仍使用原始幅值单位。动图同时展示各点绝对误差和最终平均值,帮助区分总误差与典型逐点误差。

计算步骤

  1. 在同一采样网格上比较两条序列,不估计平移或时间规整。
  2. 计算各坐标的绝对残差。
  3. 按采样顺序累积局部贡献。
  4. 绝对差总和除以样本数。

解释与使用边界

  • 求平均不能消除系统性的时间偏移影响。
  • 采样对齐和幅值单位属于比较协议的一部分。
Example parameters / 示例参数
{
  "samples": 12,
  "preprocessing": "none",
  "domain": "strictly positive illustration"
}

Definition sources / 定义来源: SciPy: cityblock

Minkowski distance (p=3) minkowskiReference-formula demonstration
Minkowski distance (p=3): static final state of the documented numerical example. distance = 1.1568.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 1.1567966 — Exact formula evaluation on the displayed aligned vectors.

EchoTime coverage: Low-priority addition

(sum_i abs(x_i-y_i)^p)^(1/p); p=3

Demonstration: Reference-formula demonstration

Minkowski distance controls how strongly larger coordinate errors dominate through an exponent p. This illustration fixes p to three: absolute residuals are cubed, added, and then transformed by a cube root. Choosing another p changes the definition; p equals one and two recover Manhattan and Euclidean distances.

How the calculation works

  1. Keep the two series on the same sample grid; no shift or warping is estimated.
  2. Cube the absolute residual (p=3); the highlighted point supplies one coordinate contribution.
  3. Accumulate the coordinate contributions in sample order.
  4. Take the p-th root of the accumulated p-th powers.

Interpretation and limits

  • The norm/metric property requires p >= 1; p < 1 defines a different quasi-distance.
  • Sample alignment and amplitude units are part of the comparison protocol.

示例性质: 参考公式演示

Minkowski 距离用指数 p 控制大误差的影响。本例固定 p=3:绝对残差立方后相加,再开立方。p 的选择属于方法定义;p=1 与 p=2 分别对应曼哈顿和欧氏距离。

计算步骤

  1. 在同一采样网格上比较两条序列,不估计平移或时间规整。
  2. 对各坐标绝对残差取三次方,本例 p=3。
  3. 按采样顺序累积局部贡献。
  4. 对三次方总和开立方。

解释与使用边界

  • 范数和度量性质要求 p≥1;p<1 时属于不同的拟距离。
  • 采样对齐和幅值单位属于比较协议的一部分。
Example parameters / 示例参数
{
  "samples": 12,
  "preprocessing": "none",
  "domain": "strictly positive illustration",
  "p": 3
}

Definition sources / 定义来源: SciPy: minkowski

Chebyshev distance chebyshevReference-formula demonstration
Chebyshev distance: static final state of the documented numerical example. distance = 0.7.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.7 — Exact formula evaluation on the displayed aligned vectors.

EchoTime coverage: Low-priority addition

max_i abs(x_i-y_i)

Demonstration: Reference-formula demonstration

Chebyshev distance keeps only the largest aligned absolute error. A running maximum identifies the worst discrepancy as the animation scans the sequence. It answers a maximum-deviation question, so a small improvement at the worst point matters while changes below the current maximum may leave the result unchanged.

How the calculation works

  1. Keep the two series on the same sample grid; no shift or warping is estimated.
  2. Measure the absolute residual; the highlighted point supplies one coordinate contribution.
  3. Update the running maximum.
  4. Keep the largest coordinate discrepancy.

Interpretation and limits

  • One isolated spike may determine the entire result.
  • Sample alignment and amplitude units are part of the comparison protocol.

示例性质: 参考公式演示

Chebyshev 距离只保留最大的逐点绝对误差。动图扫描序列并更新当前最大值,回答最坏偏差有多大的问题。因此最大误差位置的变化很重要,其他位置的小幅变化可能完全不改变结果。

计算步骤

  1. 在同一采样网格上比较两条序列,不估计平移或时间规整。
  2. 计算各坐标的绝对残差。
  3. 更新当前最大误差。
  4. 以所有坐标中的最大绝对差作为结果。

解释与使用边界

  • 一个孤立尖峰就可能决定全部结果。
  • 采样对齐和幅值单位属于比较协议的一部分。
Example parameters / 示例参数
{
  "samples": 12,
  "preprocessing": "none",
  "domain": "strictly positive illustration"
}

Definition sources / 定义来源: SciPy: chebyshev

Canberra distance canberraReference-formula demonstration
Canberra distance: static final state of the documented numerical example. distance = 0.976847.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.97684677 — Exact formula evaluation on the displayed aligned vectors.

EchoTime coverage: Low-priority addition

sum_i abs(x_i-y_i)/(abs(x_i)+abs(y_i))

Demonstration: Reference-formula demonstration

Canberra distance normalizes each coordinate error by the magnitudes at that same coordinate before adding the ratios. This gives small-amplitude positions a potentially large influence compared with an unscaled absolute error. The example uses positive values so the animation can expose the local denominator without an undefined zero-over-zero term.

How the calculation works

  1. Keep the two series on the same sample grid; no shift or warping is estimated.
  2. Divide each gap by local absolute magnitudes; the highlighted point supplies one coordinate contribution.
  3. Accumulate the coordinate contributions in sample order.
  4. Sum coordinate-wise relative errors.

Interpretation and limits

  • Near-zero coordinates can be influential; a zero-over-zero convention must be stated.
  • Sample alignment and amplitude units are part of the comparison protocol.

示例性质: 参考公式演示

Canberra 距离先用每个坐标两侧幅值之和归一化该点误差,再累加比值。相较未缩放的绝对误差,低幅值位置可能获得较大影响。本例使用正值,明确展示逐点分母并避免 0/0。

计算步骤

  1. 在同一采样网格上比较两条序列,不估计平移或时间规整。
  2. 逐坐标以两侧绝对幅值之和归一化绝对差。
  3. 按采样顺序累积局部贡献。
  4. 累加所有逐坐标相对误差。

解释与使用边界

  • 接近零的坐标可能影响很大;必须声明 0/0 的处理约定。
  • 采样对齐和幅值单位属于比较协议的一部分。
Example parameters / 示例参数
{
  "samples": 12,
  "preprocessing": "none",
  "domain": "strictly positive illustration"
}

Definition sources / 定义来源: SciPy: canberra

Bray-Curtis dissimilarity bray_curtisReference-formula demonstration
Bray-Curtis dissimilarity: static final state of the documented numerical example. distance = 0.075.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.075 — Exact formula evaluation on the displayed aligned vectors.

EchoTime coverage: Low-priority addition

sum_i abs(x_i-y_i) / sum_i abs(x_i+y_i)

Demonstration: Reference-formula demonstration

Bray-Curtis divides a total absolute discrepancy by a total combined magnitude. The denominator is global, unlike Canberra's coordinate-specific denominators. On the positive illustration it measures discrepancy relative to the combined mass. The displayed calculation uses the exact absolute-sum denominator in the imported registry and SciPy definition.

How the calculation works

  1. Keep the two series on the same sample grid; no shift or warping is estimated.
  2. Accumulate absolute gaps; the highlighted point supplies one coordinate contribution.
  3. Accumulate the coordinate contributions in sample order.
  4. Divide by the fixed total abs(x+y).

Interpretation and limits

  • Signed data can cause a zero or small denominator; the usual bounded interpretation assumes nonnegative data.
  • Sample alignment and amplitude units are part of the comparison protocol.

示例性质: 参考公式演示

Bray-Curtis 用总绝对差除以整体合并幅值。其分母是全局的,与 Canberra 逐坐标归一化不同。本例输入为正值,结果表示相对合并总量的差异;所示公式采用导入登记表及 SciPy 的绝对和分母。

计算步骤

  1. 在同一采样网格上比较两条序列,不估计平移或时间规整。
  2. 计算各坐标的绝对残差。
  3. 按采样顺序累积局部贡献。
  4. 用绝对差总和除以固定的 sum(abs(x+y))。

解释与使用边界

  • 带符号数据可能使分母为零或很小;通常的有界解释依赖非负输入。
  • 采样对齐和幅值单位属于比较协议的一部分。
Example parameters / 示例参数
{
  "samples": 12,
  "preprocessing": "none",
  "domain": "strictly positive illustration",
  "global_denominator": 72.0
}

Definition sources / 定义来源: SciPy: braycurtis

Sorensen-style dissimilarity sorensenReference-formula demonstration
Sorensen-style dissimilarity: static final state of the documented numerical example. distance = 0.075.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.075 — Exact formula evaluation on the displayed aligned vectors.

EchoTime coverage: Low-priority addition

sum_i abs(x_i-y_i) / sum_i (abs(x_i)+abs(y_i))

Demonstration: Reference-formula demonstration

This registry entry normalizes the absolute-error total by the sum of both vectors' absolute magnitudes. On nonnegative data it agrees with Bray-Curtis; signed data distinguish their denominators. The animation states the formula explicitly because the Sorensen name is also used for set-based coefficients with a different input object.

How the calculation works

  1. Keep the two series on the same sample grid; no shift or warping is estimated.
  2. Accumulate absolute gaps; the highlighted point supplies one coordinate contribution.
  3. Accumulate the coordinate contributions in sample order.
  4. Divide by total absolute mass of both vectors.

Interpretation and limits

  • This is the registry's numerical-vector convention, not the binary set Dice coefficient.
  • Sample alignment and amplitude units are part of the comparison protocol.

示例性质: 参考公式演示

此登记条目用两侧绝对幅值的总和归一化绝对误差总量。非负输入时它与 Bray-Curtis 相同,带符号输入时两者分母不同。Sorensen 也用于集合系数,因此本动图直接声明所演示的数值向量公式。

计算步骤

  1. 在同一采样网格上比较两条序列,不估计平移或时间规整。
  2. 计算各坐标的绝对残差。
  3. 按采样顺序累积局部贡献。
  4. 用绝对差总和除以两向量绝对幅值的总和。

解释与使用边界

  • 这里使用登记表的数值向量约定,与二元集合 Dice 系数的输入对象不同。
  • 采样对齐和幅值单位属于比较协议的一部分。
Example parameters / 示例参数
{
  "samples": 12,
  "preprocessing": "none",
  "domain": "strictly positive illustration",
  "global_denominator": 72.0
}

Definition sources / 定义来源: Imported registry: explicit formula convention

Soergel-style distance soergelReference-formula demonstration
Soergel-style distance: static final state of the documented numerical example. distance = 0.139535.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.13953488 — Exact formula evaluation on the displayed aligned vectors.

EchoTime coverage: Low-priority addition

sum_i abs(x_i-y_i) / sum_i max(abs(x_i),abs(y_i))

Demonstration: Reference-formula demonstration

The Soergel-style entry divides total absolute discrepancy by the sum of the larger magnitudes at each coordinate. The animation contrasts its fixed maximum-envelope denominator with the residual sum. Nonnegative vectors provide the standard overlap interpretation; the absolute-magnitude extension shown in the registry needs its signed-data convention kept explicit.

How the calculation works

  1. Keep the two series on the same sample grid; no shift or warping is estimated.
  2. Accumulate absolute gaps; the highlighted point supplies one coordinate contribution.
  3. Accumulate the coordinate contributions in sample order.
  4. Divide by the total maximum-magnitude envelope.

Interpretation and limits

  • The example uses nonnegative values; signed extensions need separate property checks.
  • Sample alignment and amplitude units are part of the comparison protocol.

示例性质: 参考公式演示

Soergel 型条目用各坐标较大幅值的总和归一化绝对误差。动图展示最大幅值包络分母与误差总和的关系。非负向量具有通常的重叠解释;登记表对带符号输入采用绝对幅值扩展,需要明确这一约定。

计算步骤

  1. 在同一采样网格上比较两条序列,不估计平移或时间规整。
  2. 计算各坐标的绝对残差。
  3. 按采样顺序累积局部贡献。
  4. 用绝对差总和除以各坐标较大绝对幅值的总和。

解释与使用边界

  • 本例使用非负值;带符号扩展的性质需要另行检查。
  • 采样对齐和幅值单位属于比较协议的一部分。
Example parameters / 示例参数
{
  "samples": 12,
  "preprocessing": "none",
  "domain": "strictly positive illustration",
  "global_denominator": 38.7
}

Definition sources / 定义来源: Imported registry: explicit formula convention

Kulczynski-style ratio kulczynskiReference-formula demonstration
Kulczynski-style ratio: static final state of the documented numerical example. distance = 0.162162.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.16216216 — Exact formula evaluation on the displayed aligned vectors.

EchoTime coverage: Low-priority addition

sum_i abs(x_i-y_i) / sum_i min(abs(x_i),abs(y_i))

Demonstration: Reference-formula demonstration

This registry convention compares total discrepancy with the smaller magnitude available at each coordinate. A small shared-magnitude denominator can amplify the result sharply. The animation exposes this denominator rather than hiding it in a generic distance score. Several different association coefficients share the Kulczynski name, so this particular formula is recorded explicitly.

How the calculation works

  1. Keep the two series on the same sample grid; no shift or warping is estimated.
  2. Accumulate absolute gaps; the highlighted point supplies one coordinate contribution.
  3. Accumulate the coordinate contributions in sample order.
  4. Divide by the total minimum shared magnitude.

Interpretation and limits

  • The ratio is undefined at zero shared mass and is not bounded by one.
  • Sample alignment and amplitude units are part of the comparison protocol.

示例性质: 参考公式演示

此登记约定用各坐标较小幅值的总和作为分母。共享幅值较小时,比值会显著放大。动图显式展示分母。Kulczynski 名称也用于其他关联系数,因此这里记录的只是所列的特定公式。

计算步骤

  1. 在同一采样网格上比较两条序列,不估计平移或时间规整。
  2. 计算各坐标的绝对残差。
  3. 按采样顺序累积局部贡献。
  4. 用绝对差总和除以各坐标较小绝对幅值的总和。

解释与使用边界

  • 共享总量为零时比值未定义,结果也不以 1 为上界。
  • 采样对齐和幅值单位属于比较协议的一部分。
Example parameters / 示例参数
{
  "samples": 12,
  "preprocessing": "none",
  "domain": "strictly positive illustration",
  "global_denominator": 33.3
}

Definition sources / 定义来源: Imported registry: explicit formula convention

Clark distance clarkReference-formula demonstration
Clark distance: static final state of the documented numerical example. distance = 0.300741.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.30074145 — Exact formula evaluation on the displayed aligned vectors.

EchoTime coverage: Low-priority addition

sqrt(sum_i (abs(x_i-y_i)/(abs(x_i)+abs(y_i)))^2)

Demonstration: Reference-formula demonstration

Clark distance forms a relative error at each coordinate, then takes an Euclidean norm of those ratios. It therefore differs from Canberra's straight sum of relative errors. The animation first exposes the local ratios and then squares and aggregates them, showing how one relatively discordant coordinate can dominate the combined score.

How the calculation works

  1. Keep the two series on the same sample grid; no shift or warping is estimated.
  2. Square the coordinate-wise relative error; the highlighted point supplies one coordinate contribution.
  3. Accumulate the coordinate contributions in sample order.
  4. Take the root of the sum of squared relative errors.

Interpretation and limits

  • The local zero-over-zero convention matters, especially for sparse signals.
  • Sample alignment and amplitude units are part of the comparison protocol.

示例性质: 参考公式演示

Clark 距离先形成逐坐标相对误差,再对这些比值求欧氏范数。它与直接累加相对误差的 Canberra 不同。动图先计算局部比值,再平方聚合,展示相对差异较大的位置如何影响总体结果。

计算步骤

  1. 在同一采样网格上比较两条序列,不估计平移或时间规整。
  2. 逐坐标计算相对绝对误差,再将比值平方。
  3. 按采样顺序累积局部贡献。
  4. 对相对误差平方和开平方。

解释与使用边界

  • 稀疏信号尤其需要明确局部 0/0 的处理约定。
  • 采样对齐和幅值单位属于比较协议的一部分。
Example parameters / 示例参数
{
  "samples": 12,
  "preprocessing": "none",
  "domain": "strictly positive illustration"
}

Definition sources / 定义来源: Imported registry: explicit formula convention

Wave-Hedges distance wave_hedgesReference-formula demonstration
Wave-Hedges distance: static final state of the documented numerical example. distance = 1.78943.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 1.7894273 — Exact formula evaluation on the displayed aligned vectors.

EchoTime coverage: Low-priority addition

sum_i abs(x_i-y_i)/max(abs(x_i),abs(y_i))

Demonstration: Reference-formula demonstration

Wave-Hedges normalizes each coordinate's absolute discrepancy by its larger magnitude and then adds the ratios. In contrast to a single global normalization, every active coordinate can contribute substantially regardless of its absolute scale. The animation illustrates the local maximum denominator on strictly positive data, avoiding an unstated zero-over-zero rule.

How the calculation works

  1. Keep the two series on the same sample grid; no shift or warping is estimated.
  2. Scale each gap by its larger local magnitude; the highlighted point supplies one coordinate contribution.
  3. Accumulate the coordinate contributions in sample order.
  4. Add the local maximum-normalized discrepancies.

Interpretation and limits

  • Sparse near-zero coordinates require a declared convention; signed inputs change the usual range.
  • Sample alignment and amplitude units are part of the comparison protocol.

示例性质: 参考公式演示

Wave-Hedges 用每个坐标较大的幅值归一化该点误差,再求和。与全局归一化相比,每个非零坐标都可能产生明显贡献,不取决于其绝对规模。本例使用严格正值,避免未声明的 0/0 规则。

计算步骤

  1. 在同一采样网格上比较两条序列,不估计平移或时间规整。
  2. 逐坐标以较大绝对幅值归一化绝对差。
  3. 按采样顺序累积局部贡献。
  4. 累加各坐标归一化后的误差。

解释与使用边界

  • 稀疏近零坐标需要声明约定;带符号输入会改变通常的取值范围。
  • 采样对齐和幅值单位属于比较协议的一部分。
Example parameters / 示例参数
{
  "samples": 12,
  "preprocessing": "none",
  "domain": "strictly positive illustration"
}

Definition sources / 定义来源: Imported registry: explicit formula convention

Lorentzian-style log distance lorentzianReference-formula demonstration
Lorentzian-style log distance: static final state of the documented numerical example. distance = 4.38044.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 4.3804448 — Exact formula evaluation on the displayed aligned vectors.

EchoTime coverage: Low-priority addition

sum_i log(1+abs(x_i-y_i))

Demonstration: Reference-formula demonstration

This Lorentzian-style entry applies a logarithm to each absolute residual before summing. The transformation compresses large residuals relative to a linear or squared penalty. Its animation compares raw residuals with the log-transformed contributions. The added constant one fixes an implicit amplitude scale, which must be meaningful for the data units.

How the calculation works

  1. Keep the two series on the same sample grid; no shift or warping is estimated.
  2. Apply log(1+absolute residual); the highlighted point supplies one coordinate contribution.
  3. Accumulate the coordinate contributions in sample order.
  4. Sum the log-compressed discrepancies.

Interpretation and limits

  • Changing measurement units changes the balance introduced by the constant one.
  • Sample alignment and amplitude units are part of the comparison protocol.

示例性质: 参考公式演示

此 Lorentzian 型条目先对每个绝对残差进行 log(1+误差) 变换,再累加。相较线性或平方惩罚,对数会压缩大误差。加数 1 隐含了幅值尺度,因此使用时必须考虑数据单位。

计算步骤

  1. 在同一采样网格上比较两条序列,不估计平移或时间规整。
  2. 逐坐标计算 log(1+绝对残差)。
  3. 按采样顺序累积局部贡献。
  4. 直接累加对数压缩后的局部贡献。

解释与使用边界

  • 改变测量单位会改变常数 1 所引入的尺度关系。
  • 采样对齐和幅值单位属于比较协议的一部分。
Example parameters / 示例参数
{
  "samples": 12,
  "preprocessing": "none",
  "domain": "strictly positive illustration"
}

Definition sources / 定义来源: Imported registry: explicit formula convention

Cosine similarity cosine_similarityReference-formula demonstration
Cosine similarity: static final state of the documented numerical example. similarity = 0.997559.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.9975587 —

EchoTime coverage: Low-priority addition

dot(x,y)/(||x||_2 ||y||_2)

Demonstration: Reference-formula demonstration

Cosine comparison uses the angle between two complete sample vectors. It divides their dot product by both vector norms and leaves the mean level intact. The animation shows the signed coordinate products and their norm-scaled accumulation, then applies the selected angular or one-minus transform when this card reports a distance.

How the calculation works

  1. Keep each full sample vector without mean subtraction.
  2. Compute vector norms and coordinate-wise products.
  3. Divide the product sum by the product of the two norms.
  4. Read the signed agreement coefficient.

Interpretation and limits

  • Zero-norm vectors have no defined angle; this example excludes them.
  • Positive scaling is removed but an additive offset changes the direction.
  • The normalized angular form is a metric on unit directions; 1-cosine generally fails the triangle inequality.

示例性质: 参考公式演示

余弦比较使用完整采样向量之间的夹角,以两向量范数乘积归一化点积,并保留均值水平。动图展示带符号坐标乘积及归一化累加;距离型条目随后应用反余弦或 1 减相似度变换。

计算步骤

  1. 保留完整采样向量,不去均值。
  2. 计算向量范数和逐坐标乘积。
  3. 以范数乘积归一化点积。
  4. 应用所示最终变换得到分数。

解释与使用边界

  • 零范数向量的夹角未定义,本例不包含此情形。
  • 正缩放被消除,但加性偏移会改变方向。
  • 归一化角距离在单位方向上是度量;1−余弦一般不满足三角不等式。
Example parameters / 示例参数
{
  "centering": false,
  "ranking": false,
  "tie_rule": "not applicable"
}

Definition sources / 定义来源: SciPy: cosine

Cosine distance cosine_distanceReference-formula demonstration
Cosine distance: static final state of the documented numerical example. distance = 0.0024413.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.0024412963 —

EchoTime coverage: Low-priority addition

1 - dot(x,y)/(||x||_2 ||y||_2)

Demonstration: Reference-formula demonstration

Cosine comparison uses the angle between two complete sample vectors. It divides their dot product by both vector norms and leaves the mean level intact. The animation shows the signed coordinate products and their norm-scaled accumulation, then applies the selected angular or one-minus transform when this card reports a distance.

How the calculation works

  1. Keep each full sample vector without mean subtraction.
  2. Compute vector norms and coordinate-wise products.
  3. Divide the product sum by the product of the two norms.
  4. Subtract similarity from one.

Interpretation and limits

  • Zero-norm vectors have no defined angle; this example excludes them.
  • Positive scaling is removed but an additive offset changes the direction.
  • The normalized angular form is a metric on unit directions; 1-cosine generally fails the triangle inequality.

示例性质: 参考公式演示

余弦比较使用完整采样向量之间的夹角,以两向量范数乘积归一化点积,并保留均值水平。动图展示带符号坐标乘积及归一化累加;距离型条目随后应用反余弦或 1 减相似度变换。

计算步骤

  1. 保留完整采样向量,不去均值。
  2. 计算向量范数和逐坐标乘积。
  3. 以范数乘积归一化点积。
  4. 应用所示最终变换得到分数。

解释与使用边界

  • 零范数向量的夹角未定义,本例不包含此情形。
  • 正缩放被消除,但加性偏移会改变方向。
  • 归一化角距离在单位方向上是度量;1−余弦一般不满足三角不等式。
Example parameters / 示例参数
{
  "centering": false,
  "ranking": false,
  "tie_rule": "not applicable"
}

Definition sources / 定义来源: SciPy: cosine

Angular distance angular_distanceReference-formula demonstration
Angular distance: static final state of the documented numerical example. distance = 0.0222466.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.022246606 —

EchoTime coverage: Low-priority addition

acos(cos(x,y))/pi

Demonstration: Reference-formula demonstration

Cosine comparison uses the angle between two complete sample vectors. It divides their dot product by both vector norms and leaves the mean level intact. The animation shows the signed coordinate products and their norm-scaled accumulation, then applies the selected angular or one-minus transform when this card reports a distance.

How the calculation works

  1. Keep each full sample vector without mean subtraction.
  2. Compute vector norms and coordinate-wise products.
  3. Divide the product sum by the product of the two norms.
  4. Apply arccos and divide by pi.

Interpretation and limits

  • Zero-norm vectors have no defined angle; this example excludes them.
  • Positive scaling is removed but an additive offset changes the direction.
  • The normalized angular form is a metric on unit directions; 1-cosine generally fails the triangle inequality.

示例性质: 参考公式演示

余弦比较使用完整采样向量之间的夹角,以两向量范数乘积归一化点积,并保留均值水平。动图展示带符号坐标乘积及归一化累加;距离型条目随后应用反余弦或 1 减相似度变换。

计算步骤

  1. 保留完整采样向量,不去均值。
  2. 计算向量范数和逐坐标乘积。
  3. 以范数乘积归一化点积。
  4. 应用所示最终变换得到分数。

解释与使用边界

  • 零范数向量的夹角未定义,本例不包含此情形。
  • 正缩放被消除,但加性偏移会改变方向。
  • 归一化角距离在单位方向上是度量;1−余弦一般不满足三角不等式。
Example parameters / 示例参数
{
  "centering": false,
  "ranking": false,
  "tie_rule": "not applicable"
}

Definition sources / 定义来源: SciPy: cosine

Pearson correlation pearson_similarityReference-formula demonstration
Pearson correlation: static final state of the documented numerical example. similarity = 0.989166.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.98916553 —

EchoTime coverage: Conceptually covered · pearson_r

corr(x,y)

Demonstration: Reference-formula demonstration

Pearson correlation measures linear co-variation of aligned observations after centering both vectors. The animation reveals each centered-product contribution and normalizes by the full centered norms. Positive correlation, anticorrelation and weak linear association remain different outcomes; a distance card applies the explicit one-minus transform to the same coefficient.

How the calculation works

  1. Pair observations at the same sample index.
  2. Subtract the mean from each series independently.
  3. Sum centered products and divide by centered vector norms.
  4. Read the signed agreement coefficient.

Interpretation and limits

  • Constant inputs have undefined statistical correlation; zero-return conventions are software-specific.
  • Correlation describes linear dependence, not matching units or causal influence.
  • 1-r is a dissimilarity and generally fails the triangle inequality.

示例性质: 参考公式演示

Pearson 相关衡量对齐观测去均值后的线性协同变化。动图逐项展示中心化乘积,再用完整中心化向量的范数归一化。正相关、负相关和弱线性关系具有不同含义;距离条目显式使用 1 减相关系数。

计算步骤

  1. 按相同采样位置配对观测。
  2. 分别减去各自均值。
  3. 累加中心化乘积并按范数归一化。
  4. 读取相关系数或其 1 减变换。

解释与使用边界

  • 常量输入的统计相关未定义;返回零属于软件约定。
  • 相关描述线性依赖,不代表单位相同或因果作用。
  • 1−r 属于差异量,一般不满足三角不等式。
Example parameters / 示例参数
{
  "centering": true,
  "ranking": false,
  "tie_rule": "not applicable"
}

Definition sources / 定义来源: SciPy: correlation

Pearson distance pearson_distanceReference-formula demonstration
Pearson distance: static final state of the documented numerical example. distance = 0.0108345.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.010834469 —

EchoTime coverage: Conceptually covered · pearson_r

1 - corr(x,y)

Demonstration: Reference-formula demonstration

Pearson correlation measures linear co-variation of aligned observations after centering both vectors. The animation reveals each centered-product contribution and normalizes by the full centered norms. Positive correlation, anticorrelation and weak linear association remain different outcomes; a distance card applies the explicit one-minus transform to the same coefficient.

How the calculation works

  1. Pair observations at the same sample index.
  2. Subtract the mean from each series independently.
  3. Sum centered products and divide by centered vector norms.
  4. Subtract similarity from one.

Interpretation and limits

  • Constant inputs have undefined statistical correlation; zero-return conventions are software-specific.
  • Correlation describes linear dependence, not matching units or causal influence.
  • 1-r is a dissimilarity and generally fails the triangle inequality.

示例性质: 参考公式演示

Pearson 相关衡量对齐观测去均值后的线性协同变化。动图逐项展示中心化乘积,再用完整中心化向量的范数归一化。正相关、负相关和弱线性关系具有不同含义;距离条目显式使用 1 减相关系数。

计算步骤

  1. 按相同采样位置配对观测。
  2. 分别减去各自均值。
  3. 累加中心化乘积并按范数归一化。
  4. 读取相关系数或其 1 减变换。

解释与使用边界

  • 常量输入的统计相关未定义;返回零属于软件约定。
  • 相关描述线性依赖,不代表单位相同或因果作用。
  • 1−r 属于差异量,一般不满足三角不等式。
Example parameters / 示例参数
{
  "centering": true,
  "ranking": false,
  "tie_rule": "not applicable"
}

Definition sources / 定义来源: SciPy: correlation

Spearman rank correlation spearman_similarityReference-formula demonstration
Spearman rank correlation: static final state of the documented numerical example. similarity = 0.991214.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.99121418 —

EchoTime coverage: Conceptually covered · spearman_rho

corr(rank_average(x),rank_average(y))

Demonstration: Reference-formula demonstration

Spearman correlation replaces amplitudes by their ranks and then computes Pearson correlation of those ranks. Tied observations receive average ranks in this example. The animation makes this change of representation explicit: a monotone nonlinear amplitude transformation can retain rank agreement even when the raw scatter is not a straight line.

How the calculation works

  1. Pair observations and retain their original sample identities.
  2. Replace amplitudes with average ranks, including ties.
  3. Compute Pearson correlation of the two rank vectors.
  4. Read the signed agreement coefficient.

Interpretation and limits

  • Amplitude differences are intentionally discarded by ranking.
  • A nonmonotone dependence may be strong while Spearman correlation is weak.
  • The chosen tie rule and missing-value handling belong to the definition.

示例性质: 参考公式演示

Spearman 相关先把幅值转换成排名,再计算排名的 Pearson 相关。本例对并列值使用平均排名。动图显式展示表示变换:单调非线性幅值变换即使改变原始散点的线性关系,仍可能保留排名一致性。

计算步骤

  1. 配对观测并保留原始采样身份。
  2. 将幅值替换为含并列处理的平均排名。
  3. 计算两组排名的 Pearson 相关。
  4. 读取排名相关或其 1 减变换。

解释与使用边界

  • 排名主动舍弃幅值差异。
  • 强非单调依赖也可能具有很弱的 Spearman 相关。
  • 并列排名和缺失值处理属于定义的一部分。
Example parameters / 示例参数
{
  "centering": true,
  "ranking": true,
  "tie_rule": "average rank or tau-b correction"
}

Definition sources / 定义来源: SciPy: spearmanr

Spearman distance spearman_distanceReference-formula demonstration
Spearman distance: static final state of the documented numerical example. distance = 0.00878582.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.0087858154 —

EchoTime coverage: Conceptually covered · spearman_rho

1 - corr(rank_average(x),rank_average(y))

Demonstration: Reference-formula demonstration

Spearman correlation replaces amplitudes by their ranks and then computes Pearson correlation of those ranks. Tied observations receive average ranks in this example. The animation makes this change of representation explicit: a monotone nonlinear amplitude transformation can retain rank agreement even when the raw scatter is not a straight line.

How the calculation works

  1. Pair observations and retain their original sample identities.
  2. Replace amplitudes with average ranks, including ties.
  3. Compute Pearson correlation of the two rank vectors.
  4. Subtract similarity from one.

Interpretation and limits

  • Amplitude differences are intentionally discarded by ranking.
  • A nonmonotone dependence may be strong while Spearman correlation is weak.
  • The chosen tie rule and missing-value handling belong to the definition.

示例性质: 参考公式演示

Spearman 相关先把幅值转换成排名,再计算排名的 Pearson 相关。本例对并列值使用平均排名。动图显式展示表示变换:单调非线性幅值变换即使改变原始散点的线性关系,仍可能保留排名一致性。

计算步骤

  1. 配对观测并保留原始采样身份。
  2. 将幅值替换为含并列处理的平均排名。
  3. 计算两组排名的 Pearson 相关。
  4. 读取排名相关或其 1 减变换。

解释与使用边界

  • 排名主动舍弃幅值差异。
  • 强非单调依赖也可能具有很弱的 Spearman 相关。
  • 并列排名和缺失值处理属于定义的一部分。
Example parameters / 示例参数
{
  "centering": true,
  "ranking": true,
  "tie_rule": "average rank or tau-b correction"
}

Definition sources / 定义来源: SciPy: spearmanr

Kendall tau-b kendall_similarityReference-formula demonstration
Kendall tau-b: static final state of the documented numerical example. similarity = 0.961269.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.96126919 —

EchoTime coverage: Conceptually covered · kendall_tau

(C-D)/sqrt((C+D+T_x)*(C+D+T_y))

Demonstration: Reference-formula demonstration

Kendall tau-b compares the ordering of every pair of aligned observations. Concordant and discordant pairs contribute with opposite signs, while one-sided ties alter the normalization. The animation exposes the pairwise sign matrix and count table. This implementation uses tau-b, so its treatment of ties is not replaced by a no-ties shortcut.

How the calculation works

  1. Enumerate unordered observation pairs.
  2. Classify each pair as concordant, discordant or tied.
  3. Count one-sided ties separately; joint ties enter neither tie term.
  4. Apply tau-b normalization, then 1-tau if this is the distance variant.

Interpretation and limits

  • Ordering does not preserve the magnitude of differences.
  • A zero normalization denominator leaves tau undefined; the illustration avoids this case.
  • The animated pair enumeration is educational; optimized software need not enumerate all pairs explicitly.

示例性质: 参考公式演示

Kendall tau-b 比较每对对齐观测的顺序关系。同序和逆序配对贡献相反符号,单侧并列值改变归一化。动图展示配对符号矩阵与计数表,使用含并列校正的 tau-b,不用无并列情形的简化公式替代。

计算步骤

  1. 枚举无序观测配对。
  2. 判断同序、逆序或并列。
  3. 分别统计单侧并列;双侧并列不进入单侧并列项。
  4. 应用 tau-b 归一化;距离型再取 1−tau。

解释与使用边界

  • 顺序关系不保留差异幅度。
  • 归一化分母为零时 tau 未定义,本例避开此情形。
  • 动画显式枚举配对用于教学;优化软件无需逐对枚举。
Example parameters / 示例参数
{
  "centering": true,
  "ranking": true,
  "tie_rule": "average rank or tau-b correction"
}

Definition sources / 定义来源: SciPy: kendalltau

Kendall distance kendall_distanceReference-formula demonstration
Kendall distance: static final state of the documented numerical example. distance = 0.0387308.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.038730807 —

EchoTime coverage: Conceptually covered · kendall_tau

1 - (C-D)/sqrt((C+D+T_x)*(C+D+T_y))

Demonstration: Reference-formula demonstration

Kendall tau-b compares the ordering of every pair of aligned observations. Concordant and discordant pairs contribute with opposite signs, while one-sided ties alter the normalization. The animation exposes the pairwise sign matrix and count table. This implementation uses tau-b, so its treatment of ties is not replaced by a no-ties shortcut.

How the calculation works

  1. Enumerate unordered observation pairs.
  2. Classify each pair as concordant, discordant or tied.
  3. Count one-sided ties separately; joint ties enter neither tie term.
  4. Apply tau-b normalization, then 1-tau if this is the distance variant.

Interpretation and limits

  • Ordering does not preserve the magnitude of differences.
  • A zero normalization denominator leaves tau undefined; the illustration avoids this case.
  • The animated pair enumeration is educational; optimized software need not enumerate all pairs explicitly.

示例性质: 参考公式演示

Kendall tau-b 比较每对对齐观测的顺序关系。同序和逆序配对贡献相反符号,单侧并列值改变归一化。动图展示配对符号矩阵与计数表,使用含并列校正的 tau-b,不用无并列情形的简化公式替代。

计算步骤

  1. 枚举无序观测配对。
  2. 判断同序、逆序或并列。
  3. 分别统计单侧并列;双侧并列不进入单侧并列项。
  4. 应用 tau-b 归一化;距离型再取 1−tau。

解释与使用边界

  • 顺序关系不保留差异幅度。
  • 归一化分母为零时 tau 未定义,本例避开此情形。
  • 动画显式枚举配对用于教学;优化软件无需逐对枚举。
Example parameters / 示例参数
{
  "centering": true,
  "ranking": true,
  "tie_rule": "average rank or tau-b correction"
}

Definition sources / 定义来源: SciPy: kendalltau

Jensen-Shannon distance jensen_shannonReference-formula demonstration
Jensen-Shannon distance: static final state of the documented numerical example. distance = 0.170799.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.17079871 —

EchoTime coverage: Conceptually covered · spectral_similarity

sqrt(0.5*KL(p||m)+0.5*KL(q||m)); m=(p+q)/2; natural logarithm

Demonstration: Reference-formula demonstration

Jensen-Shannon distance compares two probability vectors through their midpoint distribution. Each side contributes a KL divergence to that midpoint, the two values are averaged, and the square root produces the distance shown here. The animated bins share a fixed support; their positions describe probability mass rather than a time-warping alignment.

How the calculation works

  1. Declare one shared bin support and normalize nonnegative mass to sum to one.
  2. Compute each bin's two-sided KL-to-midpoint contribution.
  3. Accumulate the displayed bin contributions, retaining any signed terms.
  4. Take the square root of the averaged divergence.

Interpretation and limits

  • This card shows the square root, not raw JS divergence.
  • Logarithm base changes the scale; natural logs are used here.

示例性质: 参考公式演示

Jensen-Shannon 距离以两概率向量的中点分布作为共同参照,平均两侧到中点的 KL 散度,再开平方。本动画使用固定共同支持集;横轴位置表示概率质量所在的箱,而不是时间规整的匹配位置。

计算步骤

  1. 声明共同箱支持集,将非负质量归一化为概率。
  2. 按该方法公式计算逐箱贡献。
  3. 累加所示贡献,保留可能出现的符号。
  4. 应用所示最后的根号、对数或直接求和。

解释与使用边界

  • 本条目展示平方根形式,并非原始 JS 散度。
  • 对数底改变数值尺度,本例使用自然对数。
Example parameters / 示例参数
{
  "probability_p": [
    0.030303030303030304,
    0.09090909090909091,
    0.18181818181818182,
    0.2727272727272727,
    0.21212121212121213,
    0.12121212121212122,
    0.06060606060606061,
    0.030303030303030304
  ],
  "probability_q": [
    0.029411764705882353,
    0.058823529411764705,
    0.08823529411764706,
    0.17647058823529413,
    0.2647058823529412,
    0.20588235294117646,
    0.11764705882352941,
    0.058823529411764705
  ],
  "log_base": "e",
  "smoothing": "none",
  "support": "eight shared illustrative bins"
}

Definition sources / 定义来源: SciPy: jensenshannon

Kullback-Leibler divergence kl_divergenceReference-formula demonstration
Kullback-Leibler divergence: static final state of the documented numerical example. divergence = 0.119167.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative divergence: 0.11916686 —

EchoTime coverage: Low-priority addition

KL(p||q)=sum_i p_i*log(p_i/q_i); natural logarithm

Demonstration: Reference-formula demonstration

KL divergence weights each log probability ratio by the mass of the first distribution. Individual bin contributions can be negative even though the complete divergence is nonnegative. The animation retains those signed contributions and a declared direction p to q. Changing the order of the distributions generally changes the answer.

How the calculation works

  1. Declare one shared bin support and normalize nonnegative mass to sum to one.
  2. Weight log(p/q) by p.
  3. Accumulate the displayed bin contributions, retaining any signed terms.
  4. Add signed bin terms in the declared p-to-q direction.

Interpretation and limits

  • If p is positive where q is zero, KL is infinite; both vectors here are strictly positive.
  • KL is asymmetric and does not obey the metric triangle inequality.

示例性质: 参考公式演示

KL 散度用第一个分布的概率质量加权对数概率比。单箱贡献可以为负,而完整散度非负。动画保留这些带符号贡献,并明确方向为 p 到 q;交换两分布通常改变结果。

计算步骤

  1. 声明共同箱支持集,将非负质量归一化为概率。
  2. 按该方法公式计算逐箱贡献。
  3. 累加所示贡献,保留可能出现的符号。
  4. 应用所示最后的根号、对数或直接求和。

解释与使用边界

  • 若 p 在 q 为零处为正,KL 为无穷;本例两侧均严格为正。
  • KL 不对称,也不满足度量三角不等式。
Example parameters / 示例参数
{
  "probability_p": [
    0.030303030303030304,
    0.09090909090909091,
    0.18181818181818182,
    0.2727272727272727,
    0.21212121212121213,
    0.12121212121212122,
    0.06060606060606061,
    0.030303030303030304
  ],
  "probability_q": [
    0.029411764705882353,
    0.058823529411764705,
    0.08823529411764706,
    0.17647058823529413,
    0.2647058823529412,
    0.20588235294117646,
    0.11764705882352941,
    0.058823529411764705
  ],
  "log_base": "e",
  "smoothing": "none",
  "support": "eight shared illustrative bins"
}

Definition sources / 定义来源: SciPy: entropy

Jeffreys divergence jeffreys_divergenceReference-formula demonstration
Jeffreys divergence: static final state of the documented numerical example. divergence = 0.23681.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative divergence: 0.23680981 —

EchoTime coverage: Low-priority addition

KL(p||q)+KL(q||p)=sum_i (p_i-q_i)*log(p_i/q_i)

Demonstration: Reference-formula demonstration

Jeffreys divergence adds KL divergences in both directions. On strictly positive probabilities the two terms combine into a per-bin product of the probability difference and its log ratio. The animation shows this symmetric contribution directly. Symmetrizing KL removes its directional asymmetry while leaving a divergence whose metric properties need separate analysis.

How the calculation works

  1. Declare one shared bin support and normalize nonnegative mass to sum to one.
  2. Combine KL terms in both directions.
  3. Accumulate the displayed bin contributions, retaining any signed terms.
  4. Sum the symmetric log-ratio contributions.

Interpretation and limits

  • Symmetry alone does not establish a metric.
  • A support mismatch can make the result infinite; no smoothing is hidden in this illustration.

示例性质: 参考公式演示

Jeffreys 散度相加两个方向的 KL 散度。概率严格为正时,可逐箱写成概率差与对数比的乘积。动图直接展示该对称贡献;对称化消除了方向不对称,但不能自动赋予其度量性质。

计算步骤

  1. 声明共同箱支持集,将非负质量归一化为概率。
  2. 按该方法公式计算逐箱贡献。
  3. 累加所示贡献,保留可能出现的符号。
  4. 应用所示最后的根号、对数或直接求和。

解释与使用边界

  • 对称性本身不能证明度量性质。
  • 支持集不匹配可能使结果无穷;本例没有隐藏平滑。
Example parameters / 示例参数
{
  "probability_p": [
    0.030303030303030304,
    0.09090909090909091,
    0.18181818181818182,
    0.2727272727272727,
    0.21212121212121213,
    0.12121212121212122,
    0.06060606060606061,
    0.030303030303030304
  ],
  "probability_q": [
    0.029411764705882353,
    0.058823529411764705,
    0.08823529411764706,
    0.17647058823529413,
    0.2647058823529412,
    0.20588235294117646,
    0.11764705882352941,
    0.058823529411764705
  ],
  "log_base": "e",
  "smoothing": "none",
  "support": "eight shared illustrative bins"
}

Definition sources / 定义来源: SciPy: entropy; Imported registry: two-sided KL convention

Bhattacharyya distance bhattacharyya_distanceReference-formula demonstration
Bhattacharyya distance: static final state of the documented numerical example. distance = 0.0298249.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.029824886 —

EchoTime coverage: Low-priority addition

-log(sum_i sqrt(p_i*q_i))

Demonstration: Reference-formula demonstration

Bhattacharyya distance first adds the geometric-mean overlap of corresponding probability masses. It then applies a negative logarithm, so greater overlap gives a smaller distance. The animation separates the overlap coefficient from the final transformed score. The supplied positive distributions overlap everywhere, making the logarithm finite without a numerical floor.

How the calculation works

  1. Declare one shared bin support and normalize nonnegative mass to sum to one.
  2. Compute geometric-mean overlap in each bin.
  3. Accumulate the displayed bin contributions, retaining any signed terms.
  4. Apply negative log to the full overlap coefficient.

Interpretation and limits

  • Disjoint support gives zero overlap and infinite distance.
  • This log-overlap quantity generally lacks the triangle inequality.

示例性质: 参考公式演示

Bhattacharyya 距离先累加对应概率质量的几何平均重叠,再取负对数,使更大重叠对应更小距离。动画区分重叠系数和最终变换结果。本例各箱概率为正,无需数值下限即可保证对数有限。

计算步骤

  1. 声明共同箱支持集,将非负质量归一化为概率。
  2. 按该方法公式计算逐箱贡献。
  3. 累加所示贡献,保留可能出现的符号。
  4. 应用所示最后的根号、对数或直接求和。

解释与使用边界

  • 支持集不相交时重叠为零、距离为无穷。
  • 该负对数重叠量一般不满足三角不等式。
Example parameters / 示例参数
{
  "probability_p": [
    0.030303030303030304,
    0.09090909090909091,
    0.18181818181818182,
    0.2727272727272727,
    0.21212121212121213,
    0.12121212121212122,
    0.06060606060606061,
    0.030303030303030304
  ],
  "probability_q": [
    0.029411764705882353,
    0.058823529411764705,
    0.08823529411764706,
    0.17647058823529413,
    0.2647058823529412,
    0.20588235294117646,
    0.11764705882352941,
    0.058823529411764705
  ],
  "log_base": "e",
  "smoothing": "none",
  "support": "eight shared illustrative bins"
}

Definition sources / 定义来源: Imported registry: overlap definition

Hellinger distance hellinger_distanceReference-formula demonstration
Hellinger distance: static final state of the documented numerical example. distance = 0.171419.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.17141912 —

EchoTime coverage: Low-priority addition

sqrt(0.5*sum_i (sqrt(p_i)-sqrt(q_i))^2)

Demonstration: Reference-formula demonstration

Hellinger distance compares square-root probability vectors using a scaled Euclidean distance. The animation shows how transforming probabilities changes the coordinate gaps before squaring and accumulation. The factor one half inside the root fixes the common zero-to-one normalization. Shared bin definitions are essential because each square-root mass is compared with its corresponding bin.

How the calculation works

  1. Declare one shared bin support and normalize nonnegative mass to sum to one.
  2. Square the difference between square-root masses; divide by two.
  3. Accumulate the displayed bin contributions, retaining any signed terms.
  4. Take the square root of the accumulated contributions.

Interpretation and limits

  • This convention includes the factor 1/sqrt(2); some sources omit it.
  • A distance between histograms does not preserve the temporal order that generated them.

示例性质: 参考公式演示

Hellinger 距离对概率开平方后,计算缩放的欧氏距离。动画展示变换如何改变坐标差,再平方累加。根号内的二分之一确定常见的 0 到 1 归一化。每个概率质量必须对应相同的箱定义。

计算步骤

  1. 声明共同箱支持集,将非负质量归一化为概率。
  2. 按该方法公式计算逐箱贡献。
  3. 累加所示贡献,保留可能出现的符号。
  4. 应用所示最后的根号、对数或直接求和。

解释与使用边界

  • 此约定包含 1/√2 因子,部分资料会省略。
  • 直方图间距离不保留生成它们的原始时间顺序。
Example parameters / 示例参数
{
  "probability_p": [
    0.030303030303030304,
    0.09090909090909091,
    0.18181818181818182,
    0.2727272727272727,
    0.21212121212121213,
    0.12121212121212122,
    0.06060606060606061,
    0.030303030303030304
  ],
  "probability_q": [
    0.029411764705882353,
    0.058823529411764705,
    0.08823529411764706,
    0.17647058823529413,
    0.2647058823529412,
    0.20588235294117646,
    0.11764705882352941,
    0.058823529411764705
  ],
  "log_base": "e",
  "smoothing": "none",
  "support": "eight shared illustrative bins"
}

Definition sources / 定义来源: Imported registry: normalized Hellinger formula

Symmetric chi-square distance chi_square_distanceReference-formula demonstration
Symmetric chi-square distance: static final state of the documented numerical example. distance = 0.0575205.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.057520512 —

EchoTime coverage: Low-priority addition

0.5*sum_i (p_i-q_i)^2/(p_i+q_i)

Demonstration: Reference-formula demonstration

This symmetric chi-square histogram distance divides squared probability differences by the combined mass of each bin, then sums half of those ratios. Small-mass bins can matter disproportionately relative to unweighted squared error. The animation follows the exact symmetric convention in the registry; it does not perform a statistical chi-square hypothesis test.

How the calculation works

  1. Declare one shared bin support and normalize nonnegative mass to sum to one.
  2. Divide squared bin differences by combined probability mass.
  3. Accumulate the displayed bin contributions, retaining any signed terms.
  4. Sum half of the mass-scaled squared differences.

Interpretation and limits

  • The name also denotes other asymmetric distances and test statistics; use the displayed formula.
  • A zero-over-zero bin needs an explicit zero contribution convention.

示例性质: 参考公式演示

此对称卡方直方图距离用每箱概率和归一化平方概率差,再累加其一半。低概率箱相较无权平方误差可能获得更高影响。动画遵循登记表的对称定义,不进行卡方假设检验。

计算步骤

  1. 声明共同箱支持集,将非负质量归一化为概率。
  2. 按该方法公式计算逐箱贡献。
  3. 累加所示贡献,保留可能出现的符号。
  4. 应用所示最后的根号、对数或直接求和。

解释与使用边界

  • 该名称还用于非对称距离和检验统计量,应以所示公式为准。
  • 两侧均为零的箱需要显式约定贡献为零。
Example parameters / 示例参数
{
  "probability_p": [
    0.030303030303030304,
    0.09090909090909091,
    0.18181818181818182,
    0.2727272727272727,
    0.21212121212121213,
    0.12121212121212122,
    0.06060606060606061,
    0.030303030303030304
  ],
  "probability_q": [
    0.029411764705882353,
    0.058823529411764705,
    0.08823529411764706,
    0.17647058823529413,
    0.2647058823529412,
    0.20588235294117646,
    0.11764705882352941,
    0.058823529411764705
  ],
  "log_base": "e",
  "smoothing": "none",
  "support": "eight shared illustrative bins"
}

Definition sources / 定义来源: Imported registry: symmetric chi-square convention

Standardized Euclidean seuclidean_distanceReference-formula demonstration
Standardized Euclidean: static final state of the documented numerical example. distance = 1.53471.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 1.5347089 —

EchoTime coverage: Low-priority addition

sqrt(sum_i (x_i-y_i)^2 / v_i), with fixed v_i > 0

Demonstration: Reference-formula demonstration

Standardized Euclidean distance divides each squared coordinate residual by a supplied variance. Coordinates with greater reference variation receive less weight. This animation uses an explicit, fixed variance vector, so the comparison does not secretly estimate scale from the two sequences being scored. The final root gives a distance in variance-standardized coordinates.

How the calculation works

  1. Align samples and provide a positive reference variance for every coordinate.
  2. Square each residual and divide it by that coordinate's variance.
  3. Sum the standardized squared contributions.
  4. Take the square root; retain the same variance vector for future comparisons.

Interpretation and limits

  • Zero variances need an explicit exclusion or regularization policy.
  • Estimating variances using test data can leak information; use a declared reference fit.

示例性质: 参考公式演示

标准化欧氏距离用给定方差缩放每个坐标的平方残差。参考变化更大的坐标权重较低。本动图使用显式固定的方差向量,不从待比较的两条序列暗中估计尺度,最后开平方得到标准化坐标空间中的距离。

计算步骤

  1. 对齐采样点,为每个坐标提供正的参考方差。
  2. 平方残差后除以对应坐标的方差。
  3. 累加标准化平方项。
  4. 开平方;后续比较保持同一参考方差。

解释与使用边界

  • 零方差需要明确的剔除或正则化策略。
  • 用测试数据估计方差可能泄漏信息;应声明参考拟合来源。
Example parameters / 示例参数
{
  "variance": [
    0.4,
    0.6,
    1.0,
    1.5,
    2.0,
    1.3,
    0.9,
    0.7,
    1.1,
    1.7,
    1.8,
    1.2
  ],
  "variance_source": "fixed illustrative vector"
}

Definition sources / 定义来源: SciPy: seuclidean

Z-normalized Euclidean znorm_euclideanReference-formula demonstration
Z-normalized Euclidean: static final state of the documented numerical example. distance = 1.39814.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 1.3981405 —

EchoTime coverage: Low-priority addition

||z(x)-z(y)||_2; z(x)=(x-mean(x))/std(x, ddof=0)

Demonstration: Reference-formula demonstration

Z-normalized Euclidean first removes each sequence's own mean and divides by its standard deviation. The final Euclidean comparison therefore emphasizes the shape remaining on a common time grid. The input illustration deliberately includes an offset and gain difference so the normalized traces visibly differ from the raw signals.

How the calculation works

  1. Estimate each series' own mean and population standard deviation.
  2. Subtract that mean and divide by that standard deviation.
  3. Accumulate squared normalized gaps.
  4. Take the square root of the total.

Interpretation and limits

  • Positive gain and offset information is deliberately removed; distinct raw series can have zero distance.
  • Constant sequences need a separately declared convention; this illustration has positive variance.

示例性质: 参考公式演示

Z 标准化 Euclidean 比较先分别减去每条序列的均值,再除以各自标准差,随后在共同时间网格上比较标准化形状。本例刻意加入偏移和增益差,使原始信号与标准化后的曲线形成清晰对照。

计算步骤

  1. 分别估计每条序列的均值和总体标准差。
  2. 分别去均值并除以标准差。
  3. 累加标准化后的平方差。
  4. 对总和开平方。

解释与使用边界

  • 正增益和偏移信息被主动去除;不同原序列可能距离为零。
  • 常量序列必须另行规定处理方式;本例方差严格为正。
Example parameters / 示例参数
{
  "ddof": 0,
  "norm": 2,
  "means": [
    2.966666666666667,
    8.46
  ],
  "standard_deviations": [
    1.0378931651293508,
    2.1466252583997987
  ]
}

Definition sources / 定义来源: Imported registry: normalization convention; SciPy: euclidean

Z-normalized Manhattan znorm_manhattanReference-formula demonstration
Z-normalized Manhattan: static final state of the documented numerical example. distance = 4.4079.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 4.4079033 —

EchoTime coverage: Low-priority addition

||z(x)-z(y)||_1; z(x)=(x-mean(x))/std(x, ddof=0)

Demonstration: Reference-formula demonstration

Z-normalized Manhattan first removes each sequence's own mean and divides by its standard deviation. The final Manhattan comparison therefore emphasizes the shape remaining on a common time grid. The input illustration deliberately includes an offset and gain difference so the normalized traces visibly differ from the raw signals.

How the calculation works

  1. Estimate each series' own mean and population standard deviation.
  2. Subtract that mean and divide by that standard deviation.
  3. Accumulate absolute normalized gaps.
  4. Keep the absolute-gap total.

Interpretation and limits

  • Positive gain and offset information is deliberately removed; distinct raw series can have zero distance.
  • Constant sequences need a separately declared convention; this illustration has positive variance.

示例性质: 参考公式演示

Z 标准化 Manhattan 比较先分别减去每条序列的均值,再除以各自标准差,随后在共同时间网格上比较标准化形状。本例刻意加入偏移和增益差,使原始信号与标准化后的曲线形成清晰对照。

计算步骤

  1. 分别估计每条序列的均值和总体标准差。
  2. 分别去均值并除以标准差。
  3. 累加标准化后的绝对差。
  4. 保留绝对差总和。

解释与使用边界

  • 正增益和偏移信息被主动去除;不同原序列可能距离为零。
  • 常量序列必须另行规定处理方式;本例方差严格为正。
Example parameters / 示例参数
{
  "ddof": 0,
  "norm": 1,
  "means": [
    2.966666666666667,
    8.46
  ],
  "standard_deviations": [
    1.0378931651293508,
    2.1466252583997987
  ]
}

Definition sources / 定义来源: Imported registry: normalization convention; SciPy: cityblock

Complexity-invariant distance cid_distanceReference-formula demonstration
Complexity-invariant distance: static final state of the documented numerical example. distance = 2.18702.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 2.1870197 —

EchoTime coverage: Low-priority addition

CID=||x-y||_2 * max(CE(x),CE(y))/min(CE(x),CE(y)); CE(x)=||diff(x)||_2

Demonstration: Reference-formula demonstration

CID multiplies a base Euclidean distance by the ratio of the larger to the smaller series complexity. Here complexity is the Euclidean length of the first-difference vector. The animation separately computes the baseline mismatch, both complexity estimates and their correction factor; its name does not establish invariance to every possible change in complexity.

How the calculation works

  1. Compute the ordinary Euclidean distance on aligned samples.
  2. Form first differences and sum their squared values for each series.
  3. Take both roots and divide the larger complexity by the smaller.
  4. Multiply the baseline distance by this complexity ratio.

Interpretation and limits

  • A constant series has zero complexity; the correction needs an explicit boundary rule.
  • The estimator depends on sampling and noise; this animation makes no accuracy or universal invariance claim.

示例性质: 参考公式演示

CID 用较大与较小复杂度之比修正欧氏距离。本例复杂度定义为一阶差分向量的欧氏长度。动图依次计算基准差异、两侧复杂度及修正因子;名称并不意味着对所有改变复杂度的操作都严格不变。

计算步骤

  1. 计算对齐样本的欧氏距离。
  2. 分别计算一阶差分及平方和。
  3. 分别开平方,用较大复杂度除以较小复杂度。
  4. 以复杂度比乘以基准距离。

解释与使用边界

  • 常量序列的复杂度为零,修正项需要明确的边界规则。
  • 估计值依赖采样和噪声;此动图不提供准确率或普遍不变性结论。
Example parameters / 示例参数
{
  "base_distance": "Euclidean",
  "complexity": "L2 norm of first differences",
  "CE_x": 2.791057147390572,
  "CE_y": 3.6742346141747673
}

Definition sources / 定义来源: Batista, Wang and Keogh: original CID paper

Shifts and lead–lag relationships / 平移与领先滞后 12
Maximum normalized cross-correlation max_normalized_cross_correlationChecked against EchoTime
Maximum normalized cross-correlation: static final state of the documented numerical example. similarity = 0.930596.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.93059631 —

EchoTime coverage: Implemented in EchoTime · max_ncc

max_lag sum_overlap z(x)[i]*z(y)[i-lag] / (||z(x)||_2*||z(y)||_2)

Demonstration: Checked against EchoTime

Maximum NCC finds the global integer shift with the largest normalized cross-correlation. EchoTime first z-normalizes each full series, then uses full-series norms at every lag. The animation shows overlap pairs and the complete lag profile, including the reduced overlap near the boundaries.

How the calculation works

  1. Z-normalize both complete series once.
  2. Slide through all integer lags and match only overlapping samples.
  3. Divide each overlap dot product by the same full-series norm product.
  4. Select the largest NCC and record its lag.

Interpretation and limits

  • This is a global shift, not local time warping.
  • Full-norm zero-padding NCC differs from Pearson or cosine re-normalized on each overlap.
  • Constant series have undefined statistical correlation; EchoTime retains a zero-NCC convention for zero energy.

示例性质: 已与 EchoTime 计算核对

最大 NCC 寻找归一化互相关最大的全局整数平移。EchoTime 先对完整序列分别进行 Z 标准化,再在每个滞后位置使用固定的完整序列范数。动画显示重叠配对与完整滞后曲线,包括边界附近的较短重叠。

计算步骤

  1. 对两条完整序列分别进行 Z 标准化。
  2. 遍历整数滞后,仅匹配重叠样本。
  3. 以固定的完整序列范数乘积归一化各重叠点积。
  4. 选取最大 NCC 并记录滞后。

解释与使用边界

  • 这里估计全局平移,不进行局部时间规整。
  • 固定全范数的补零 NCC 与在各重叠片段重新归一化的 Pearson 或余弦不同。
  • 常量信号的统计相关未定义;EchoTime 对零能量保留零 NCC 的约定。
Example parameters / 示例参数
{
  "normalize": true,
  "padding": "zero outside overlap",
  "normalization": "full-series norm product",
  "lags": [
    -9,
    -8,
    -7,
    -6,
    -5,
    -4,
    -3,
    -2,
    -1,
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9
  ],
  "selected_lag": -2
}

Definition sources / 定义来源: EchoTime: ncc_sequence, max_ncc and sbd; k-Shape original paper: shape-based cross-correlation

Shape-based distance (SBD) sbdChecked against EchoTime
Shape-based distance (SBD): static final state of the documented numerical example. distance = 0.0694037.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.06940369 —

EchoTime coverage: Implemented in EchoTime · sbd

1 - max_lag sum_overlap z(x)[i]*z(y)[i-lag] / (||z(x)||_2*||z(y)||_2)

Demonstration: Checked against EchoTime

SBD transforms the best normalized cross-correlation into a dissimilarity by subtracting it from one. EchoTime first z-normalizes each full series, then uses full-series norms at every lag. The animation shows overlap pairs and the complete lag profile, including the reduced overlap near the boundaries.

How the calculation works

  1. Z-normalize both complete series once.
  2. Slide through all integer lags and match only overlapping samples.
  3. Divide each overlap dot product by the same full-series norm product.
  4. Subtract the best NCC from one.

Interpretation and limits

  • This is a global shift, not local time warping.
  • Full-norm zero-padding NCC differs from Pearson or cosine re-normalized on each overlap.
  • Constant series have undefined statistical correlation; EchoTime retains a zero-NCC convention for zero energy.

示例性质: 已与 EchoTime 计算核对

SBD 将最大的归一化互相关从 1 中减去,形成差异量。EchoTime 先对完整序列分别进行 Z 标准化,再在每个滞后位置使用固定的完整序列范数。动画显示重叠配对与完整滞后曲线,包括边界附近的较短重叠。

计算步骤

  1. 对两条完整序列分别进行 Z 标准化。
  2. 遍历整数滞后,仅匹配重叠样本。
  3. 以固定的完整序列范数乘积归一化各重叠点积。
  4. 用 1 减去最大 NCC。

解释与使用边界

  • 这里估计全局平移,不进行局部时间规整。
  • 固定全范数的补零 NCC 与在各重叠片段重新归一化的 Pearson 或余弦不同。
  • 常量信号的统计相关未定义;EchoTime 对零能量保留零 NCC 的约定。
Example parameters / 示例参数
{
  "normalize": true,
  "padding": "zero outside overlap",
  "normalization": "full-series norm product",
  "lags": [
    -9,
    -8,
    -7,
    -6,
    -5,
    -4,
    -3,
    -2,
    -1,
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9
  ],
  "selected_lag": -2
}

Definition sources / 定义来源: EchoTime: ncc_sequence, max_ncc and sbd; k-Shape original paper: shape-based cross-correlation

Shifted Euclidean shift_euclidean_distanceReference-formula demonstration
Shifted Euclidean: static final state of the documented numerical example. distance = 0.0599805.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.059980484 —

EchoTime coverage: Possible addition

min_{lag=-3,...,3} ||x_overlap-y_overlap||_2

Demonstration: Reference-formula demonstration

Shifted Euclidean evaluates sqrt(sum of squared overlap errors) after each permitted integer shift, using only samples that overlap. This example admits lags from minus three to plus three samples, leaving at least seven paired observations. The animation shows the actual overlap pairs and candidate scores before selecting their minimum.

How the calculation works

  1. Fix the permitted lags and minimum acceptable overlap before scoring.
  2. At each lag, compute sqrt(sum of squared overlap errors) on the actual paired samples.
  3. Record every candidate score together with its lag.
  4. Choose the minimum overlap score.

Interpretation and limits

  • The unnormalized total can favour lags with fewer overlapping points.
  • The bounded window is an explicit demonstration choice; allowing every possible lag changes the problem.
  • Overlap cropping removes unmatched endpoints from this score.

示例性质: 参考公式演示

Shifted Euclidean 在每个允许的整数平移后,仅对重叠样本计算对应分数。本例滞后范围为 −3 至 +3 个采样点,始终保留至少七对观测。动图展示实际配对和候选分数,再选择最小值。

计算步骤

  1. 先固定允许滞后与最小可接受重叠长度。
  2. 对每个滞后的实际配对样本计算对应分数。
  3. 记录所有候选分数及其滞后。
  4. 选取最小重叠分数。

解释与使用边界

  • 未归一化总量可能偏向重叠点较少的滞后。
  • 有界窗口是明确的演示选择;允许所有滞后会改变问题。
  • 重叠裁剪会从分数中排除未匹配的两端。
Example parameters / 示例参数
{
  "lags": [
    -3,
    -2,
    -1,
    0,
    1,
    2,
    3
  ],
  "minimum_overlap": 7,
  "normalization": "none beyond stated mean/root",
  "selected_lag": -2
}

Definition sources / 定义来源: Imported registry: overlap-based shift definitions; SciPy: euclidean

Shifted RMSE shift_rmse_distanceReference-formula demonstration
Shifted RMSE: static final state of the documented numerical example. distance = 0.0212063.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.021206303 —

EchoTime coverage: Possible addition

min_{lag=-3,...,3} sqrt(mean((x_overlap-y_overlap)^2))

Demonstration: Reference-formula demonstration

Shifted RMSE evaluates sqrt(mean of squared overlap errors) after each permitted integer shift, using only samples that overlap. This example admits lags from minus three to plus three samples, leaving at least seven paired observations. The animation shows the actual overlap pairs and candidate scores before selecting their minimum.

How the calculation works

  1. Fix the permitted lags and minimum acceptable overlap before scoring.
  2. At each lag, compute sqrt(mean of squared overlap errors) on the actual paired samples.
  3. Record every candidate score together with its lag.
  4. Choose the minimum overlap score.

Interpretation and limits

  • Averaging adjusts for overlap length but a tiny overlap can still give an unstable optimum.
  • The bounded window is an explicit demonstration choice; allowing every possible lag changes the problem.
  • Overlap cropping removes unmatched endpoints from this score.

示例性质: 参考公式演示

Shifted RMSE 在每个允许的整数平移后,仅对重叠样本计算对应分数。本例滞后范围为 −3 至 +3 个采样点,始终保留至少七对观测。动图展示实际配对和候选分数,再选择最小值。

计算步骤

  1. 先固定允许滞后与最小可接受重叠长度。
  2. 对每个滞后的实际配对样本计算对应分数。
  3. 记录所有候选分数及其滞后。
  4. 选取最小重叠分数。

解释与使用边界

  • 平均化调整了重叠长度影响,但很短的重叠仍可能产生不稳定最优点。
  • 有界窗口是明确的演示选择;允许所有滞后会改变问题。
  • 重叠裁剪会从分数中排除未匹配的两端。
Example parameters / 示例参数
{
  "lags": [
    -3,
    -2,
    -1,
    0,
    1,
    2,
    3
  ],
  "minimum_overlap": 7,
  "normalization": "none beyond stated mean/root",
  "selected_lag": -2
}

Definition sources / 定义来源: Imported registry: overlap-based shift definitions; SciPy: euclidean

Shifted Manhattan shift_manhattan_distanceReference-formula demonstration
Shifted Manhattan: static final state of the documented numerical example. distance = 0.153121.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.15312069 —

EchoTime coverage: Possible addition

min_{lag=-3,...,3} ||x_overlap-y_overlap||_1

Demonstration: Reference-formula demonstration

Shifted Manhattan evaluates sum of absolute overlap errors after each permitted integer shift, using only samples that overlap. This example admits lags from minus three to plus three samples, leaving at least seven paired observations. The animation shows the actual overlap pairs and candidate scores before selecting their minimum.

How the calculation works

  1. Fix the permitted lags and minimum acceptable overlap before scoring.
  2. At each lag, compute sum of absolute overlap errors on the actual paired samples.
  3. Record every candidate score together with its lag.
  4. Choose the minimum overlap score.

Interpretation and limits

  • The unnormalized L1 total changes with overlap size; restrict admissible lags.
  • The bounded window is an explicit demonstration choice; allowing every possible lag changes the problem.
  • Overlap cropping removes unmatched endpoints from this score.

示例性质: 参考公式演示

Shifted Manhattan 在每个允许的整数平移后,仅对重叠样本计算对应分数。本例滞后范围为 −3 至 +3 个采样点,始终保留至少七对观测。动图展示实际配对和候选分数,再选择最小值。

计算步骤

  1. 先固定允许滞后与最小可接受重叠长度。
  2. 对每个滞后的实际配对样本计算对应分数。
  3. 记录所有候选分数及其滞后。
  4. 选取最小重叠分数。

解释与使用边界

  • 未归一化 L1 总量随重叠数量变化,应限制允许的滞后。
  • 有界窗口是明确的演示选择;允许所有滞后会改变问题。
  • 重叠裁剪会从分数中排除未匹配的两端。
Example parameters / 示例参数
{
  "lags": [
    -3,
    -2,
    -1,
    0,
    1,
    2,
    3
  ],
  "minimum_overlap": 7,
  "normalization": "none beyond stated mean/root",
  "selected_lag": -2
}

Definition sources / 定义来源: Imported registry: overlap-based shift definitions; SciPy: cityblock

Shifted MAE shift_mae_distanceReference-formula demonstration
Shifted MAE: static final state of the documented numerical example. distance = 0.0191401.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.019140086 —

EchoTime coverage: Possible addition

min_{lag=-3,...,3} mean(abs(x_overlap-y_overlap))

Demonstration: Reference-formula demonstration

Shifted MAE evaluates mean absolute overlap error after each permitted integer shift, using only samples that overlap. This example admits lags from minus three to plus three samples, leaving at least seven paired observations. The animation shows the actual overlap pairs and candidate scores before selecting their minimum.

How the calculation works

  1. Fix the permitted lags and minimum acceptable overlap before scoring.
  2. At each lag, compute mean absolute overlap error on the actual paired samples.
  3. Record every candidate score together with its lag.
  4. Choose the minimum overlap score.

Interpretation and limits

  • Per-overlap averaging does not guarantee a stable estimate on very short overlaps.
  • The bounded window is an explicit demonstration choice; allowing every possible lag changes the problem.
  • Overlap cropping removes unmatched endpoints from this score.

示例性质: 参考公式演示

Shifted MAE 在每个允许的整数平移后,仅对重叠样本计算对应分数。本例滞后范围为 −3 至 +3 个采样点,始终保留至少七对观测。动图展示实际配对和候选分数,再选择最小值。

计算步骤

  1. 先固定允许滞后与最小可接受重叠长度。
  2. 对每个滞后的实际配对样本计算对应分数。
  3. 记录所有候选分数及其滞后。
  4. 选取最小重叠分数。

解释与使用边界

  • 对重叠片段求平均不能保证短片段上的估计稳定。
  • 有界窗口是明确的演示选择;允许所有滞后会改变问题。
  • 重叠裁剪会从分数中排除未匹配的两端。
Example parameters / 示例参数
{
  "lags": [
    -3,
    -2,
    -1,
    0,
    1,
    2,
    3
  ],
  "minimum_overlap": 7,
  "normalization": "none beyond stated mean/root",
  "selected_lag": -2
}

Definition sources / 定义来源: Imported registry: overlap-based shift definitions; SciPy: cityblock

Shifted cosine similarity shift_cosine_similarityReference-formula demonstration
Shifted cosine similarity: static final state of the documented numerical example. similarity = 0.999927.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.99992749 —

EchoTime coverage: Possible addition

max_{lag=-3,...,3} cosine(x_overlap,y_overlap)

Demonstration: Reference-formula demonstration

Shifted cosine similarity evaluates cosine on the current overlap after each permitted integer shift, using only samples that overlap. This example admits lags from minus three to plus three samples, leaving at least seven paired observations. The animation shows the actual overlap pairs and candidate scores before selecting their maximum.

How the calculation works

  1. Fix the permitted lags and minimum acceptable overlap before scoring.
  2. At each lag, compute cosine on the current overlap on the actual paired samples.
  3. Record every candidate score together with its lag.
  4. Choose the maximum overlap score.

Interpretation and limits

  • Every overlap has its own norm; this is different from full-norm NCC.
  • The bounded window is an explicit demonstration choice; allowing every possible lag changes the problem.
  • Overlap cropping removes unmatched endpoints from this score.

示例性质: 参考公式演示

Shifted cosine similarity 在每个允许的整数平移后,仅对重叠样本计算对应分数。本例滞后范围为 −3 至 +3 个采样点,始终保留至少七对观测。动图展示实际配对和候选分数,再选择最大值。

计算步骤

  1. 先固定允许滞后与最小可接受重叠长度。
  2. 对每个滞后的实际配对样本计算对应分数。
  3. 记录所有候选分数及其滞后。
  4. 选取最大重叠分数。

解释与使用边界

  • 每个重叠片段使用自己的范数,与全范数 NCC 不同。
  • 有界窗口是明确的演示选择;允许所有滞后会改变问题。
  • 重叠裁剪会从分数中排除未匹配的两端。
Example parameters / 示例参数
{
  "lags": [
    -3,
    -2,
    -1,
    0,
    1,
    2,
    3
  ],
  "minimum_overlap": 7,
  "normalization": "per overlap",
  "selected_lag": -2
}

Definition sources / 定义来源: Imported registry: overlap-based shift definitions; SciPy: cosine

Shifted cosine distance shift_cosine_distanceReference-formula demonstration
Shifted cosine distance: static final state of the documented numerical example. distance = 7.25144e-05.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 7.251435e-05 —

EchoTime coverage: Possible addition

1 - max_{lag=-3,...,3} cosine(x_overlap,y_overlap)

Demonstration: Reference-formula demonstration

Shifted cosine distance evaluates cosine on the current overlap after each permitted integer shift, using only samples that overlap. This example admits lags from minus three to plus three samples, leaving at least seven paired observations. The animation shows the actual overlap pairs and candidate scores before selecting their maximum. The final one-minus transform produces the displayed dissimilarity.

How the calculation works

  1. Fix the permitted lags and minimum acceptable overlap before scoring.
  2. At each lag, compute cosine on the current overlap on the actual paired samples.
  3. Record every candidate score together with its lag.
  4. Choose the maximum and apply 1-score.

Interpretation and limits

  • The one-minus transform does not establish a metric on raw time series.
  • The bounded window is an explicit demonstration choice; allowing every possible lag changes the problem.
  • Overlap cropping removes unmatched endpoints from this score.

示例性质: 参考公式演示

Shifted cosine distance 在每个允许的整数平移后,仅对重叠样本计算对应分数。本例滞后范围为 −3 至 +3 个采样点,始终保留至少七对观测。动图展示实际配对和候选分数,再选择最大值。最后取 1 减分数得到差异量。

计算步骤

  1. 先固定允许滞后与最小可接受重叠长度。
  2. 对每个滞后的实际配对样本计算对应分数。
  3. 记录所有候选分数及其滞后。
  4. 选择最大分数后取 1 减。

解释与使用边界

  • 1 减变换不能自动证明原时间序列上的度量性质。
  • 有界窗口是明确的演示选择;允许所有滞后会改变问题。
  • 重叠裁剪会从分数中排除未匹配的两端。
Example parameters / 示例参数
{
  "lags": [
    -3,
    -2,
    -1,
    0,
    1,
    2,
    3
  ],
  "minimum_overlap": 7,
  "normalization": "per overlap",
  "selected_lag": -2
}

Definition sources / 定义来源: Imported registry: overlap-based shift definitions; SciPy: cosine

Shifted Pearson correlation shift_pearson_similarityReference-formula demonstration
Shifted Pearson correlation: static final state of the documented numerical example. similarity = 0.999898.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.9998975 —

EchoTime coverage: Conceptually covered · best_lag_pearson_r

max_{lag=-3,...,3} corr(x_overlap,y_overlap)

Demonstration: Reference-formula demonstration

Shifted Pearson correlation evaluates Pearson r on the current overlap after each permitted integer shift, using only samples that overlap. This example admits lags from minus three to plus three samples, leaving at least seven paired observations. The animation shows the actual overlap pairs and candidate scores before selecting their maximum.

How the calculation works

  1. Fix the permitted lags and minimum acceptable overlap before scoring.
  2. At each lag, compute Pearson r on the current overlap on the actual paired samples.
  3. Record every candidate score together with its lag.
  4. Choose the maximum overlap score.

Interpretation and limits

  • Each overlap is independently centered; selecting the best lag also selects among several correlations.
  • The bounded window is an explicit demonstration choice; allowing every possible lag changes the problem.
  • Overlap cropping removes unmatched endpoints from this score.

示例性质: 参考公式演示

Shifted Pearson correlation 在每个允许的整数平移后,仅对重叠样本计算对应分数。本例滞后范围为 −3 至 +3 个采样点,始终保留至少七对观测。动图展示实际配对和候选分数,再选择最大值。

计算步骤

  1. 先固定允许滞后与最小可接受重叠长度。
  2. 对每个滞后的实际配对样本计算对应分数。
  3. 记录所有候选分数及其滞后。
  4. 选取最大重叠分数。

解释与使用边界

  • 每个重叠片段分别去均值;选取最佳滞后同时也是在多个相关结果中选择。
  • 有界窗口是明确的演示选择;允许所有滞后会改变问题。
  • 重叠裁剪会从分数中排除未匹配的两端。
Example parameters / 示例参数
{
  "lags": [
    -3,
    -2,
    -1,
    0,
    1,
    2,
    3
  ],
  "minimum_overlap": 7,
  "normalization": "per overlap",
  "selected_lag": -2
}

Definition sources / 定义来源: Imported registry: overlap-based shift definitions; SciPy: correlation

Shifted Pearson distance shift_pearson_distanceReference-formula demonstration
Shifted Pearson distance: static final state of the documented numerical example. distance = 0.000102496.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.00010249589 —

EchoTime coverage: Conceptually covered · best_lag_pearson_r

1 - max_{lag=-3,...,3} corr(x_overlap,y_overlap)

Demonstration: Reference-formula demonstration

Shifted Pearson distance evaluates Pearson r on the current overlap after each permitted integer shift, using only samples that overlap. This example admits lags from minus three to plus three samples, leaving at least seven paired observations. The animation shows the actual overlap pairs and candidate scores before selecting their maximum. The final one-minus transform produces the displayed dissimilarity.

How the calculation works

  1. Fix the permitted lags and minimum acceptable overlap before scoring.
  2. At each lag, compute Pearson r on the current overlap on the actual paired samples.
  3. Record every candidate score together with its lag.
  4. Choose the maximum and apply 1-score.

Interpretation and limits

  • One minus the selected correlation is an explicit dissimilarity, not a probability or significance test.
  • The bounded window is an explicit demonstration choice; allowing every possible lag changes the problem.
  • Overlap cropping removes unmatched endpoints from this score.

示例性质: 参考公式演示

Shifted Pearson distance 在每个允许的整数平移后,仅对重叠样本计算对应分数。本例滞后范围为 −3 至 +3 个采样点,始终保留至少七对观测。动图展示实际配对和候选分数,再选择最大值。最后取 1 减分数得到差异量。

计算步骤

  1. 先固定允许滞后与最小可接受重叠长度。
  2. 对每个滞后的实际配对样本计算对应分数。
  3. 记录所有候选分数及其滞后。
  4. 选择最大分数后取 1 减。

解释与使用边界

  • 1 减选定相关是明确的差异量,并非概率或显著性检验。
  • 有界窗口是明确的演示选择;允许所有滞后会改变问题。
  • 重叠裁剪会从分数中排除未匹配的两端。
Example parameters / 示例参数
{
  "lags": [
    -3,
    -2,
    -1,
    0,
    1,
    2,
    3
  ],
  "minimum_overlap": 7,
  "normalization": "per overlap",
  "selected_lag": -2
}

Definition sources / 定义来源: Imported registry: overlap-based shift definitions; SciPy: correlation

Independent channel SBD independent_sbdChecked against EchoTime
Independent channel SBD: static final state of the documented numerical example. distance = 0.0682172.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.068217211 —

EchoTime coverage: Implemented in EchoTime · independent_sbd

mean_c (1-max_lag NCC_c(lag))

Demonstration: Checked against EchoTime

Independent channel comparison permits each paired channel to choose a different global lag. The illustration uses two channels with peaks shifted in opposite directions, then averages their individually optimized scores. For SBD it averages one minus each channel's maximum NCC. The upper input plot shows channel one; both channels are displayed in the computational frames.

How the calculation works

  1. Match channels explicitly and normalize each series within each channel.
  2. Compute the full-norm NCC lag profile for channel one.
  3. Repeat the lag scan independently for channel two.
  4. Average channel-wise dissimilarities.

Interpretation and limits

  • Independent lags discard cross-channel timing consistency; choose a joint-lag method if synchrony matters.
  • Channels are averaged equally here; this is not a learned weighting.
  • The channel pairing must have a scientific meaning.

示例性质: 已与 EchoTime 计算核对

独立通道比较允许每对通道选择不同的全局滞后。本例使用两组峰值向相反方向偏移的通道,再平均各自优化后的分数。SBD 型平均每个通道的 1 减最大 NCC。上方输入图显示第一通道,计算帧依次展示两个通道。

计算步骤

  1. 明确通道配对,并在每个通道内分别标准化。
  2. 计算第一通道的全范数 NCC 滞后曲线。
  3. 独立计算第二通道的滞后曲线。
  4. 平均通道差异量。

解释与使用边界

  • 独立滞后舍弃跨通道时序一致性;同步关系重要时应使用共同滞后的方法。
  • 本例对通道等权平均,不学习权重。
  • 通道配对必须有科学意义。
Example parameters / 示例参数
{
  "channels_x": [
    [
      0.0,
      0.2
    ],
    [
      0.1,
      0.9
    ],
    [
      0.8,
      1.8
    ],
    [
      2.1,
      1.2
    ],
    [
      1.4,
      0.1
    ],
    [
      0.3,
      -0.6
    ],
    [
      -0.2,
      -0.3
    ],
    [
      -0.1,
      0.4
    ],
    [
      0.1,
      0.8
    ],
    [
      0.0,
      0.2
    ]
  ],
  "channels_y": [
    [
      0.0,
      1.82
    ],
    [
      0.025244129544236896,
      1.2108060461173626
    ],
    [
      0.02727892280477045,
      0.09167706326905715
    ],
    [
      0.10423360024179602,
      -0.6197998499320089
    ],
    [
      0.7772959251407622,
      -0.3130728724172722
    ],
    [
      2.071232271760106,
      0.40567324370926455
    ],
    [
      1.391617535054032,
      0.8192034057330073
    ],
    [
      0.3197095979615637,
      0.2150780450868661
    ],
    [
      -0.17031925260129854,
      -0.0029100006761722708
    ],
    [
      -0.0876364454427473,
      -0.018222605237693538
    ]
  ],
  "upper_plot_channel": 0,
  "channel_best_lags": [
    -2,
    2
  ],
  "aggregation": "equal channel mean"
}

Definition sources / 定义来源: EchoTime: independent_max_ncc and independent_sbd

Independent channel maximum NCC independent_max_nccChecked against EchoTime
Independent channel maximum NCC: static final state of the documented numerical example. similarity = 0.931783.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.93178279 —

EchoTime coverage: Implemented in EchoTime · independent_max_ncc

mean_c max_lag NCC_c(lag)

Demonstration: Checked against EchoTime

Independent channel comparison permits each paired channel to choose a different global lag. The illustration uses two channels with peaks shifted in opposite directions, then averages their individually optimized scores. For independent maximum NCC it averages the channel maxima. The upper input plot shows channel one; both channels are displayed in the computational frames.

How the calculation works

  1. Match channels explicitly and normalize each series within each channel.
  2. Compute the full-norm NCC lag profile for channel one.
  3. Repeat the lag scan independently for channel two.
  4. Average the maxima; no common lag is required.

Interpretation and limits

  • Independent lags discard cross-channel timing consistency; choose a joint-lag method if synchrony matters.
  • Channels are averaged equally here; this is not a learned weighting.
  • The channel pairing must have a scientific meaning.

示例性质: 已与 EchoTime 计算核对

独立通道比较允许每对通道选择不同的全局滞后。本例使用两组峰值向相反方向偏移的通道,再平均各自优化后的分数。最大 NCC 型直接平均各通道最大值。上方输入图显示第一通道,计算帧依次展示两个通道。

计算步骤

  1. 明确通道配对,并在每个通道内分别标准化。
  2. 计算第一通道的全范数 NCC 滞后曲线。
  3. 独立计算第二通道的滞后曲线。
  4. 平均各通道最大值,不要求共同滞后。

解释与使用边界

  • 独立滞后舍弃跨通道时序一致性;同步关系重要时应使用共同滞后的方法。
  • 本例对通道等权平均,不学习权重。
  • 通道配对必须有科学意义。
Example parameters / 示例参数
{
  "channels_x": [
    [
      0.0,
      0.2
    ],
    [
      0.1,
      0.9
    ],
    [
      0.8,
      1.8
    ],
    [
      2.1,
      1.2
    ],
    [
      1.4,
      0.1
    ],
    [
      0.3,
      -0.6
    ],
    [
      -0.2,
      -0.3
    ],
    [
      -0.1,
      0.4
    ],
    [
      0.1,
      0.8
    ],
    [
      0.0,
      0.2
    ]
  ],
  "channels_y": [
    [
      0.0,
      1.82
    ],
    [
      0.025244129544236896,
      1.2108060461173626
    ],
    [
      0.02727892280477045,
      0.09167706326905715
    ],
    [
      0.10423360024179602,
      -0.6197998499320089
    ],
    [
      0.7772959251407622,
      -0.3130728724172722
    ],
    [
      2.071232271760106,
      0.40567324370926455
    ],
    [
      1.391617535054032,
      0.8192034057330073
    ],
    [
      0.3197095979615637,
      0.2150780450868661
    ],
    [
      -0.17031925260129854,
      -0.0029100006761722708
    ],
    [
      -0.0876364454427473,
      -0.018222605237693538
    ]
  ],
  "upper_plot_channel": 0,
  "channel_best_lags": [
    -2,
    2
  ],
  "aggregation": "equal channel mean"
}

Definition sources / 定义来源: EchoTime: independent_max_ncc and independent_sbd

Elastic alignment and edit operations / 弹性对齐与编辑操作 24
Dynamic time warping dtwReference-formula demonstration
Dynamic time warping: static final state of the documented numerical example. distance = 0.447214.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.4472136 — The explicit definition and parameters shown on this card.

EchoTime coverage: Conceptually covered · dtw_similarity

DTW(x,y) = sqrt(min_path sum_(i,j) (x_i-y_j)^2)

Demonstration: Reference-formula demonstration

DTW compares ordered series while allowing repeated matches along a monotone alignment path. The animation builds squared pointwise costs, fills the dynamic-programming table, and traces a minimum-cost path. This reference example returns the square root of the total cost; EchoTime's composite dtw_similarity uses a different local cost and scaling.

How the calculation works

  1. Choose raw observations and any neighborhood descriptor.
  2. Compute local squared discrepancies; apply the indicated weights or admissibility mask.
  3. At each admissible cell, add its local cost to the smallest predecessor cost.
  4. Trace one minimizing path and take the square root of its accumulated objective.

Interpretation and limits

  • Unrestricted warping can align events that should remain distinct; the output is not generally a metric.
  • Signal scale, path constraints and final normalization must match before distances from different tools are compared.

示例性质: 参考公式演示

DTW 在保持先后顺序的前提下,允许同一个观测与多个观测匹配。动图依次展示平方局部误差、动态规划累计表和最低代价路径。本例返回累计代价的平方根;EchoTime 的复合 dtw_similarity 使用不同的局部代价与缩放。

计算步骤

  1. 选择原始观测以及需要的邻域描述符。
  2. 计算局部平方误差,并施加指定权重或允许匹配的掩码。
  3. 在每个允许单元格,把局部代价加到三个前驱的最小累计代价上。
  4. 回溯一条最小化目标的路径,并对其累计目标值取平方根。

解释与使用边界

  • 无限制扭曲可能对齐本应区分的事件;该输出一般不满足全部度量公理。
  • 比较不同工具的数值之前,须统一信号尺度、路径约束和最终归一化。
Example parameters / 示例参数
{
  "local_cost": "squared Euclidean",
  "final_square_root": true,
  "normalization": "none"
}

Definition sources / 定义来源: tslearn: DTW definitions and path constraints; EchoTime imported atlas: named formula conventions

DTW with a path band cdtwReference-formula demonstration
DTW with a path band: static final state of the documented numerical example. distance = 0.447214.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.4472136 — The explicit definition and parameters shown on this card.

EchoTime coverage: Conceptually covered · dtw_similarity

cDTW = sqrt(min_path sum (x_i-y_j)^2), with |i-j| <= 1

Demonstration: Reference-formula demonstration

Constrained DTW restricts the allowed correspondences before optimizing their cumulative cost. Here only cells at most one sample from the diagonal are admissible. Empty cells in the animation are forbidden states, not zero-cost matches; the same recurrence operates on the remaining band.

How the calculation works

  1. Choose raw observations and any neighborhood descriptor.
  2. Compute local squared discrepancies; apply the indicated weights or admissibility mask.
  3. At each admissible cell, add its local cost to the smallest predecessor cost.
  4. Trace one minimizing path and take the square root of its accumulated objective.

Interpretation and limits

  • A narrow band can exclude the desired alignment. Unequal-length inputs require an endpoint-aware constraint.
  • Signal scale, path constraints and final normalization must match before distances from different tools are compared.

示例性质: 参考公式演示

约束 DTW 先限制允许匹配的位置,再优化累计误差。本例只允许偏离对角线不超过一个采样点的单元格。动图中的空格表示禁止状态,不能当作零代价;其余带状区域采用相同的递推。

计算步骤

  1. 选择原始观测以及需要的邻域描述符。
  2. 计算局部平方误差,并施加指定权重或允许匹配的掩码。
  3. 在每个允许单元格,把局部代价加到三个前驱的最小累计代价上。
  4. 回溯一条最小化目标的路径,并对其累计目标值取平方根。

解释与使用边界

  • 窄窗口可能排除希望找到的匹配;长度不同时还须确保约束允许连接两端。
  • 比较不同工具的数值之前,须统一信号尺度、路径约束和最终归一化。
Example parameters / 示例参数
{
  "local_cost": "squared Euclidean",
  "final_square_root": true,
  "normalization": "none",
  "window": 1
}

Definition sources / 定义来源: tslearn: DTW definitions and path constraints; EchoTime imported atlas: named formula conventions

DTW with slope constraints itakura_dtwReference-formula demonstration
DTW with slope constraints: static final state of the documented numerical example. distance = 0.74162.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.74161985 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

Allowed: i/2 <= j <= 2i and (n-1-i)/2 <= n-1-j <= 2(n-1-i)

Demonstration: Reference-formula demonstration

An Itakura-style parallelogram limits how strongly an alignment can stretch near either endpoint. This equal-length illustration uses slopes one half and two, anchored at the first and last samples. Dynamic programming then finds the least-cost path inside that explicitly shown region.

How the calculation works

  1. Choose raw observations and any neighborhood descriptor.
  2. Compute local squared discrepancies; apply the indicated weights or admissibility mask.
  3. At each admissible cell, add its local cost to the smallest predecessor cost.
  4. Trace one minimizing path and take the square root of its accumulated objective.

Interpretation and limits

  • Mask discretization and unequal-length slope conventions differ across libraries; this card specifies an equal-length integer-grid example.
  • Signal scale, path constraints and final normalization must match before distances from different tools are compared.

示例性质: 参考公式演示

Itakura 型平行四边形限制对齐路径在两端附近的伸缩程度。本例长度相等,允许斜率范围为二分之一至二,并同时锚定首尾观测。动态规划在图示允许区域内寻找最低代价路径。

计算步骤

  1. 选择原始观测以及需要的邻域描述符。
  2. 计算局部平方误差,并施加指定权重或允许匹配的掩码。
  3. 在每个允许单元格,把局部代价加到三个前驱的最小累计代价上。
  4. 回溯一条最小化目标的路径,并对其累计目标值取平方根。

解释与使用边界

  • 不同库的离散掩码和异长斜率约定可能不同;本卡明确采用等长整数网格示例。
  • 比较不同工具的数值之前,须统一信号尺度、路径约束和最终归一化。
Example parameters / 示例参数
{
  "local_cost": "squared Euclidean",
  "final_square_root": true,
  "normalization": "none",
  "itakura": true
}

Definition sources / 定义来源: tslearn: DTW definitions and path constraints; EchoTime imported atlas: named formula conventions

Weighted dynamic time warping wdtwReference-formula demonstration
Weighted dynamic time warping: static final state of the documented numerical example. distance = 0.120373.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.12037329 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

w(k)=1/(1+exp(-0.6*(k-L/2))); d=sqrt(min_path sum w(|i-j|)*(x_i-y_j)^2)

Demonstration: Reference-formula demonstration

Weighted DTW changes the price of a match according to its displacement from the diagonal. The local squared discrepancy is multiplied by a logistic weight that increases with displacement. The animation then optimizes those weighted costs and displays the resulting path, without imposing a hard band.

How the calculation works

  1. Choose raw observations and any neighborhood descriptor.
  2. Compute local squared discrepancies; apply the indicated weights or admissibility mask.
  3. At each admissible cell, add its local cost to the smallest predecessor cost.
  4. Trace one minimizing path and take the square root of its accumulated objective.

Interpretation and limits

  • These weights are at most one: the penalty is relative across displacements, not an added nonnegative surcharge to ordinary DTW.
  • Signal scale, path constraints and final normalization must match before distances from different tools are compared.

示例性质: 参考公式演示

加权 DTW 根据匹配位置偏离对角线的程度改变代价。局部平方误差乘以随位移增加的逻辑函数权重,再对这些加权代价求最优路径。本例不施加硬窗口。

计算步骤

  1. 选择原始观测以及需要的邻域描述符。
  2. 计算局部平方误差,并施加指定权重或允许匹配的掩码。
  3. 在每个允许单元格,把局部代价加到三个前驱的最小累计代价上。
  4. 回溯一条最小化目标的路径,并对其累计目标值取平方根。

解释与使用边界

  • 这里的权重不超过一;所谓惩罚表示不同位移之间的相对权重,不是给普通 DTW 额外增加非负费用。
  • 比较不同工具的数值之前,须统一信号尺度、路径约束和最终归一化。
Example parameters / 示例参数
{
  "local_cost": "squared Euclidean",
  "final_square_root": true,
  "normalization": "none",
  "weighted": true,
  "g": 0.6
}

Definition sources / 定义来源: aeon: logistic weighted DTW; EchoTime imported atlas: named formula conventions

DTW on first differences ddtwReference-formula demonstration
DTW on first differences: static final state of the documented numerical example. distance = 0.894427.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.89442719 — The explicit definition and parameters shown on this card.

EchoTime coverage: Conceptually covered · dtw_similarity

Delta x_i=x_(i+1)-x_i; d=DTW(Delta x,Delta y), squared costs then square root

Demonstration: Reference-formula demonstration

This atlas entry applies DTW to first differences, so the alignment responds to changes rather than absolute levels. The first frames expose the transformed series before the local table is accumulated. It is an explicit first-difference variant; other DDTW implementations use a smoothed derivative estimator.

How the calculation works

  1. Take first differences with the stated convention.
  2. Compute local squared discrepancies; apply the indicated weights or admissibility mask.
  3. At each admissible cell, add its local cost to the smallest predecessor cost.
  4. Trace one minimizing path and take the square root of its accumulated objective.

Interpretation and limits

  • Differencing removes constant offsets and amplifies high-frequency noise. The result depends on the derivative estimator.
  • Signal scale, path constraints and final normalization must match before distances from different tools are compared.

示例性质: 参考公式演示

本条目对一阶差分使用 DTW,因此匹配依据是变化而非绝对水平。动图先展示变换后的序列,再构造累计表。本例明确使用一阶差分;其他 DDTW 实现可能采用平滑导数估计。

计算步骤

  1. 按明确约定计算一阶差分。
  2. 计算局部平方误差,并施加指定权重或允许匹配的掩码。
  3. 在每个允许单元格,把局部代价加到三个前驱的最小累计代价上。
  4. 回溯一条最小化目标的路径,并对其累计目标值取平方根。

解释与使用边界

  • 差分消除常数偏移,也会放大高频噪声;结果取决于导数估计方法。
  • 比较不同工具的数值之前,须统一信号尺度、路径约束和最终归一化。
Example parameters / 示例参数
{
  "local_cost": "squared Euclidean",
  "final_square_root": true,
  "normalization": "none",
  "derivative": "adjacent first differences; n-1 outputs"
}

Definition sources / 定义来源: tslearn: DTW definitions and path constraints; EchoTime imported atlas: named formula conventions

Weighted DTW on differences wddtwReference-formula demonstration
Weighted DTW on differences: static final state of the documented numerical example. distance = 0.23646.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.23646036 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

d=sqrt(min_path sum w(|i-j|)*(Delta x_i-Delta y_j)^2), g=0.6

Demonstration: Reference-formula demonstration

This variant first takes adjacent differences and then uses displacement-weighted DTW. It combines sensitivity to local changes with a preference for smaller index displacement. The displayed derivative table and weighted path belong to that stated composition, which need not equal every library's WDDTW convention.

How the calculation works

  1. Take first differences with the stated convention.
  2. Compute local squared discrepancies; apply the indicated weights or admissibility mask.
  3. At each admissible cell, add its local cost to the smallest predecessor cost.
  4. Trace one minimizing path and take the square root of its accumulated objective.

Interpretation and limits

  • Both derivative estimation and the logistic slope change the answer; offset tolerance does not imply robustness to arbitrary noise.
  • Signal scale, path constraints and final normalization must match before distances from different tools are compared.

示例性质: 参考公式演示

该变体先计算相邻差分,再进行位移加权 DTW,结合局部变化比较与较小索引位移偏好。图中导数表和加权路径对应这里明确给出的组合,不保证与所有库的 WDDTW 约定相同。

计算步骤

  1. 按明确约定计算一阶差分。
  2. 计算局部平方误差,并施加指定权重或允许匹配的掩码。
  3. 在每个允许单元格,把局部代价加到三个前驱的最小累计代价上。
  4. 回溯一条最小化目标的路径,并对其累计目标值取平方根。

解释与使用边界

  • 导数估计和逻辑权重斜率都会改变结果;容忍水平偏移并不意味着对任意噪声稳健。
  • 比较不同工具的数值之前,须统一信号尺度、路径约束和最终归一化。
Example parameters / 示例参数
{
  "local_cost": "squared Euclidean",
  "final_square_root": true,
  "normalization": "none",
  "derivative": "adjacent first differences; n-1 outputs",
  "weighted": true,
  "g": 0.6
}

Definition sources / 定义来源: aeon: logistic weighted DTW; EchoTime imported atlas: named formula conventions

Soft dynamic time warping soft_dtwReference-formula demonstration
Soft dynamic time warping: static final state of the documented numerical example. soft objective = -4.44396.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative soft objective: -4.4439633 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

R_ij=(x_i-y_j)^2-gamma*log(sum_predecessors exp(-R/gamma))

Demonstration: Reference-formula demonstration

Soft-DTW replaces the hard minimum over alignment alternatives with a log-sum-exp soft minimum. Many paths contribute to the result, and the gradient with respect to local costs gives expected cell occupancy. The score is a smooth objective and may be negative or favor a point different from the input itself.

How the calculation works

  1. Form the squared local discrepancy table and choose gamma=0.7.
  2. Use -gamma*log(sum(exp(-previous/gamma))) in each DP update.
  3. Propagate derivatives backward to display expected alignment occupancy across multiple paths.
  4. Read the signed soft objective without choosing a unique path.

Interpretation and limits

  • Gamma controls the spread over alignments; this example uses squared local costs and no path band.
  • Raw soft-DTW can be negative and has an entropic self-bias; do not treat it as a conventional nonnegative distance.

示例性质: 参考公式演示

Soft-DTW 用 log-sum-exp 软最小值替代路径选择中的硬最小值。多个路径共同贡献目标值,对局部代价求导得到每个单元格的期望占据权重。它是平滑目标,可以为负,也可能不在输入自身处取得最小值。

计算步骤

  1. 构造平方局部误差表,设平滑参数 gamma=0.7。
  2. 每步动态规划使用 -gamma*log(sum(exp(-previous/gamma)))。
  3. 反向传播导数,显示多个路径共同形成的期望对齐占据权重。
  4. 读取有符号的软目标值,不选择唯一对齐路径。

解释与使用边界

  • Gamma 控制路径权重的分散程度;本例使用平方局部代价,不加路径窗口。
  • 原始 soft-DTW 可以为负并具有熵正则化自偏差,不能直接作为普通非负距离理解。
Example parameters / 示例参数
{
  "gamma": 0.7,
  "local_cost": "squared Euclidean",
  "self_x": -4.542304721573488,
  "self_y": -4.93660871304499,
  "cross": -4.4439633238876635
}

Definition sources / 定义来源: Cuturi and Blondel (2017): Soft-DTW; Blondel, Mensch and Vert (2021): corrected divergences

Soft-DTW divergence soft_dtw_divergenceReference-formula demonstration
Soft-DTW divergence: static final state of the documented numerical example. divergence = 0.295493.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative divergence: 0.29549339 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

D_gamma(x,y)=sDTW_gamma(x,y)-0.5*sDTW_gamma(x,x)-0.5*sDTW_gamma(y,y)

Demonstration: Reference-formula demonstration

The corrected soft-DTW divergence subtracts self-alignment terms from the cross-series soft score. This removes its nonzero self-cost by construction. The animation shows both the diffuse alignment occupancy and the three-term correction; theoretical nonnegativity and identification results depend on the ground-cost assumptions.

How the calculation works

  1. Form the squared local discrepancy table and choose gamma=0.7.
  2. Use -gamma*log(sum(exp(-previous/gamma))) in each DP update.
  3. Propagate derivatives backward to display expected alignment occupancy across multiple paths.
  4. Subtract half of softDTW(x,x) and half of softDTW(y,y).

Interpretation and limits

  • Gamma controls the spread over alignments; this example uses squared local costs and no path band.
  • A divergence is not automatically a metric; its properties depend on the ground cost and it need not satisfy the triangle inequality.

示例性质: 参考公式演示

修正 soft-DTW 散度从交叉序列分数中扣除两个自对齐项,因此相同输入的自代价按构造归零。动图展示分散的对齐占据权重和三项修正;非负性与可识别性的理论结论依赖局部代价条件。

计算步骤

  1. 构造平方局部误差表,设平滑参数 gamma=0.7。
  2. 每步动态规划使用 -gamma*log(sum(exp(-previous/gamma)))。
  3. 反向传播导数,显示多个路径共同形成的期望对齐占据权重。
  4. 分别扣除 softDTW(x,x) 和 softDTW(y,y) 的一半。

解释与使用边界

  • Gamma 控制路径权重的分散程度;本例使用平方局部代价,不加路径窗口。
  • 散度并不自动成为度量;其性质依赖局部代价,也不必满足三角不等式。
Example parameters / 示例参数
{
  "gamma": 0.7,
  "local_cost": "squared Euclidean",
  "self_x": -4.542304721573488,
  "self_y": -4.93660871304499,
  "cross": -4.4439633238876635
}

Definition sources / 定义来源: Cuturi and Blondel (2017): Soft-DTW; Blondel, Mensch and Vert (2021): corrected divergences

LCSS matched fraction lcss_similarityChecked against EchoTime
LCSS matched fraction: static final state of the documented numerical example. similarity = 0.9.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.9 — The explicit definition and parameters shown on this card.

EchoTime coverage: Implemented in EchoTime · lcss_similarity

L_ij=L_(i-1,j-1)+1 if |x_i-y_j|<=epsilon, else max(L_(i-1,j),L_(i,j-1)); s=L_nm/min(n,m)

Demonstration: Checked against EchoTime

LCSS counts an order-preserving set of sufficiently close sample pairs. Unmatched samples may be skipped, so the result describes matched coverage rather than the magnitude of every residual. The animation uses a tolerance of 0.35 and divides the match count by the shorter sequence length.

How the calculation works

  1. Set the stated local scoring rule, tolerance and boundary conditions.
  2. Count tolerance matches and carry forward the larger match count when skipping.
  3. Trace the selected predecessor operations from the complete-prefix state.
  4. Read the final score with the normalization explicitly stated below.

Interpretation and limits

  • Tolerance changes which pairs count as matches. Missing subsequences may be ignored by the shorter-length normalization.
  • The small arrays are an algorithm illustration, not evidence of retrieval or classification quality.

示例性质: 已与 EchoTime 计算核对

LCSS 寻找保持先后顺序且足够接近的观测配对。未匹配点可以跳过,因此结果反映匹配覆盖率,不累加全部数值误差。本例容差为 0.35,并以较短序列长度归一化匹配数量。

计算步骤

  1. 设置明确的局部计分规则、容差与边界条件。
  2. 累计容差内匹配,跳过观测时保留较大的匹配计数。
  3. 从完整前缀状态沿选定的前驱操作回溯。
  4. 按下方明确的归一化约定读取最终分数。

解释与使用边界

  • 容差改变哪些配对算匹配;以较短长度归一化可能忽略较长序列中未匹配的部分。
  • 这些小数组用于解释计算过程,不构成检索或分类性能证据。
Example parameters / 示例参数
{
  "normalization": "match count / min(n,m)",
  "local_norm": "absolute difference",
  "epsilon": 0.35
}

Definition sources / 定义来源: tslearn: Longest Common Subsequence; EchoTime low-level similarity implementations

One minus LCSS similarity lcss_distanceChecked against EchoTime
One minus LCSS similarity: static final state of the documented numerical example. distance = 0.1.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.1 — The explicit definition and parameters shown on this card.

EchoTime coverage: Implemented in EchoTime · lcss_distance

d_LCSS=1-LCSS_epsilon(x,y)/min(n,m)

Demonstration: Checked against EchoTime

This distance-like transform is one minus the normalized LCSS match count. It retains the order-preserving, tolerance-based matching rule. The final conversion reverses the direction of the score without restoring information discarded by skipped points or thresholding; different sequences can therefore receive zero distance.

How the calculation works

  1. Set the stated local scoring rule, tolerance and boundary conditions.
  2. Count tolerance matches and carry forward the larger match count when skipping.
  3. Trace the selected predecessor operations from the complete-prefix state.
  4. Convert the count to one minus its shorter-length-normalized value.

Interpretation and limits

  • One minus a similarity need not satisfy metric axioms. Zero here means full tolerance-based coverage of the shorter sequence.
  • The small arrays are an algorithm illustration, not evidence of retrieval or classification quality.

示例性质: 已与 EchoTime 计算核对

该距离形式等于一减归一化 LCSS 匹配数量,仍采用保持顺序的容差匹配。最后的变换只反转分数方向,无法恢复跳过观测或阈值判断丢失的信息,因此不同序列也可能得到零距离。

计算步骤

  1. 设置明确的局部计分规则、容差与边界条件。
  2. 累计容差内匹配,跳过观测时保留较大的匹配计数。
  3. 从完整前缀状态沿选定的前驱操作回溯。
  4. 将匹配数量除以较短长度,再用一减去该比例。

解释与使用边界

  • 一减相似度不保证满足度量公理;这里的零值表示较短序列在容差内被完全覆盖。
  • 这些小数组用于解释计算过程,不构成检索或分类性能证据。
Example parameters / 示例参数
{
  "normalization": "match count / min(n,m)",
  "local_norm": "absolute difference",
  "epsilon": 0.35
}

Definition sources / 定义来源: tslearn: Longest Common Subsequence; EchoTime low-level similarity implementations

Edit distance on real sequences edrChecked against EchoTime
Edit distance on real sequences: static final state of the documented numerical example. distance = 0.2.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.2 — The explicit definition and parameters shown on this card.

EchoTime coverage: Implemented in EchoTime · edr_distance

D_ij=min(D_(i-1,j)+1,D_(i,j-1)+1,D_(i-1,j-1)+1[|x_i-y_j|>epsilon]); d=D_nm/max(n,m)

Demonstration: Checked against EchoTime

EDR replaces the size of a sample discrepancy with a thresholded substitution cost. A nearby pair costs zero, a mismatching substitution costs one, and insertions or deletions cost one. Dynamic programming finds the least expensive edit sequence; this example reports EchoTime's length-normalized default.

How the calculation works

  1. Set the stated local scoring rule, tolerance and boundary conditions.
  2. Choose the cheapest substitution, insertion or deletion for each prefix.
  3. Trace the selected predecessor operations from the complete-prefix state.
  4. Read the final score with the normalization explicitly stated below.

Interpretation and limits

  • The amplitude of a mismatch beyond epsilon is discarded. Normalization and epsilon must be specified when comparing implementations.
  • The small arrays are an algorithm illustration, not evidence of retrieval or classification quality.

示例性质: 已与 EchoTime 计算核对

EDR 把观测差异转成阈值替换代价:相近配对为零,不匹配替换为一,插入和删除也为一。动态规划寻找费用最低的编辑序列;本例采用 EchoTime 默认的长度归一化输出。

计算步骤

  1. 设置明确的局部计分规则、容差与边界条件。
  2. 逐个前缀选择费用最低的替换、插入或删除。
  3. 从完整前缀状态沿选定的前驱操作回溯。
  4. 按下方明确的归一化约定读取最终分数。

解释与使用边界

  • 超过 epsilon 后的误差幅度被丢弃;比较不同实现时须明确容差与归一化。
  • 这些小数组用于解释计算过程,不构成检索或分类性能证据。
Example parameters / 示例参数
{
  "normalization": "edit count / max(n,m)",
  "local_norm": "absolute difference",
  "epsilon": 0.35
}

Definition sources / 定义来源: EchoTime low-level similarity implementations; EchoTime imported atlas: named formula conventions

SWALE rewards and gap costs swale_similarityReference-formula demonstration
SWALE rewards and gap costs: static final state of the documented numerical example. alignment score = 17.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative alignment score: 17 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

S_ij=2+S_(i-1,j-1) for a tolerance match; otherwise max(S_(i-1,j)-0.5,S_(i,j-1)-0.5)

Demonstration: Reference-formula demonstration

SWALE scores tolerance-based matches with a reward and unmatched observations with a gap penalty. Its recurrence combines the number of accepted matches with the price of omitted observations. This example uses reward 2, gap score -0.5 and epsilon 0.35; the raw score is not normalized to a probability.

How the calculation works

  1. Set the stated local scoring rule, tolerance and boundary conditions.
  2. Reward a tolerance match; otherwise choose the less costly gap transition.
  3. Trace the selected predecessor operations from the complete-prefix state.
  4. Read the final score with the normalization explicitly stated below.

Interpretation and limits

  • Rewards, gap penalties and sequence length influence the score scale. This implements the paper's scoring recurrence, not its FTSE acceleration.
  • The small arrays are an algorithm illustration, not evidence of retrieval or classification quality.

示例性质: 参考公式演示

SWALE 对容差内的匹配给奖励,对未匹配的观测施加间隙惩罚。递推同时考虑接受的匹配数量与省略观测的费用。本例奖励为 2、间隙分数为 -0.5、容差为 0.35;原始分数没有归一化为概率。

计算步骤

  1. 设置明确的局部计分规则、容差与边界条件。
  2. 对容差匹配给予奖励,否则选择费用较低的间隙转移。
  3. 从完整前缀状态沿选定的前驱操作回溯。
  4. 按下方明确的归一化约定读取最终分数。

解释与使用边界

  • 奖励、间隙惩罚和序列长度都会影响分数量级;本例演示论文的计分递推,没有实现 FTSE 加速。
  • 这些小数组用于解释计算过程,不构成检索或分类性能证据。
Example parameters / 示例参数
{
  "normalization": "none",
  "local_norm": "absolute difference",
  "epsilon": 0.35,
  "match_reward": 2.0,
  "gap_score": -0.5
}

Definition sources / 定义来源: Morse and Patel (2007), Definition 5.1

Edit distance with a real gap erpChecked against EchoTime
Edit distance with a real gap: static final state of the documented numerical example. distance = 1.7.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 1.7 — The explicit definition and parameters shown on this card.

EchoTime coverage: Implemented in EchoTime · erp_distance

D_ij=min(D_(i-1,j-1)+|x_i-y_j|,D_(i-1,j)+|x_i-g|,D_(i,j-1)+|y_j-g|)

Demonstration: Checked against EchoTime

ERP charges the numerical cost of matching observations or matching one observation to a fixed gap value. The animation compares substitution with deletion and insertion at each prefix. Here the gap is 0.5 and the univariate local norm is absolute difference, matching EchoTime's explicit low-level calculation.

How the calculation works

  1. Set the stated local scoring rule, tolerance and boundary conditions.
  2. Compare matching x to y with matching either observation to gap g=0.5.
  3. Trace the selected predecessor operations from the complete-prefix state.
  4. Read the final score with the normalization explicitly stated below.

Interpretation and limits

  • Gap choice changes the cost. If the gap value is also a valid observation, distinct raw lists can have zero ERP distance.
  • The small arrays are an algorithm illustration, not evidence of retrieval or classification quality.

示例性质: 已与 EchoTime 计算核对

ERP 对观测之间的替换以及观测与固定间隙值之间的匹配收取数值代价。动图逐个前缀比较替换、删除与插入。本例间隙值为 0.5,单变量局部范数为绝对差,与 EchoTime 底层计算一致。

计算步骤

  1. 设置明确的局部计分规则、容差与边界条件。
  2. 比较 x 与 y 的匹配,以及任一观测与间隙 g=0.5 的匹配。
  3. 从完整前缀状态沿选定的前驱操作回溯。
  4. 按下方明确的归一化约定读取最终分数。

解释与使用边界

  • 间隙值选择会改变代价;若间隙值也属于合法观测,不同原始列表可以得到零 ERP 距离。
  • 这些小数组用于解释计算过程,不构成检索或分类性能证据。
Example parameters / 示例参数
{
  "normalization": "none",
  "local_norm": "absolute difference",
  "gap_value": 0.5
}

Definition sources / 定义来源: EchoTime low-level similarity implementations; EchoTime imported atlas: named formula conventions

Move, split and merge msmReference-formula demonstration
Move, split and merge: static final state of the documented numerical example. distance = 2.6.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 2.6 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

C(v,a,b)=c if v lies between a,b; else c+min(|v-a|,|v-b|); D=min(move,split,merge)

Demonstration: Reference-formula demonstration

MSM transforms one ordered sequence through move, split and merge operations. Moving costs the absolute change in value. Split/merge costs depend on a base cost and neighboring values, so the recurrence uses local context instead of a fixed gap symbol. The animation displays its cumulative operation costs.

How the calculation works

  1. Set the stated local scoring rule, tolerance and boundary conditions.
  2. Compare a move with context-dependent split and merge costs.
  3. Trace the selected predecessor operations from the complete-prefix state.
  4. Read the final score with the normalization explicitly stated below.

Interpretation and limits

  • This is a univariate definition with c=0.6. Multivariate dependent and independent generalizations require separate conventions.
  • The small arrays are an algorithm illustration, not evidence of retrieval or classification quality.

示例性质: 参考公式演示

MSM 通过移动、分裂和合并操作变换有序序列。移动费用是数值的绝对变化;分裂与合并费用取决于基础费用和邻近数值,因此递推使用局部上下文而非固定间隙符号。动图展示这些操作的累计费用。

计算步骤

  1. 设置明确的局部计分规则、容差与边界条件。
  2. 比较移动费用与依赖上下文的分裂、合并费用。
  3. 从完整前缀状态沿选定的前驱操作回溯。
  4. 按下方明确的归一化约定读取最终分数。

解释与使用边界

  • 本例是 c=0.6 的单变量定义;多变量的联合式与独立式推广须另行指定。
  • 这些小数组用于解释计算过程,不构成检索或分类性能证据。
Example parameters / 示例参数
{
  "normalization": "none",
  "local_norm": "absolute difference",
  "c": 0.6
}

Definition sources / 定义来源: aeon: Move-Split-Merge recurrence

Time warp edit distance twedChecked against EchoTime
Time warp edit distance: static final state of the documented numerical example. distance = 6.7.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 6.7 — The explicit definition and parameters shown on this card.

EchoTime coverage: Implemented in EchoTime · twed_distance

D=min(Dprev+|x_i-y_j|+|x_(i-1)-y_(j-1)|+nu*(|t_i-s_j|+|t_(i-1)-s_(j-1)|),delete_x,delete_y)

Demonstration: Checked against EchoTime

TWED combines edit penalties, consecutive-value changes and timestamp discrepancies. A match compares both the current pair and the preceding pair; deletions also include elapsed-time stiffness. The animation uses the zero-value, zero-time sentinel and infinite leading boundaries from EchoTime's corrected recurrence.

How the calculation works

  1. Set the stated local scoring rule, tolerance and boundary conditions.
  2. Combine value changes, time stiffness and deletion penalties in the minimum-cost recurrence.
  3. Trace the selected predecessor operations from the complete-prefix state.
  4. Read the final score with the normalization explicitly stated below.

Interpretation and limits

  • Positive stiffness, timestamps, the sentinel and boundary conventions matter to metric claims. A constrained or resampled approximation does not automatically inherit them.
  • The small arrays are an algorithm illustration, not evidence of retrieval or classification quality.

示例性质: 已与 EchoTime 计算核对

TWED 联合考虑编辑惩罚、相邻数值变化和时间戳差异。匹配同时比较当前配对与前一个配对;删除还包括经过时间的刚度代价。动图使用 EchoTime 修正递推中的零值零时刻哨兵及无穷边界。

计算步骤

  1. 设置明确的局部计分规则、容差与边界条件。
  2. 在最小代价递推中结合数值变化、时间刚度和删除惩罚。
  3. 从完整前缀状态沿选定的前驱操作回溯。
  4. 按下方明确的归一化约定读取最终分数。

解释与使用边界

  • 正刚度、时间戳、哨兵和边界约定都是度量结论的条件;加约束或重采样近似不自动继承这些性质。
  • 这些小数组用于解释计算过程,不构成检索或分类性能证据。
Example parameters / 示例参数
{
  "normalization": "none",
  "local_norm": "absolute difference",
  "lambda_": 0.4,
  "nu": 0.2,
  "t_x": [
    1.0,
    1.8,
    2.9000000000000004,
    3.8000000000000003,
    5.0,
    6.0,
    6.8,
    8.0,
    9.0,
    9.9
  ],
  "t_y": [
    0.9,
    1.9,
    2.8,
    4.0,
    4.8,
    6.0,
    7.0,
    7.9,
    9.0,
    10.0
  ],
  "sentinel": [
    0,
    0
  ],
  "boundary": "D00=0; other leading states infinite"
}

Definition sources / 定义来源: Marteau: TWED recurrence and stiffness; EchoTime low-level similarity implementations

Discrete Frechet bottleneck discrete_frechetReference-formula demonstration
Discrete Frechet bottleneck: static final state of the documented numerical example. distance = 0.2.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.2 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

F_ij=max(|x_i-y_j|,min(F_(i-1,j),F_(i,j-1),F_(i-1,j-1)))

Demonstration: Reference-formula demonstration

Discrete Frechet comparison minimizes the largest local separation along a monotone traversal. This differs from objectives that add every local mismatch: one difficult pair can determine the bottleneck. Here observations are points on the value axis, with order preserved and no extra time coordinate in the local norm.

How the calculation works

  1. Set the stated local scoring rule, tolerance and boundary conditions.
  2. Keep the larger of the present separation and the smallest predecessor bottleneck.
  3. Trace the selected predecessor operations from the complete-prefix state.
  4. Read the final score with the normalization explicitly stated below.

Interpretation and limits

  • Repeated vertices can make distinct raw vertex lists indistinguishable. Adding time as a coordinate changes the geometry and its scale.
  • The small arrays are an algorithm illustration, not evidence of retrieval or classification quality.

示例性质: 参考公式演示

离散 Fréchet 比较最小化单调遍历过程中最大的局部距离。单个困难配对可能决定最终瓶颈。本例将观测视为数值轴上的点,保留其顺序,但局部范数不额外包含时间坐标。

计算步骤

  1. 设置明确的局部计分规则、容差与边界条件。
  2. 在当前距离和最小前驱瓶颈之间取较大者。
  3. 从完整前缀状态沿选定的前驱操作回溯。
  4. 按下方明确的归一化约定读取最终分数。

解释与使用边界

  • 重复顶点可能使不同原始顶点列表无法区分;加入时间坐标会改变几何与尺度。
  • 这些小数组用于解释计算过程,不构成检索或分类性能证据。
Example parameters / 示例参数
{
  "normalization": "none",
  "local_norm": "absolute difference"
}

Definition sources / 定义来源: Eiter and Mannila (1994): discrete Frechet distance

Global sequence alignment needleman_wunsch_similarityReference-formula demonstration
Global sequence alignment: static final state of the documented numerical example. alignment score = 17.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative alignment score: 17 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

S_ij=max(S_(i-1,j-1)+s_ij,S_(i-1,j)-0.5,S_(i,j-1)-0.5); s_ij=2 if close else -1

Demonstration: Reference-formula demonstration

This numerical Needleman-Wunsch illustration aligns both full sequences using an explicit match/mismatch rule and linear gap costs. The entire prefix table contributes to a global solution ending at its bottom-right cell. The time-series scoring rule is specified here, rather than implied by the algorithm name.

How the calculation works

  1. Set the stated local scoring rule, tolerance and boundary conditions.
  2. Maximize the global score with a match/mismatch or a linear gap transition.
  3. Trace the selected predecessor operations from the complete-prefix state.
  4. Read the final score with the normalization explicitly stated below.

Interpretation and limits

  • The biological algorithm does not fix a numerical time-series substitution score. This educational adaptation uses epsilon=0.35 and linear, not affine, gaps.
  • The small arrays are an algorithm illustration, not evidence of retrieval or classification quality.

示例性质: 参考公式演示

该数值 Needleman-Wunsch 示例使用明确的匹配/不匹配规则与线性间隙费用,对齐两条完整序列。全局解终止于前缀表右下角。本卡明确指定时间序列的计分规则,不将其视为算法名称隐含的唯一选择。

计算步骤

  1. 设置明确的局部计分规则、容差与边界条件。
  2. 使用匹配/不匹配或线性间隙转移,最大化全局分数。
  3. 从完整前缀状态沿选定的前驱操作回溯。
  4. 按下方明确的归一化约定读取最终分数。

解释与使用边界

  • 原始序列算法不规定数值时间序列的替换分数;本教学改写使用 epsilon=0.35 和线性间隙,不使用仿射间隙。
  • 这些小数组用于解释计算过程,不构成检索或分类性能证据。
Example parameters / 示例参数
{
  "normalization": "none",
  "local_norm": "absolute difference",
  "epsilon": 0.35,
  "match_reward": 2.0,
  "gap_score": -0.5,
  "mismatch_score": -1.0
}

Definition sources / 定义来源: Biopython: global and local sequence alignment; EchoTime imported atlas: named formula conventions

Local sequence alignment smith_waterman_similarityReference-formula demonstration
Local sequence alignment: static final state of the documented numerical example. alignment score = 18.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative alignment score: 18 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

S_ij=max(0,S_(i-1,j-1)+s_ij,S_(i-1,j)-0.5,S_(i,j-1)-0.5); result=max_ij S_ij

Demonstration: Reference-formula demonstration

Smith-Waterman allows an alignment to restart at zero, so it can select matching internal subsequences while leaving unrelated ends unused. This explicit numerical example uses the same threshold substitution scores as the global card. The best cell may occur anywhere, and traceback stops when the score returns to zero.

How the calculation works

  1. Set the stated local scoring rule, tolerance and boundary conditions.
  2. Maximize the score with an additional zero restart option at every cell.
  3. Start at the maximum score and stop traceback at zero.
  4. Read the final score with the normalization explicitly stated below.

Interpretation and limits

  • A high local alignment score does not establish whole-series similarity. Substitution and gap choices determine which segment wins.
  • The small arrays are an algorithm illustration, not evidence of retrieval or classification quality.

示例性质: 参考公式演示

Smith-Waterman 允许分数从零重新开始,因此能选择内部匹配子序列,并不使用无关的两端。本数值示例采用与全局卡片相同的阈值替换计分。最优单元格可以位于任意位置,回溯在零分处停止。

计算步骤

  1. 设置明确的局部计分规则、容差与边界条件。
  2. 在每个单元格增加从零开始选项,并最大化分数。
  3. 从最大分数处开始回溯,在零分处停止。
  4. 按下方明确的归一化约定读取最终分数。

解释与使用边界

  • 较高的局部对齐分数不能证明整段序列相似;替换与间隙设定决定获选片段。
  • 这些小数组用于解释计算过程,不构成检索或分类性能证据。
Example parameters / 示例参数
{
  "normalization": "none",
  "local_norm": "absolute difference",
  "epsilon": 0.35,
  "match_reward": 2.0,
  "gap_score": -0.5,
  "mismatch_score": -1.0
}

Definition sources / 定义来源: Biopython: global and local sequence alignment; EchoTime imported atlas: named formula conventions

DTW on local shape descriptors shape_dtwReference-formula demonstration
DTW on local shape descriptors: static final state of the documented numerical example. distance = 0.974679.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.97467943 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

phi(x_i)=[x_(i-1),x_i,x_(i+1)] with edge repetition; d=DTW(phi(x),phi(y))

Demonstration: Reference-formula demonstration

shapeDTW compares short neighborhoods around samples so that a match reflects local context. Here each descriptor contains three raw values with edge repetition, and DTW minimizes squared descriptor differences. The animation reports the descriptor-space objective, an explicit variant rather than a raw-signal score recomputed along its path.

How the calculation works

  1. Construct a three-sample raw neighborhood descriptor at each index, repeating edge values.
  2. Compute local squared discrepancies; apply the indicated weights or admissibility mask.
  3. At each admissible cell, add its local cost to the smallest predecessor cost.
  4. Trace one minimizing path and take the square root of its accumulated objective.

Interpretation and limits

  • Descriptor radius, scaling and the choice to rescore the final path in raw space all change the method. No trained descriptor is used here.
  • Signal scale, path constraints and final normalization must match before distances from different tools are compared.

示例性质: 参考公式演示

shapeDTW 用观测周围的短邻域描述局部形状。本例将三个原始数值组成描述符,边界使用重复填充,然后最小化描述符之间的平方差。动图报告描述符空间的目标值,不是沿该路径重新计算的原始信号距离。

计算步骤

  1. 逐点构造三个采样值的原始邻域描述符,在边界重复端点数值。
  2. 计算局部平方误差,并施加指定权重或允许匹配的掩码。
  3. 在每个允许单元格,把局部代价加到三个前驱的最小累计代价上。
  4. 回溯一条最小化目标的路径,并对其累计目标值取平方根。

解释与使用边界

  • 邻域半径、缩放以及是否在原空间重新计分都会改变结果;本例没有训练描述符。
  • 比较不同工具的数值之前,须统一信号尺度、路径约束和最终归一化。
Example parameters / 示例参数
{
  "local_cost": "squared Euclidean",
  "final_square_root": true,
  "normalization": "none",
  "descriptor": true,
  "descriptor_radius": 1,
  "padding": "edge repetition",
  "reported_cost": "descriptor-space"
}

Definition sources / 定义来源: Zhao and Itti: shapeDTW; EchoTime imported atlas: named formula conventions

Independent-channel DTW independent_dtwReference-formula demonstration
Independent-channel DTW: static final state of the documented numerical example. distance = 0.41069.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.41068967 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

d_independent(X,Y) = (d_base(X_channel1,Y_channel1)+d_base(X_channel2,Y_channel2))/2

Demonstration: Reference-formula demonstration

Independent DTW computes a separate alignment problem for every channel, then averages the resulting distances. The two channels in this example prefer different correspondences. Their paths are shown separately, making explicit that averaging final scores does not impose a shared multivariate warping path.

How the calculation works

  1. Keep matching channel identities and define channelwise preprocessing.
  2. Solve the stated DTW problem independently for channel one and channel two.
  3. Retain each channel's own alignment; different channels may select different time matches.
  4. Take the arithmetic mean of channel distances, with equal weights in this example.

Interpretation and limits

  • Independent warping can break simultaneity across channels; use a shared-path definition when simultaneous events must remain coupled.
  • Channel scale and aggregation convention matter. This atlas uses a mean; some libraries use a sum.

示例性质: 参考公式演示

独立通道 DTW 为每个通道分别求解对齐问题,再平均最终距离。本例两个通道偏好的配对不同,动图分别显示各自路径,因此可直接看到平均分数不等于施加共享的多变量扭曲路径。

计算步骤

  1. 保持通道对应关系,并明确各通道预处理。
  2. 分别求解通道一和通道二的 DTW 问题。
  3. 保留各通道自身的对齐;不同通道可以选择不同时间匹配。
  4. 对通道距离取算术平均;本例使用相等权重。

解释与使用边界

  • 各通道独立扭曲可能破坏通道间同时性;要求同步事件保持耦合时,应选择共享路径定义。
  • 通道尺度和聚合约定会影响结果;本图谱使用平均值,有些库使用求和。
Example parameters / 示例参数
{
  "channels_x": [
    [
      0.2,
      0.4,
      1.1,
      2.4,
      3.2,
      2.5,
      1.2,
      0.3,
      -0.4,
      -0.1
    ],
    [
      0.2,
      0.5,
      1.2,
      2.2,
      2.9,
      2.1,
      1.1,
      0.1,
      -0.2,
      0.1
    ]
  ],
  "channels_y": [
    [
      0.1,
      0.3,
      0.5,
      1.2,
      2.6,
      3.1,
      2.3,
      1.1,
      0.2,
      -0.3
    ],
    [
      0.4,
      1.1,
      2.3,
      3.0,
      2.0,
      1.0,
      0.2,
      -0.1,
      0.0,
      0.2
    ]
  ],
  "base": "dtw",
  "aggregation": "arithmetic mean",
  "channel_values": [
    0.4472135954999581,
    0.37416573867739417
  ]
}

Definition sources / 定义来源: tslearn: DTW definitions and path constraints; EchoTime imported atlas: named formula conventions

Independent-channel CDTW independent_cdtwReference-formula demonstration
Independent-channel CDTW: static final state of the documented numerical example. distance = 0.41069.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.41068967 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

d_independent(X,Y) = (d_base(X_channel1,Y_channel1)+d_base(X_channel2,Y_channel2))/2

Demonstration: Reference-formula demonstration

Independent CDTW computes a separate alignment problem for every channel, then averages the resulting distances. The two channels in this example prefer different correspondences. Their paths are shown separately, making explicit that averaging final scores does not impose a shared multivariate warping path.

How the calculation works

  1. Keep matching channel identities and define channelwise preprocessing.
  2. Solve the stated CDTW problem independently for channel one and channel two.
  3. Retain each channel's own alignment; different channels may select different time matches.
  4. Take the arithmetic mean of channel distances, with equal weights in this example.

Interpretation and limits

  • Independent warping can break simultaneity across channels; use a shared-path definition when simultaneous events must remain coupled.
  • Channel scale and aggregation convention matter. This atlas uses a mean; some libraries use a sum.

示例性质: 参考公式演示

独立通道 CDTW 为每个通道分别求解对齐问题,再平均最终距离。本例两个通道偏好的配对不同,动图分别显示各自路径,因此可直接看到平均分数不等于施加共享的多变量扭曲路径。

计算步骤

  1. 保持通道对应关系,并明确各通道预处理。
  2. 分别求解通道一和通道二的 CDTW 问题。
  3. 保留各通道自身的对齐;不同通道可以选择不同时间匹配。
  4. 对通道距离取算术平均;本例使用相等权重。

解释与使用边界

  • 各通道独立扭曲可能破坏通道间同时性;要求同步事件保持耦合时,应选择共享路径定义。
  • 通道尺度和聚合约定会影响结果;本图谱使用平均值,有些库使用求和。
Example parameters / 示例参数
{
  "channels_x": [
    [
      0.2,
      0.4,
      1.1,
      2.4,
      3.2,
      2.5,
      1.2,
      0.3,
      -0.4,
      -0.1
    ],
    [
      0.2,
      0.5,
      1.2,
      2.2,
      2.9,
      2.1,
      1.1,
      0.1,
      -0.2,
      0.1
    ]
  ],
  "channels_y": [
    [
      0.1,
      0.3,
      0.5,
      1.2,
      2.6,
      3.1,
      2.3,
      1.1,
      0.2,
      -0.3
    ],
    [
      0.4,
      1.1,
      2.3,
      3.0,
      2.0,
      1.0,
      0.2,
      -0.1,
      0.0,
      0.2
    ]
  ],
  "base": "cdtw",
  "aggregation": "arithmetic mean",
  "channel_values": [
    0.4472135954999581,
    0.37416573867739417
  ],
  "window": 1
}

Definition sources / 定义来源: tslearn: DTW definitions and path constraints; EchoTime imported atlas: named formula conventions

Independent-channel WDTW independent_wdtwReference-formula demonstration
Independent-channel WDTW: static final state of the documented numerical example. distance = 0.109827.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.10982745 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

d_independent(X,Y) = (d_base(X_channel1,Y_channel1)+d_base(X_channel2,Y_channel2))/2

Demonstration: Reference-formula demonstration

Independent WDTW computes a separate alignment problem for every channel, then averages the resulting distances. The two channels in this example prefer different correspondences. Their paths are shown separately, making explicit that averaging final scores does not impose a shared multivariate warping path.

How the calculation works

  1. Keep matching channel identities and define channelwise preprocessing.
  2. Solve the stated WDTW problem independently for channel one and channel two.
  3. Retain each channel's own alignment; different channels may select different time matches.
  4. Take the arithmetic mean of channel distances, with equal weights in this example.

Interpretation and limits

  • Independent warping can break simultaneity across channels; use a shared-path definition when simultaneous events must remain coupled.
  • Channel scale and aggregation convention matter. This atlas uses a mean; some libraries use a sum.

示例性质: 参考公式演示

独立通道 WDTW 为每个通道分别求解对齐问题,再平均最终距离。本例两个通道偏好的配对不同,动图分别显示各自路径,因此可直接看到平均分数不等于施加共享的多变量扭曲路径。

计算步骤

  1. 保持通道对应关系,并明确各通道预处理。
  2. 分别求解通道一和通道二的 WDTW 问题。
  3. 保留各通道自身的对齐;不同通道可以选择不同时间匹配。
  4. 对通道距离取算术平均;本例使用相等权重。

解释与使用边界

  • 各通道独立扭曲可能破坏通道间同时性;要求同步事件保持耦合时,应选择共享路径定义。
  • 通道尺度和聚合约定会影响结果;本图谱使用平均值,有些库使用求和。
Example parameters / 示例参数
{
  "channels_x": [
    [
      0.2,
      0.4,
      1.1,
      2.4,
      3.2,
      2.5,
      1.2,
      0.3,
      -0.4,
      -0.1
    ],
    [
      0.2,
      0.5,
      1.2,
      2.2,
      2.9,
      2.1,
      1.1,
      0.1,
      -0.2,
      0.1
    ]
  ],
  "channels_y": [
    [
      0.1,
      0.3,
      0.5,
      1.2,
      2.6,
      3.1,
      2.3,
      1.1,
      0.2,
      -0.3
    ],
    [
      0.4,
      1.1,
      2.3,
      3.0,
      2.0,
      1.0,
      0.2,
      -0.1,
      0.0,
      0.2
    ]
  ],
  "base": "wdtw",
  "aggregation": "arithmetic mean",
  "channel_values": [
    0.12037329396424752,
    0.09928160123271255
  ],
  "weighted": true,
  "g": 0.6
}

Definition sources / 定义来源: aeon: logistic weighted DTW; EchoTime imported atlas: named formula conventions

Independent-channel DDTW independent_ddtwReference-formula demonstration
Independent-channel DDTW: static final state of the documented numerical example. distance = 0.734442.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.73444173 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

d_independent(X,Y) = (d_base(X_channel1,Y_channel1)+d_base(X_channel2,Y_channel2))/2

Demonstration: Reference-formula demonstration

Independent DDTW computes a separate alignment problem for every channel, then averages the resulting distances. The two channels in this example prefer different correspondences. Their paths are shown separately, making explicit that averaging final scores does not impose a shared multivariate warping path.

How the calculation works

  1. Keep matching channel identities and define channelwise preprocessing.
  2. Solve the stated DDTW problem independently for channel one and channel two.
  3. Retain each channel's own alignment; different channels may select different time matches.
  4. Take the arithmetic mean of channel distances, with equal weights in this example.

Interpretation and limits

  • Independent warping can break simultaneity across channels; use a shared-path definition when simultaneous events must remain coupled.
  • Channel scale and aggregation convention matter. This atlas uses a mean; some libraries use a sum.

示例性质: 参考公式演示

独立通道 DDTW 为每个通道分别求解对齐问题,再平均最终距离。本例两个通道偏好的配对不同,动图分别显示各自路径,因此可直接看到平均分数不等于施加共享的多变量扭曲路径。

计算步骤

  1. 保持通道对应关系,并明确各通道预处理。
  2. 分别求解通道一和通道二的 DDTW 问题。
  3. 保留各通道自身的对齐;不同通道可以选择不同时间匹配。
  4. 对通道距离取算术平均;本例使用相等权重。

解释与使用边界

  • 各通道独立扭曲可能破坏通道间同时性;要求同步事件保持耦合时,应选择共享路径定义。
  • 通道尺度和聚合约定会影响结果;本图谱使用平均值,有些库使用求和。
Example parameters / 示例参数
{
  "channels_x": [
    [
      0.2,
      0.4,
      1.1,
      2.4,
      3.2,
      2.5,
      1.2,
      0.3,
      -0.4,
      -0.1
    ],
    [
      0.2,
      0.5,
      1.2,
      2.2,
      2.9,
      2.1,
      1.1,
      0.1,
      -0.2,
      0.1
    ]
  ],
  "channels_y": [
    [
      0.1,
      0.3,
      0.5,
      1.2,
      2.6,
      3.1,
      2.3,
      1.1,
      0.2,
      -0.3
    ],
    [
      0.4,
      1.1,
      2.3,
      3.0,
      2.0,
      1.0,
      0.2,
      -0.1,
      0.0,
      0.2
    ]
  ],
  "base": "ddtw",
  "aggregation": "arithmetic mean",
  "channel_values": [
    0.8944271909999162,
    0.5744562646538028
  ],
  "derivative": true,
  "derivative_convention": "adjacent first differences"
}

Definition sources / 定义来源: tslearn: DTW definitions and path constraints; EchoTime imported atlas: named formula conventions

Independent-channel ERP independent_erpReference-formula demonstration
Independent-channel ERP: static final state of the documented numerical example. distance = 1.5.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 1.5 — The explicit definition and parameters shown on this card.

EchoTime coverage: Possible addition

d_independent(X,Y) = (d_base(X_channel1,Y_channel1)+d_base(X_channel2,Y_channel2))/2

Demonstration: Reference-formula demonstration

Independent ERP computes a separate alignment problem for every channel, then averages the resulting distances. The two channels in this example prefer different correspondences. Their paths are shown separately, making explicit that averaging final scores does not impose a shared multivariate warping path.

How the calculation works

  1. Keep matching channel identities and define channelwise preprocessing.
  2. Solve the stated ERP problem independently for channel one and channel two.
  3. Retain each channel's own alignment; different channels may select different time matches.
  4. Take the arithmetic mean of channel distances, with equal weights in this example.

Interpretation and limits

  • Independent warping can break simultaneity across channels; use a shared-path definition when simultaneous events must remain coupled.
  • Channel scale and aggregation convention matter. This atlas uses a mean; some libraries use a sum.

示例性质: 参考公式演示

独立通道 ERP 为每个通道分别求解对齐问题,再平均最终距离。本例两个通道偏好的配对不同,动图分别显示各自路径,因此可直接看到平均分数不等于施加共享的多变量扭曲路径。

计算步骤

  1. 保持通道对应关系,并明确各通道预处理。
  2. 分别求解通道一和通道二的 ERP 问题。
  3. 保留各通道自身的对齐;不同通道可以选择不同时间匹配。
  4. 对通道距离取算术平均;本例使用相等权重。

解释与使用边界

  • 各通道独立扭曲可能破坏通道间同时性;要求同步事件保持耦合时,应选择共享路径定义。
  • 通道尺度和聚合约定会影响结果;本图谱使用平均值,有些库使用求和。
Example parameters / 示例参数
{
  "channels_x": [
    [
      0.2,
      0.4,
      1.1,
      2.4,
      3.2,
      2.5,
      1.2,
      0.3,
      -0.4,
      -0.1
    ],
    [
      0.2,
      0.5,
      1.2,
      2.2,
      2.9,
      2.1,
      1.1,
      0.1,
      -0.2,
      0.1
    ]
  ],
  "channels_y": [
    [
      0.1,
      0.3,
      0.5,
      1.2,
      2.6,
      3.1,
      2.3,
      1.1,
      0.2,
      -0.3
    ],
    [
      0.4,
      1.1,
      2.3,
      3.0,
      2.0,
      1.0,
      0.2,
      -0.1,
      0.0,
      0.2
    ]
  ],
  "base": "erp",
  "aggregation": "arithmetic mean",
  "channel_values": [
    1.7000000000000002,
    1.2999999999999996
  ],
  "gap_value": 0.5
}

Definition sources / 定义来源: EchoTime low-level similarity implementations; EchoTime imported atlas: named formula conventions

Kernel constructions / 核函数构造 10
Linear inner-product kernel linear_kernelReference-formula demonstration
Linear inner-product kernel: static final state of the documented numerical example. kernel score = 22.68.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative kernel score: 22.68 — The explicit definition and parameters shown on this card.

EchoTime coverage: Low-priority addition

K(x,y)=sum_i x_i*y_i

Demonstration: Reference-formula demonstration

The linear kernel adds products of corresponding coordinates. Its animation shows which indices contribute positively or negatively before adding them into the inner product. It preserves amplitude and offset effects unless preprocessing removes them, and its scale grows with vector energy.

How the calculation works

  1. Use the same aligned coordinate system for both vectors.
  2. Compute and sum the coordinatewise contributions shown in the plot.
  3. Apply the specified scalar kernel transformation to that complete sum.
  4. Read the pair score; kernel magnitude is not a calibrated similarity probability.

Interpretation and limits

  • An inner product is not bounded by one and can be negative; normalization would produce a different kernel or cosine score.
  • No local time warping is performed by this aligned-vector construction.

示例性质: 参考公式演示

线性核将对应坐标的乘积相加。动图先展示各位置的正负贡献,再累加成内积。若预处理没有消除幅度与偏移,它们会保留在结果中;分数量级随向量能量变化。

计算步骤

  1. 对两个向量使用同一个已对齐坐标系。
  2. 计算图示逐坐标贡献并求和。
  3. 对完整求和结果施加指定的标量核变换。
  4. 读取成对分数;核函数量级不是校准后的相似概率。

解释与使用边界

  • 内积没有一的上界,也可以为负;归一化会产生不同的核或余弦分数。
  • 此已对齐向量构造不执行局部时间扭曲。
Example parameters / 示例参数
{
  "preprocessing": "none"
}

Definition sources / 定义来源: scikit-learn: pairwise kernels and their formulas

Polynomial kernel polynomial_kernelReference-formula demonstration
Polynomial kernel: static final state of the documented numerical example. kernel score = 34.9017.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative kernel score: 34.901665 — The explicit definition and parameters shown on this card.

EchoTime coverage: Low-priority addition

K(x,y)=(0.1*dot(x,y)+1)^3

Demonstration: Reference-formula demonstration

The polynomial kernel first computes an inner product, then applies a shifted integer power. Here degree three creates nonlinear interactions implicitly without constructing every product feature. The animation separates the coordinate sum from its nonlinear expansion, so the large final magnitude is not mistaken for a probability.

How the calculation works

  1. Use the same aligned coordinate system for both vectors.
  2. Compute and sum the coordinatewise contributions shown in the plot.
  3. Apply the specified scalar kernel transformation to that complete sum.
  4. Read the pair score; kernel magnitude is not a calibrated similarity probability.

Interpretation and limits

  • The usual positive-semidefinite guarantee uses a nonnegative scale/offset and integer degree. Large norms or degrees can dominate numerically.
  • No local time warping is performed by this aligned-vector construction.

示例性质: 参考公式演示

多项式核先计算内积,再对平移后的结果取整数次幂。本例次数为三,隐式表示非线性交互而不逐一构造乘积特征。动图分开显示坐标求和与非线性展开,最终大数值不能解释为概率。

计算步骤

  1. 对两个向量使用同一个已对齐坐标系。
  2. 计算图示逐坐标贡献并求和。
  3. 对完整求和结果施加指定的标量核变换。
  4. 读取成对分数;核函数量级不是校准后的相似概率。

解释与使用边界

  • 通常的半正定保证使用非负尺度、非负偏置和整数次数;较大范数或次数可能在数值上主导结果。
  • 此已对齐向量构造不执行局部时间扭曲。
Example parameters / 示例参数
{
  "preprocessing": "none",
  "gamma": 0.1,
  "coef0": 1.0,
  "degree": 3
}

Definition sources / 定义来源: scikit-learn: pairwise kernels and their formulas

Sigmoid similarity transform sigmoid_kernelReference-formula demonstration
Sigmoid similarity transform: static final state of the documented numerical example. kernel score = 0.94339.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative kernel score: 0.94338981 — The explicit definition and parameters shown on this card.

EchoTime coverage: Low-priority addition

K(x,y)=tanh(0.1*dot(x,y)-0.5)

Demonstration: Reference-formula demonstration

This sigmoid score maps an affine inner product through tanh. The animation shows saturation: sufficiently large input scores compress into a narrow output range. The formula is commonly called a sigmoid kernel, but arbitrary scale and offset choices do not guarantee a positive-semidefinite Gram matrix.

How the calculation works

  1. Use the same aligned coordinate system for both vectors.
  2. Compute and sum the coordinatewise contributions shown in the plot.
  3. Apply the specified scalar kernel transformation to that complete sum.
  4. Read the pair score; kernel magnitude is not a calibrated similarity probability.

Interpretation and limits

  • A bounded output does not establish positive semidefiniteness or a probabilistic interpretation; saturation can hide changes in the input dot product.
  • No local time warping is performed by this aligned-vector construction.

示例性质: 参考公式演示

该 sigmoid 分数将内积的仿射变换送入 tanh。动图展示饱和现象:较大输入分数被压缩到很窄的输出范围。该公式常称为 sigmoid 核,但任意尺度与偏置选择不保证 Gram 矩阵半正定。

计算步骤

  1. 对两个向量使用同一个已对齐坐标系。
  2. 计算图示逐坐标贡献并求和。
  3. 对完整求和结果施加指定的标量核变换。
  4. 读取成对分数;核函数量级不是校准后的相似概率。

解释与使用边界

  • 输出有界不能证明半正定性或概率解释;饱和可能掩盖输入内积变化。
  • 此已对齐向量构造不执行局部时间扭曲。
Example parameters / 示例参数
{
  "preprocessing": "none",
  "gamma": 0.1,
  "coef0": -0.5
}

Definition sources / 定义来源: scikit-learn: pairwise kernels and their formulas

Gaussian kernel on aligned values rbf_kernelReference-formula demonstration
Gaussian kernel on aligned values: static final state of the documented numerical example. kernel score = 0.147195.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative kernel score: 0.14719456 — The explicit definition and parameters shown on this card.

EchoTime coverage: Low-priority addition

K(x,y)=exp(-0.4*sum_i (x_i-y_i)^2)

Demonstration: Reference-formula demonstration

The Gaussian RBF kernel converts squared Euclidean discrepancy between aligned vectors into an exponentially decreasing score. The animation first accumulates squared residuals, then locates that total on the exponential curve. Its bandwidth controls how quickly disagreement reduces the score, while time alignment remains fixed.

How the calculation works

  1. Use the same aligned coordinate system for both vectors.
  2. Compute and sum the coordinatewise contributions shown in the plot.
  3. Apply the specified scalar kernel transformation to that complete sum.
  4. Read the pair score; kernel magnitude is not a calibrated similarity probability.

Interpretation and limits

  • Signal scaling changes effective bandwidth. Equal dimensionality and aligned coordinates are required by this illustrated vector kernel.
  • No local time warping is performed by this aligned-vector construction.

示例性质: 参考公式演示

高斯 RBF 核将已对齐向量的平方欧氏差异转成指数递减分数。动图先累加平方残差,再把总量定位到指数曲线上。带宽控制分数随差异下降的速度,时间对齐保持固定。

计算步骤

  1. 对两个向量使用同一个已对齐坐标系。
  2. 计算图示逐坐标贡献并求和。
  3. 对完整求和结果施加指定的标量核变换。
  4. 读取成对分数;核函数量级不是校准后的相似概率。

解释与使用边界

  • 信号缩放改变有效带宽;此向量核示例要求维度一致且坐标已对齐。
  • 此已对齐向量构造不执行局部时间扭曲。
Example parameters / 示例参数
{
  "preprocessing": "none",
  "gamma": 0.4
}

Definition sources / 定义来源: scikit-learn: pairwise kernels and their formulas

Exponential transform of DTW dtw_rbf_kernelReference-formula demonstration
Exponential transform of DTW: static final state of the documented numerical example. kernel score = 0.869358.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative kernel score: 0.86935824 — The explicit definition and parameters shown on this card.

EchoTime coverage: Low-priority addition

K=exp(-0.7*DTW(x,y)^2), DTW uses squared costs then square root

Demonstration: Reference-formula demonstration

This construction first selects the minimum-cost DTW path and then exponentially transforms its squared distance. The animation shows the path calculation before the score conversion. Although the formula resembles a Gaussian kernel, replacing Euclidean distance by DTW does not automatically preserve positive semidefiniteness.

How the calculation works

  1. Build squared local costs and a monotone DTW recurrence.
  2. Select the path with the least accumulated discrepancy.
  3. Use that accumulated cost as DTW squared in exp(-gamma*cost).
  4. Interpret the decreasing score with gamma=0.7 and the stated local norm.

Interpretation and limits

  • A DTW-based exponential may produce an indefinite Gram matrix. Do not infer kernel-method guarantees from its name.
  • The value changes with the path band, local cost and distance normalization.

示例性质: 参考公式演示

该构造先选择最低代价 DTW 路径,再对距离平方做指数变换。动图先展示路径计算,再展示分数转换。将欧氏距离替换成 DTW 不自动保留高斯核的半正定性。

计算步骤

  1. 构造平方局部代价与单调 DTW 递推。
  2. 选择累计差异最小的路径。
  3. 把该累计代价作为 DTW 平方代入 exp(-gamma*cost)。
  4. 结合 gamma=0.7 和明确的局部范数理解该递减分数。

解释与使用边界

  • DTW 指数形式可能得到不定 Gram 矩阵;不能从名称推断核方法保证。
  • 路径窗口、局部代价和距离归一化都会改变结果。
Example parameters / 示例参数
{
  "gamma": 0.7,
  "base_distance": 0.4472135954999581,
  "squared_distance": 0.20000000000000015
}

Definition sources / 定义来源: tslearn: DTW definitions and path constraints; Cuturi (2011): local-kernel conditions for global alignment

Exponential transform of SBD sbd_kernelReference-formula demonstration
Exponential transform of SBD: static final state of the documented numerical example. kernel score = 0.82362.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative kernel score: 0.82362 — The explicit definition and parameters shown on this card.

EchoTime coverage: Low-priority addition

K=exp(-2*(1-max_lag NCC_lag(z(x),z(y))))

Demonstration: Reference-formula demonstration

SBD selects the largest normalized cross-correlation over global shifts, then subtracts it from one. This atlas construction maps that SBD value through exp(-2*SBD). The lag sweep makes its shift tolerance visible, while its full-series normalization distinguishes it from overlap-normalized Pearson correlation.

How the calculation works

  1. Z-normalize both series using their own full-series mean and standard deviation.
  2. Evaluate zero-padded cross-correlation at every global lag.
  3. Set SBD to one minus the largest full-energy-normalized correlation.
  4. Apply exp(-2*SBD) to obtain the stated kernel-like score.

Interpretation and limits

  • Maximizing over shifts and exponentiating a distance-like score do not establish positive semidefiniteness.
  • Only one global lag is chosen. Constant inputs have undefined statistical normalization and need an explicit software convention.

示例性质: 参考公式演示

SBD 在全局平移中选择最大的归一化互相关,再用一减去该值。本图谱构造进一步计算 exp(-2*SBD)。动图逐个扫描滞后,展示平移容忍性;采用完整序列能量归一化,与重叠区域 Pearson 相关不同。

计算步骤

  1. 用各自完整序列的均值和标准差进行 z 标准化。
  2. 在每个全局滞后处计算零填充互相关。
  3. 令 SBD 等于一减完整能量归一化相关的最大值。
  4. 应用 exp(-2*SBD),得到明确约定的核形式分数。

解释与使用边界

  • 对平移取最大值再指数化距离形式分数,不能证明半正定性。
  • 只选择一个全局滞后;常数输入的统计归一化未定义,需要明确的软件约定。
Example parameters / 示例参数
{
  "gamma": 2.0,
  "normalize": true,
  "NCC_normalization": "full-series L2 energies",
  "best_lag": -1,
  "sbd": 0.09702301325884444
}

Definition sources / 定义来源: EchoTime low-level similarity implementations; EchoTime imported atlas: named formula conventions

Exponential soft-DTW divergence soft_dtw_kernelReference-formula demonstration
Exponential soft-DTW divergence: static final state of the documented numerical example. kernel score = 0.655647.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative kernel score: 0.65564656 — The explicit definition and parameters shown on this card.

EchoTime coverage: Low-priority addition

K=exp(-D_gamma/gamma); D_gamma=sDTW(x,y)-0.5*sDTW(x,x)-0.5*sDTW(y,y)

Demonstration: Reference-formula demonstration

This imported atlas name denotes an exponential of the self-corrected soft-DTW divergence. It first includes contributions from multiple alignments, subtracts both self terms, then applies exp(-D/gamma). This explicit construction is separate from directly exponentiating raw soft-DTW or choosing a modified local kernel for GAK.

How the calculation works

  1. Compute cross and self soft-DTW objectives with the same gamma and local cost.
  2. Inspect the diffuse occupancy of alternative alignments.
  3. Subtract the self terms to obtain the corrected divergence D.
  4. Evaluate exp(-D/gamma) using gamma=0.7.

Interpretation and limits

  • A corrected divergence does not by itself prove that its exponential is a positive-semidefinite kernel for an arbitrary ground cost.
  • This gamma is used for both soft alignment and the final exponential; a separate outer bandwidth would define another variant.

示例性质: 参考公式演示

本图谱名称对应自修正 soft-DTW 散度的指数形式。先综合多个对齐路径,减去两个自对齐项,再计算 exp(-D/gamma)。该明确构造区别于直接指数化原始 soft-DTW,也区别于为 GAK 选择修正局部核。

计算步骤

  1. 使用相同 gamma 和局部代价计算交叉及自对齐 soft-DTW。
  2. 检查备选对齐的分散占据权重。
  3. 扣除自对齐项得到修正散度 D。
  4. 使用 gamma=0.7 计算 exp(-D/gamma)。

解释与使用边界

  • 修正散度本身不能证明对任意局部代价,其指数形式都是半正定核。
  • 这里同一个 gamma 同时控制软对齐与最终指数变换;若另设外层带宽,则得到另一变体。
Example parameters / 示例参数
{
  "gamma": 0.7,
  "ground_cost": "squared Euclidean",
  "divergence": 0.2954933934215753
}

Definition sources / 定义来源: Blondel, Mensch and Vert (2021): corrected divergences; Cuturi and Blondel (2017): Soft-DTW; EchoTime imported atlas: named formula conventions

Global alignment kernel gakReference-formula demonstration
Global alignment kernel: static final state of the documented numerical example. kernel score = 3739.51.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative kernel score: 3739.5094 — The explicit definition and parameters shown on this card.

EchoTime coverage: Low-priority addition

K_ij=kappa_ij*(K_(i-1,j)+K_(i,j-1)+K_(i-1,j-1)); kappa=phi/(2-phi), K_00=1

Demonstration: Reference-formula demonstration

The Global Alignment Kernel adds products of local similarities over all monotone alignment paths. The dynamic program uses a sum rather than choosing a minimum-cost predecessor. Here the local kernel is phi/(2-phi), with phi a Gaussian, following a sufficient positive-definiteness construction; the displayed result is unnormalized.

How the calculation works

  1. Build phi=exp(-squared_cost/(2*sigma^2)) with sigma=1, then kappa=phi/(2-phi).
  2. Multiply each local kappa by the sum of its three predecessor path weights.
  3. Accumulate every monotone alignment; do not replace the sum with a maximum or minimum.
  4. Read the unnormalized path sum; optional self-normalization is a separate step.

Interpretation and limits

  • An arbitrary local similarity or hard path restriction does not inherit the stated positive-definiteness construction.
  • Raw path sums depend strongly on sequence length and can overflow for long inputs; log-domain computation and self-normalization are distinct remedies.

示例性质: 参考公式演示

全局对齐核将所有单调对齐路径上的局部相似度乘积相加。动态规划对前驱求和,不选择最低代价前驱。本例局部核为 phi/(2-phi),其中 phi 是高斯核,对应一个充分的正定性构造;输出未做自相似归一化。

计算步骤

  1. 用 sigma=1 构造 phi=exp(-平方代价/(2*sigma^2)),再令 kappa=phi/(2-phi)。
  2. 每个局部 kappa 乘以三个前驱路径权重之和。
  3. 累加全部单调对齐,不能将求和换成最大或最小值。
  4. 读取未归一化路径和;可选的自相似归一化是另一个步骤。

解释与使用边界

  • 任意局部相似度或硬路径限制都不自动继承上述正定性构造。
  • 原始路径和强烈依赖长度,长输入可能溢出;对数域计算和自相似归一化是不同处理方式。
Example parameters / 示例参数
{
  "sigma": 1.0,
  "local_kernel": "phi/(2-phi)",
  "normalization": "none",
  "hard_path_band": null,
  "epsilon": 0.0,
  "raw_gak": 3739.5094447576153
}

Definition sources / 定义来源: Cuturi (2011): local-kernel conditions for global alignment; EchoTime imported atlas: named formula conventions

Log global alignment score lgakReference-formula demonstration
Log global alignment score: static final state of the documented numerical example. kernel score = 8.22671.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative kernel score: 8.2267097 — The explicit definition and parameters shown on this card.

EchoTime coverage: Low-priority addition

log(K_GA+1e-12), K_GA=sum_paths product(phi/(2-phi)), phi=exp(-(x_i-y_j)^2/2)

Demonstration: Reference-formula demonstration

Log GAK applies a logarithm to the positive sum of alignment weights. The underlying computation still uses sum-product dynamic programming, so all admissible paths contribute. This card uses Cuturi's modified Gaussian local kernel and reports log of the unnormalized path sum, with a stated tiny epsilon for numerical definition.

How the calculation works

  1. Build phi=exp(-squared_cost/(2*sigma^2)) with sigma=1, then kappa=phi/(2-phi).
  2. Multiply each local kappa by the sum of its three predecessor path weights.
  3. Accumulate every monotone alignment; do not replace the sum with a maximum or minimum.
  4. Apply log(K+epsilon) to compress the positive output scale.

Interpretation and limits

  • The logarithm does not generally preserve positive semidefiniteness; log GAK is a score transformation, not an automatic Mercer kernel.
  • Raw path sums depend strongly on sequence length and can overflow for long inputs; log-domain computation and self-normalization are distinct remedies.

示例性质: 参考公式演示

Log GAK 对正的对齐权重总和取对数。底层仍使用求和—乘积动态规划,因此全部允许路径共同贡献。本卡采用 Cuturi 的修正高斯局部核,报告未归一化路径和的对数,并明确微小 epsilon 的数值约定。

计算步骤

  1. 用 sigma=1 构造 phi=exp(-平方代价/(2*sigma^2)),再令 kappa=phi/(2-phi)。
  2. 每个局部 kappa 乘以三个前驱路径权重之和。
  3. 累加全部单调对齐,不能将求和换成最大或最小值。
  4. 应用 log(K+epsilon) 压缩正输出的量级。

解释与使用边界

  • 取对数一般不保留半正定性;log GAK 是分数变换,不自动成为 Mercer 核。
  • 原始路径和强烈依赖长度,长输入可能溢出;对数域计算和自相似归一化是不同处理方式。
Example parameters / 示例参数
{
  "sigma": 1.0,
  "local_kernel": "phi/(2-phi)",
  "normalization": "none",
  "hard_path_band": null,
  "epsilon": 1e-12,
  "raw_gak": 3739.5094447576153
}

Definition sources / 定义来源: Cuturi (2011): local-kernel conditions for global alignment; EchoTime imported atlas: named formula conventions

Weighted lag correlation score weighted_ncc_kernelReference-formula demonstration
Weighted lag correlation score: static final state of the documented numerical example. kernel score = 0.280203.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative kernel score: 0.28020318 — The explicit definition and parameters shown on this card.

EchoTime coverage: Low-priority addition

K=sum_l w_l*NCC_l(z(x),z(y)); w_l proportional to exp(-l^2/(2*2^2))

Demonstration: Reference-formula demonstration

This explicitly specified score averages normalized cross-correlations across lags using fixed symmetric weights. Nearby shifts receive more weight than large shifts; no winning lag is selected. The animation separates correlation, lag preference, multiplication and accumulation, making clear how the score differs from maximum NCC.

How the calculation works

  1. Z-normalize the input and compute full-energy NCC for all zero-padded shifts.
  2. Assign Gaussian lag weights with sigma=2 and normalize their sum to one.
  3. Multiply every lag correlation by its corresponding weight.
  4. Sum the contributions; this score averages lag evidence rather than selecting one lag.

Interpretation and limits

  • Weighting rules are part of the definition. This generic atlas formula does not supply a positive-semidefinite guarantee for arbitrary lag weights.
  • Full-series normalization, zero padding and centering differ from overlap-specific correlations. Constant inputs need a separate convention.

示例性质: 参考公式演示

该明确指定的分数使用固定对称权重对各滞后的归一化互相关求加权平均。较小位移得到较大权重,不选择获胜滞后。动图分别展示相关、滞后偏好、乘法和累计过程,说明其与最大 NCC 的计算区别。

计算步骤

  1. 对输入 z 标准化,并计算所有零填充位移的完整能量 NCC。
  2. 设置 sigma=2 的高斯滞后权重,并使权重总和为一。
  3. 将每个滞后相关乘以对应权重。
  4. 累计贡献;该分数平均滞后证据,不选取单个滞后。

解释与使用边界

  • 权重规则是定义的一部分;通用图谱公式不为任意滞后权重提供半正定保证。
  • 完整序列归一化、零填充和中心化与重叠区域相关不同;常数输入需要另行约定。
Example parameters / 示例参数
{
  "lag_sigma": 2.0,
  "weights": [
    7.991883346614543e-06,
    6.691521999827503e-05,
    0.00043634204600584767,
    0.0022159277531582037,
    0.008764164276189704,
    0.026995526470205037,
    0.06475890149700968,
    0.12098555592953981,
    0.17603294517029064,
    0.1994714595085123,
    0.17603294517029064,
    0.12098555592953981,
    0.06475890149700968,
    0.026995526470205037,
    0.008764164276189704,
    0.0022159277531582037,
    0.00043634204600584767,
    6.691521999827503e-05,
    7.991883346614543e-06
  ],
  "lags": [
    -9,
    -8,
    -7,
    -6,
    -5,
    -4,
    -3,
    -2,
    -1,
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9
  ],
  "normalization": "full-series energy; weights sum to one",
  "centered": true
}

Definition sources / 定义来源: EchoTime low-level similarity implementations; EchoTime imported atlas: named formula conventions

Explicit features / 显式特征 18
Basic statistics distance stats_distanceReference-formula demonstration
Basic statistics distance: static final state of the documented numerical example. distance = 0.399763.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.3997628 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Possible addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Reference-formula demonstration

Represent each series by its mean, population standard deviation, minimum and maximum. These four coordinates summarize level, spread and range; their order in the vector is fixed, while the original temporal order is discarded. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Compute mean, population SD, minimum and maximum in that order.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Permuting observations leaves this vector unchanged, even when temporal behavior changes completely.
  • Features have different scales; this example uses no coordinate weighting. A production scaler must be fitted without test-data leakage.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 参考公式演示

把每条序列表示为均值、总体标准差、最小值和最大值四个坐标。它们概括水平、波动和范围,坐标顺序固定,但原始时间顺序被舍弃。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 按均值、总体标准差、最小值、最大值的顺序提取特征。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 任意重排序列不会改变该向量,即使时间行为发生显著变化。
  • 各坐标尺度不同;本例不加权。实际使用的缩放器应避免测试数据泄漏。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "features": [
    "mean",
    "std_ddof0",
    "min",
    "max"
  ],
  "coordinate_scaling": "none",
  "comparison": "euclidean"
}

Definition sources / 定义来源: NumPy: summary-statistic definitions; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Robust statistics distance robust_stats_distanceReference-formula demonstration
Robust statistics distance: static final state of the documented numerical example. distance = 0.126419.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.12641944 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Possible addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Reference-formula demonstration

Replace extrema and moments with the lower quartile, median, upper quartile and median absolute deviation. This explicit descriptor emphasizes the central distribution and reduces the influence of isolated extreme values. It does not preserve the timing of those values. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Calculate Q25, median, Q75 and unscaled median absolute deviation.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Robustness concerns these particular statistics, not immunity to arbitrary contamination or distribution shift.
  • Quantiles use linear interpolation and MAD is unscaled; alternative conventions produce different vectors.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 参考公式演示

使用下四分位数、中位数、上四分位数和中位绝对偏差构成明确的描述向量。它强调分布的中心部分,降低孤立极端值的影响,同时舍弃这些数值出现的时刻。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 计算 Q25、中位数、Q75 和未经常数缩放的中位绝对偏差。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 稳健性针对所选统计量,并不表示可抵抗任意污染或分布变化。
  • 本例分位数采用线性插值,MAD 不乘缩放常数;其他约定会产生不同向量。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "features": [
    "q25",
    "median",
    "q75",
    "unscaled_MAD"
  ],
  "quantile_method": "linear",
  "comparison": "euclidean"
}

Definition sources / 定义来源: NumPy: summary-statistic definitions; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Autocorrelation features distance acf_distanceChecked against EchoTime
Autocorrelation features distance: static final state of the documented numerical example. distance = 0.368804.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.36880413 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Implemented in EchoTime · acf_distance

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Checked against EchoTime

Center each series and compare it with delayed versions of itself. Six lag coordinates summarize repeated linear dependence. This example follows EchoTime's adjusted denominator, (n-lag) times the population variance, and omits the always-one lag-zero coordinate. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. At each lag, sum centered lagged products and divide by (n-lag) times variance.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Adjusted high-lag sample estimates need not remain inside [-1,1]; estimates are less reliable with fewer overlapping pairs.
  • ACF drops the mean and amplitude scale and cannot fully identify nonlinear dependence or the original waveform.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 已与 EchoTime 计算核对

先对序列去均值,再与自身的延迟版本比较。六个滞后坐标描述重复出现的线性依赖。本例采用 EchoTime 的调整分母,即 (n-lag) 乘总体方差,并省略恒为一的零滞后坐标。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 逐个滞后累加去均值后的乘积,除以 (n-lag) 乘方差。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 经过样本数调整的高滞后估计不一定落在 [-1,1],重叠点越少估计越不稳定。
  • ACF 舍弃均值和振幅尺度,无法完整识别非线性依赖或恢复原波形。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "max_lag": 6,
  "denominator": "(n-lag)*population_variance",
  "lag_zero": "omitted",
  "comparison": "euclidean"
}

Definition sources / 定义来源: EchoTime low-level implementation; statsmodels: ACF denominator and adjusted convention; Exact illustrative inputs and encoder definitions

Fourier-magnitude cosine similarity spectral_cosine_similarityReference-formula demonstration
Fourier-magnitude cosine similarity: static final state of the documented numerical example. similarity = 0.978179.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.97817876 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Conceptually covered · spectral_similarity

s(x,y) = dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))

Demonstration: Reference-formula demonstration

Project the series onto sine and cosine bases, combine the real and imaginary parts into magnitudes, and compare the resulting frequency bins. The example retains all nine nonnegative-frequency bins of a length-16 real transform, including the DC bin. Cosine compares vector direction and is defined here for nonzero feature vectors.

How the calculation works

  1. Compute the unnormalized real FFT and retain the magnitude of each bin.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Normalize by both vector lengths and sum coordinate products to obtain cosine similarity.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Magnitude discards phase; a circular shift changes Fourier phase while preserving these magnitudes.
  • The DC coordinate reflects the mean, and raw magnitudes depend on record length and amplitude. Matching sampling rates and frequency grids is required.
  • This example compares unweighted nonnegative-frequency rFFT magnitudes. Comparing a full FFT, or weighting interior rFFT magnitudes by sqrt(2), gives a different distance/cosine convention.
  • Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy.

示例性质: 参考公式演示

把序列投影到正弦、余弦基上,将实部和虚部合成为幅值,再比较频率坐标。本例保留长度 16 实数变换的全部九个非负频率坐标,包括直流分量。 余弦比较向量方向,本例特征向量均非零。

计算步骤

  1. 计算未归一化的实数 FFT,保留各频率坐标的模。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 用两个向量的长度归一化坐标乘积之和,得到余弦相似度。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 幅值表示舍弃相位;循环平移改变傅里叶相位,却保留这些幅值。
  • 直流坐标反映均值,原始幅值依赖记录长度与振幅;比较时需要一致的采样率和频率网格。
  • 本例比较未加权的非负频率 rFFT 幅值。比较完整 FFT 或将内部 rFFT 幅值乘 sqrt(2),对应不同的距离与余弦约定。
  • 余弦忽略整个特征向量的正比例缩放;1-cosine 通常不满足度量公理,零向量还需明确处理规则。
Example parameters / 示例参数
{
  "fft": "rfft",
  "normalization": "backward",
  "n_bins": 9,
  "include_DC": true,
  "comparison": "cosine"
}

Definition sources / 定义来源: NumPy: real-input discrete Fourier transform; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Fourier-magnitude cosine distance spectral_distanceReference-formula demonstration
Fourier-magnitude cosine distance: static final state of the documented numerical example. distance = 0.0218212.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.021821236 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Possible addition

d(x,y) = 1 - dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))

Demonstration: Reference-formula demonstration

Project the series onto sine and cosine bases, combine the real and imaginary parts into magnitudes, and compare the resulting frequency bins. The example retains all nine nonnegative-frequency bins of a length-16 real transform, including the DC bin. Cosine compares vector direction and is defined here for nonzero feature vectors.

How the calculation works

  1. Compute the unnormalized real FFT and retain the magnitude of each bin.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Compute cosine similarity, then subtract it from one.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Magnitude discards phase; a circular shift changes Fourier phase while preserving these magnitudes.
  • The DC coordinate reflects the mean, and raw magnitudes depend on record length and amplitude. Matching sampling rates and frequency grids is required.
  • This example compares unweighted nonnegative-frequency rFFT magnitudes. Comparing a full FFT, or weighting interior rFFT magnitudes by sqrt(2), gives a different distance/cosine convention.
  • Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy.

示例性质: 参考公式演示

把序列投影到正弦、余弦基上,将实部和虚部合成为幅值,再比较频率坐标。本例保留长度 16 实数变换的全部九个非负频率坐标,包括直流分量。 余弦比较向量方向,本例特征向量均非零。

计算步骤

  1. 计算未归一化的实数 FFT,保留各频率坐标的模。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 计算余弦相似度,再用一减去该分数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 幅值表示舍弃相位;循环平移改变傅里叶相位,却保留这些幅值。
  • 直流坐标反映均值,原始幅值依赖记录长度与振幅;比较时需要一致的采样率和频率网格。
  • 本例比较未加权的非负频率 rFFT 幅值。比较完整 FFT 或将内部 rFFT 幅值乘 sqrt(2),对应不同的距离与余弦约定。
  • 余弦忽略整个特征向量的正比例缩放;1-cosine 通常不满足度量公理,零向量还需明确处理规则。
Example parameters / 示例参数
{
  "fft": "rfft",
  "normalization": "backward",
  "n_bins": 9,
  "include_DC": true,
  "comparison": "one_minus_cosine"
}

Definition sources / 定义来源: NumPy: real-input discrete Fourier transform; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Normalized FFT-bin powers distance periodogram_distanceChecked against EchoTime
Normalized FFT-bin powers distance: static final state of the documented numerical example. distance = 0.131733.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.13173288 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Implemented in EchoTime · periodogram_distance

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Checked against EchoTime

Square the real-FFT magnitudes and normalize their sum to one. EchoTime compares these power-share vectors with Euclidean distance. The example retains all nine bins and the mean-related DC component, so every coordinate represents a share of this particular discrete power convention. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Square each rFFT magnitude, then divide by the sum over all retained nonnegative-frequency bins.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • This is EchoTime's normalized rFFT-bin convention: no detrending, window, or one-sided interior-bin doubling. It is not a physical-density PSD estimate.
  • Normalization discards total power and phase; positive amplitude rescaling alone leaves this representation unchanged.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 已与 EchoTime 计算核对

将实数 FFT 幅值平方,再除以总和得到功率占比向量。EchoTime 使用欧氏距离比较该向量。本例保留全部九个频点和与均值相关的直流项,因此每个坐标都是这一离散功率约定下的占比。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 对 rFFT 幅值逐点平方,再除以全部非负频点功率的总和。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 这是 EchoTime 的归一化 rFFT 频点约定:不去趋势、不加窗,也不把单边谱内部频点乘二;它不等于具有物理单位的功率谱密度估计。
  • 归一化舍弃总功率和相位;单纯的正振幅缩放不会改变此表示。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "n_coeffs": 9,
  "normalization": "divide rFFT squared magnitudes by their sum",
  "detrend": false,
  "one_sided_doubling": false,
  "comparison": "euclidean"
}

Definition sources / 定义来源: EchoTime low-level implementation; NumPy: real-input discrete Fourier transform; Exact illustrative inputs and encoder definitions

PAA block means distance paa_distanceReference-formula demonstration
PAA block means distance: static final state of the documented numerical example. distance = 0.612694.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.61269408 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Possible addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Reference-formula demonstration

Split the 16 observations into four equal, consecutive blocks and replace each block by its mean. Comparing these ordered block averages emphasizes coarse temporal structure. The animation highlights the exact observations contributing to each coordinate. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Average each consecutive block of four observations to obtain four coordinates.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • The displayed Euclidean feature distance is unscaled; the usual length-scaled PAA lower bound additionally multiplies it by sqrt(n/w).
  • Short events within a block can cancel, and moving a block boundary can alter the representation.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 参考公式演示

把 16 个观测分成四个连续等长区间,每个区间用均值表示。比较这些有序均值可突出较粗的时间结构;动图逐块高亮每个坐标所使用的观测。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 每四个连续观测求一次均值,得到四个坐标。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 图中欧氏特征距离未经长度缩放;常用 PAA 下界还需乘以 sqrt(n/w)。
  • 区间内的短暂事件可能互相抵消,改变分段边界也会改变表示。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "n_segments": 4,
  "block_size": 4,
  "z_normalization": false,
  "distance_length_scaling": false,
  "comparison": "euclidean"
}

Definition sources / 定义来源: tslearn: piecewise aggregate approximation; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Full Haar coefficient distance dwt_distanceReference-formula demonstration
Full Haar coefficient distance: static final state of the documented numerical example. distance = 1.93256.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 1.9325587 — Full-coefficient L2; raw Euclidean distance = 1.93255872199.

EchoTime coverage: Possible addition

d = ||W_Haar x - W_Haar y||_2 = ||x-y||_2 (complete orthonormal transform)

Demonstration: Reference-formula demonstration

Apply the complete orthonormal Haar transform and compare all coefficients. The animation separates pair averages and details across four levels. With every coefficient retained and no boundary padding, the resulting Euclidean distance equals the raw-sample Euclidean distance by norm preservation.

How the calculation works

  1. Use equal-length inputs of length 16, so Haar pairs need no padding.
  2. Recursively form orthonormal pair sums and differences at four levels.
  3. Collect all 16 coefficients in [A4,D4,D3,D2,D1] order.
  4. Take their Euclidean distance and verify equality with raw Euclidean distance.

Interpretation and limits

  • Using all orthonormal coefficients does not by itself create a new Euclidean notion of similarity.
  • Truncating coefficients, weighting scales or changing boundary conventions changes this equivalence.

示例性质: 参考公式演示

进行完整正交 Haar 变换并比较全部系数。动图展示四级相邻点和差分解。保留所有系数且不填充边界时,由范数保持性质,系数的欧氏距离等于原始样本的欧氏距离。

计算步骤

  1. 使用长度均为 16 的输入,因此相邻点分组无需填充。
  2. 递归进行四级正交归一化的相邻点和差分解。
  3. 按 [A4,D4,D3,D2,D1] 顺序保留全部 16 个系数。
  4. 计算系数欧氏距离,并核对其等于原始欧氏距离。

解释与使用边界

  • 保留全部正交系数本身不会产生新的欧氏相似性定义。
  • 截断系数、对尺度加权或改变边界约定都会改变上述等价关系。
Example parameters / 示例参数
{
  "wavelet": "orthonormal Haar",
  "length": 16,
  "retained": 16,
  "coefficient_order": "A4,D4,D3,D2,D1",
  "padding": false
}

Definition sources / 定义来源: PyWavelets: Haar approximation and detail coefficients; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Value histograms distance histogram_distanceReference-formula demonstration
Value histograms distance: static final state of the documented numerical example. distance = 0.330719.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.33071891 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Possible addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Reference-formula demonstration

Count observations in seven shared, fixed value intervals and divide by the sample count. The two probability vectors describe how often values occur. Shared edges make the coordinates comparable; all temporal ordering is intentionally removed. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Use identical bin edges for both inputs and normalize counts into bin probabilities.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Separate automatic binning can make coordinate-wise comparison invalid; the edges must be shared.
  • Values within one bin are indistinguishable, and permuted sequences have identical histograms.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 参考公式演示

在七个共享、固定的数值区间中计数,再除以样本数。两个概率向量描述数值出现的频率。共享边界保证坐标可比较,同时有意舍弃全部时间顺序。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 对两条序列使用相同分箱边界,将计数归一化为概率。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 分别自动分箱可能导致坐标不可比,因此必须共享边界。
  • 同一区间内的数值无法区分,重排序列也具有相同直方图。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "edges": [
    -1.5,
    -1.0,
    -0.5,
    0.0,
    0.5,
    1.0,
    1.5,
    2.0
  ],
  "normalization": "probability mass, not density",
  "comparison": "euclidean"
}

Definition sources / 定义来源: NumPy: histogram bins and normalization; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Permutation-entropy distance permutation_entropy_distanceReference-formula demonstration
Permutation-entropy distance: static final state of the documented numerical example. distance = 0.130232.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.13023244 — Normalized entropies H(x)=0.79848069, H(y)=0.66824825

EchoTime coverage: Possible addition

d = |H(p)-H(q)|; H(p)=-sum(p log p)/log(3!)

Demonstration: Reference-formula demonstration

Turn length-three windows into ordering patterns and compute each distribution's normalized Shannon entropy. Compare the two scalar entropies with an absolute difference. The score measures equality of this particular summary, so distinct pattern distributions can still have zero distance.

How the calculation works

  1. Form overlapping windows with order 3 and delay 1.
  2. Stably rank each window and count all six possible permutations.
  3. Compute H=-sum(p log p)/log(6) for each distribution.
  4. Take |H(x)-H(y)| and remember that entropy discards pattern identities.

Interpretation and limits

  • Order 3, delay 1 and stable tie-breaking by earlier position are explicit choices; frequent ties can change the interpretation.
  • Short sequences provide sparse pattern counts; overlapping windows are not independent samples.
  • Equal entropy does not imply equal ordinal distributions or similar dynamics.

示例性质: 参考公式演示

把三点窗口转换成排序模式,分别计算模式分布的归一化 Shannon 熵,再取两标量之差的绝对值。该分数比较这一特定摘要,因而不同模式分布仍可能得到零距离。

计算步骤

  1. 使用阶数 3、延迟 1 构造重叠窗口。
  2. 稳定排序各窗口,并统计全部六种排列。
  3. 对各分布计算 H=-sum(p log p)/log(6)。
  4. 计算 |H(x)-H(y)|,同时注意熵舍弃具体模式身份。

解释与使用边界

  • 阶数 3、延迟 1,以及按较早位置优先的稳定并列处理都是明确选择;大量并列值会改变解释。
  • 短序列的模式统计稀疏,重叠窗口也不是独立样本。
  • 相同的熵不意味着相同的模式分布或动力学。
Example parameters / 示例参数
{
  "order": 3,
  "delay": 1,
  "tie_policy": "stable by index",
  "log_base": "e",
  "entropy_normalized": true
}

Definition sources / 定义来源: Bandt and Pompe (2002), permutation entropy; Exact illustrative inputs and encoder definitions; EchoTime low-level implementation

Ordinal-pattern JS distance ordinal_pattern_js_distanceChecked against EchoTime
Ordinal-pattern JS distance: static final state of the documented numerical example. distance = 0.25686.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.25686047 — Natural-log JS distance

EchoTime coverage: Implemented in EchoTime · ordinal_pattern_js_distance

d = sqrt((KL(p||m)+KL(q||m))/2), m=(p+q)/2

Demonstration: Checked against EchoTime

Turn every three-observation window into its ordering pattern, then compare the six-pattern probability vectors with square-root Jensen-Shannon divergence. This retains which patterns are frequent and follows EchoTime's natural-log definition.

How the calculation works

  1. Form overlapping windows with order 3 and delay 1.
  2. Stably rank each window and count all six possible permutations.
  3. Compute square-root Jensen-Shannon divergence with natural logarithms.
  4. Read a distribution distance and check the chosen order/delay.

Interpretation and limits

  • Order 3, delay 1 and stable tie-breaking by earlier position are explicit choices; frequent ties can change the interpretation.
  • Short sequences provide sparse pattern counts; overlapping windows are not independent samples.
  • Pattern frequencies discard when patterns occur.

示例性质: 已与 EchoTime 计算核对

把每个三点窗口转换成排序模式,再以 Jensen-Shannon 散度的平方根比较六种模式的概率向量。它保留具体哪些模式更常出现,并遵循 EchoTime 使用自然对数的定义。

计算步骤

  1. 使用阶数 3、延迟 1 构造重叠窗口。
  2. 稳定排序各窗口,并统计全部六种排列。
  3. 使用自然对数计算 Jensen-Shannon 散度的平方根。
  4. 读取分布距离,并检查所选阶数与延迟。

解释与使用边界

  • 阶数 3、延迟 1,以及按较早位置优先的稳定并列处理都是明确选择;大量并列值会改变解释。
  • 短序列的模式统计稀疏,重叠窗口也不是独立样本。
  • 模式频率舍弃模式出现的具体时刻。
Example parameters / 示例参数
{
  "order": 3,
  "delay": 1,
  "tie_policy": "stable by index",
  "log_base": "e",
  "entropy_normalized": false
}

Definition sources / 定义来源: Bandt and Pompe (2002), permutation entropy; SciPy: square-root Jensen-Shannon divergence; EchoTime low-level implementation

Linear trend features distance trend_distanceChecked against EchoTime
Linear trend features distance: static final state of the documented numerical example. distance = 0.118057.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.11805668 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Implemented in EchoTime · trend_distance

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Checked against EchoTime

Fit an ordinary least-squares line to each series on the sample-index axis. Compare the intercept, slope and population standard deviation of residuals. This is EchoTime's three-coordinate trend description; it retains overall direction and unexplained variation while compressing local structure. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Fit x_t = intercept + slope*t and append the residual population SD.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • The slope uses sample index, so changing the sampling interval changes its interpretation; physical-time comparisons require consistent units.
  • Intercept, slope and residual SD have different scales. Curved trends and different residual patterns can share the same vector.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 已与 EchoTime 计算核对

以样本索引为时间轴,对每条序列拟合普通最小二乘直线,再比较截距、斜率和残差的总体标准差。这是 EchoTime 的三坐标趋势描述,保留总体方向与未解释波动,同时压缩局部结构。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 拟合 x_t = 截距 + 斜率*t,并加入残差总体标准差。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 斜率使用样本索引,改变采样间隔会改变其含义;按物理时间比较需要统一单位。
  • 截距、斜率与残差标准差尺度不同;弯曲趋势或不同残差结构可能共享同一向量。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "time_axis": "sample index 0..15",
  "fit": "ordinary least squares",
  "residual_std_ddof": 0,
  "features": [
    "intercept",
    "slope",
    "residual_std"
  ],
  "comparison": "euclidean"
}

Definition sources / 定义来源: EchoTime low-level implementation; Exact illustrative inputs and encoder definitions

SAX Hamming distance sax_hamming_distanceReference-formula demonstration
SAX Hamming distance: static final state of the documented numerical example. word distance = 1.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative word distance: 1 — Normalized symbol mismatch rate

EchoTime coverage: Possible addition

d = sum_i [SAX_i(x) != SAX_i(y)] / 4

Demonstration: Reference-formula demonstration

Convert each standardized series to a four-symbol SAX word, then count the fraction of positions with different symbols. This treats every mismatch equally, including adjacent bins; it is a distance between words, with information lost during aggregation and quantization.

How the calculation works

  1. Z-normalize each complete series and use four equal PAA blocks.
  2. Quantize each mean with shared standard-normal quartile breakpoints.
  3. Count mismatching symbols.
  4. Divide the mismatch count by four.

Interpretation and limits

  • Gaussian breakpoints are a coding convention; they do not make arbitrary observed signals normally distributed.
  • Hamming on words does not have the SAX Euclidean lower-bound interpretation.
  • Both PAA aggregation and quantization can map distinct signals to the same code.

示例性质: 参考公式演示

把每条标准化序列转换为四符号 SAX 单词,再统计对应位置符号不同的比例。所有不匹配均等计数,包括相邻区间;它比较符号单词,聚合和量化已经损失信息。

计算步骤

  1. 对各完整序列做 z 标准化,并计算四个等长 PAA 区间。
  2. 使用共享标准正态四分位断点量化各区间均值。
  3. 统计符号不匹配数。
  4. 将不匹配数除以四。

解释与使用边界

  • 高斯断点是一种编码约定,不会使任意观测信号变成正态分布。
  • 单词上的 Hamming 距离不具有 SAX 欧氏下界的含义。
  • PAA 聚合和量化都可能把不同信号映射为相同代码。
Example parameters / 示例参数
{
  "length": 16,
  "word_length": 4,
  "alphabet_size": 4,
  "breakpoints": [
    -0.6744897501960817,
    0.0,
    0.6744897501960817
  ],
  "z_normalization_ddof": 0,
  "x_word": "cadb",
  "y_word": "bbcc"
}

Definition sources / 定义来源: Lin et al. (2007), Experiencing SAX, author copy; Exact illustrative inputs and encoder definitions

SAX MINDIST lower bound sax_mindistReference-formula demonstration
SAX MINDIST lower bound: static final state of the documented numerical example. lower bound = 0.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative lower bound: 0 — Compare with actual z-normalized Euclidean distance 3.3214665.

EchoTime coverage: Possible addition

MINDIST = sqrt(16/4)*sqrt(sum_i interval_gap(SAX_i(x),SAX_i(y))^2)

Demonstration: Reference-formula demonstration

Compare SAX words using the minimum gap between their symbol intervals, sum squared gaps and multiply by the PAA length factor. Equal or adjacent symbols contribute zero. In this example all paired symbols are adjacent, demonstrating why a valid lower bound can be zero for distinct series.

How the calculation works

  1. Z-normalize each complete series and use four equal PAA blocks.
  2. Quantize each mean with shared standard-normal quartile breakpoints.
  3. Look up the minimum gap between the two symbol intervals.
  4. Take sqrt(n/w)*sqrt(sum(gap^2)); this is a lower-bound calculation.

Interpretation and limits

  • Gaussian breakpoints are a coding convention; they do not make arbitrary observed signals normally distributed.
  • The Euclidean lower-bound interpretation requires the same normalized length, partitions and ordered breakpoints; lower-bounding does not imply metric axioms.
  • Both PAA aggregation and quantization can map distinct signals to the same code.

示例性质: 参考公式演示

以 SAX 符号区间之间的最小间隔比较两个单词,累加间隔平方后加入 PAA 长度系数。相同或相邻符号贡献为零。本例各对应符号都相邻,展示了有效下界为何可对不同序列返回零。

计算步骤

  1. 对各完整序列做 z 标准化,并计算四个等长 PAA 区间。
  2. 使用共享标准正态四分位断点量化各区间均值。
  3. 查找两个符号区间之间的最小间隔。
  4. 计算 sqrt(n/w)*sqrt(sum(gap^2)),得到下界。

解释与使用边界

  • 高斯断点是一种编码约定,不会使任意观测信号变成正态分布。
  • 欧氏下界解释要求相同的标准化长度、分段和有序断点;具有下界性质不等于满足度量公理。
  • PAA 聚合和量化都可能把不同信号映射为相同代码。
Example parameters / 示例参数
{
  "length": 16,
  "word_length": 4,
  "alphabet_size": 4,
  "breakpoints": [
    -0.6744897501960817,
    0.0,
    0.6744897501960817
  ],
  "z_normalization_ddof": 0,
  "x_word": "cadb",
  "y_word": "bbcc"
}

Definition sources / 定义来源: Lin et al. (2007), Experiencing SAX, author copy; Exact illustrative inputs and encoder definitions

Bag-of-patterns cosine similarity bag_of_patterns_cosine_similarityReference-formula demonstration
Bag-of-patterns cosine similarity: static final state of the documented numerical example. similarity = 0.454545.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.45454545 — Explicit BoP + cosine composition; shared vocabulary.

EchoTime coverage: Possible addition

s = cosine(counts(SAX_windows(x)), counts(SAX_windows(y)))

Demonstration: Reference-formula demonstration

Slide an eight-sample window, normalize each window, encode it as a four-letter SAX word and count the words. Consecutive duplicate words are suppressed in this example. The resulting bag is compared by cosine, so local motifs contribute through their frequencies while their global order is discarded.

How the calculation works

  1. Slide a length-eight window, normalize it, then encode four PAA means with the shared SAX alphabet.
  2. Suppress consecutive duplicate words and count both series in one shared vocabulary.
  3. Accumulate matching word-count products divided by both vector norms.
  4. Read cosine similarity between count vectors.

Interpretation and limits

  • Window length, word length, alphabet and numerosity reduction define the comparison; the original BoP representation does not mandate this exact cosine adapter.
  • Global motif order and absolute window level/scale are discarded; a similar bag need not imply aligned events.
  • A zero count vector needs an explicit policy. This example has nonempty bags.

示例性质: 参考公式演示

滑动八点窗口,对每个窗口单独标准化,编码为四字母 SAX 单词并计数。本例抑制连续重复单词,再用余弦比较词袋。局部模式通过出现频率参与比较,其全局顺序被舍弃。

计算步骤

  1. 滑动八点窗口并标准化,再用共享 SAX 字母表编码四个 PAA 均值。
  2. 抑制连续重复词,在一个共享词表中对两条序列计数。
  3. 累加对应词频的乘积,并除以两个向量的范数乘积。
  4. 读取词频向量的余弦相似度。

解释与使用边界

  • 窗口长度、词长、字母表与重复抑制规则共同定义比较;原 BoP 表示并未要求必须使用本例余弦适配器。
  • 全局模式顺序和窗口的绝对水平、尺度被舍弃;词袋相似并不意味着事件对齐。
  • 零计数向量需要明确处理规则,本例两个词袋均非空。
Example parameters / 示例参数
{
  "window": 8,
  "stride": 1,
  "word_length": 4,
  "alphabet_size": 4,
  "local_z_normalization": true,
  "numerosity_reduction": "consecutive exact duplicate words",
  "vocabulary": [
    "aacd",
    "abdc",
    "abdd",
    "acdb",
    "adca",
    "bacd",
    "bdda",
    "cabd",
    "cdba",
    "daac",
    "dbac",
    "dcab"
  ],
  "comparison": "cosine"
}

Definition sources / 定义来源: Lin, Khade and Li (2012), bag-of-patterns representation; Lin et al. (2007), Experiencing SAX, author copy; Exact illustrative inputs and encoder definitions

Bag-of-patterns cosine distance bag_of_patterns_distanceReference-formula demonstration
Bag-of-patterns cosine distance: static final state of the documented numerical example. distance = 0.545455.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.54545455 — Explicit BoP + cosine composition; shared vocabulary.

EchoTime coverage: Possible addition

d = 1 - cosine(counts(SAX_windows(x)), counts(SAX_windows(y)))

Demonstration: Reference-formula demonstration

Slide an eight-sample window, normalize each window, encode it as a four-letter SAX word and count the words. Consecutive duplicate words are suppressed in this example. The resulting bag is compared by cosine, so local motifs contribute through their frequencies while their global order is discarded.

How the calculation works

  1. Slide a length-eight window, normalize it, then encode four PAA means with the shared SAX alphabet.
  2. Suppress consecutive duplicate words and count both series in one shared vocabulary.
  3. Accumulate matching word-count products divided by both vector norms.
  4. Subtract the completed cosine similarity from one.

Interpretation and limits

  • Window length, word length, alphabet and numerosity reduction define the comparison; the original BoP representation does not mandate this exact cosine adapter.
  • Global motif order and absolute window level/scale are discarded; a similar bag need not imply aligned events.
  • A zero count vector needs an explicit policy. This example has nonempty bags.

示例性质: 参考公式演示

滑动八点窗口,对每个窗口单独标准化,编码为四字母 SAX 单词并计数。本例抑制连续重复单词,再用余弦比较词袋。局部模式通过出现频率参与比较,其全局顺序被舍弃。

计算步骤

  1. 滑动八点窗口并标准化,再用共享 SAX 字母表编码四个 PAA 均值。
  2. 抑制连续重复词,在一个共享词表中对两条序列计数。
  3. 累加对应词频的乘积,并除以两个向量的范数乘积。
  4. 用一减去完整的余弦相似度。

解释与使用边界

  • 窗口长度、词长、字母表与重复抑制规则共同定义比较;原 BoP 表示并未要求必须使用本例余弦适配器。
  • 全局模式顺序和窗口的绝对水平、尺度被舍弃;词袋相似并不意味着事件对齐。
  • 零计数向量需要明确处理规则,本例两个词袋均非空。
Example parameters / 示例参数
{
  "window": 8,
  "stride": 1,
  "word_length": 4,
  "alphabet_size": 4,
  "local_z_normalization": true,
  "numerosity_reduction": "consecutive exact duplicate words",
  "vocabulary": [
    "aacd",
    "abdc",
    "abdd",
    "acdb",
    "adca",
    "bacd",
    "bdda",
    "cabd",
    "cdba",
    "daac",
    "dbac",
    "dcab"
  ],
  "comparison": "one_minus_cosine"
}

Definition sources / 定义来源: Lin, Khade and Li (2012), bag-of-patterns representation; Lin et al. (2007), Experiencing SAX, author copy; Exact illustrative inputs and encoder definitions

Independent-channel basic statistics distance independent_stats_distanceReference-formula demonstration
Independent-channel basic statistics distance: static final state of the documented numerical example. distance = 0.422347.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.42234674 — Channel distances 0.3997628 and 0.44493067; arithmetic mean.

EchoTime coverage: Possible addition

d(X,Y) = mean_c ||phi(X[:,c])-phi(Y[:,c])||_2

Demonstration: Reference-formula demonstration

Extract basic statistics separately in each of two channels, compute one Euclidean distance per channel, then take their arithmetic mean. The displayed input concatenates channels only for visualization; the computation preserves channel boundaries and has no cross-channel dependence term.

How the calculation works

  1. Keep corresponding channel identities and units aligned.
  2. Extract basic statistics independently from each channel.
  3. Compute the Euclidean feature distance inside each channel.
  4. Average the two channel distances with equal weights.

Interpretation and limits

  • Permuting observations leaves this vector unchanged, even when temporal behavior changes completely.
  • Features have different scales; this example uses no coordinate weighting. A production scaler must be fitted without test-data leakage.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.
  • Averaging independent channel distances cannot detect cross-channel timing or dependence changes that preserve each marginal descriptor.

示例性质: 参考公式演示

分别从两个通道提取基础统计量,各自计算一个欧氏距离,再取算术平均。图中的输入仅为展示而按通道拼接;计算始终保留通道边界,不包含跨通道依赖项。

计算步骤

  1. 保持对应通道身份与单位一致。
  2. 逐通道独立提取基础统计量。
  3. 分别计算每个通道内部的欧氏特征距离。
  4. 对两个通道距离等权平均。

解释与使用边界

  • 任意重排序列不会改变该向量,即使时间行为发生显著变化。
  • 各坐标尺度不同;本例不加权。实际使用的缩放器应避免测试数据泄漏。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
  • 独立通道距离的平均无法识别保持各通道边缘描述不变的跨通道时序或依赖变化。
Example parameters / 示例参数
{
  "features": [
    "mean",
    "std_ddof0",
    "min",
    "max"
  ],
  "coordinate_scaling": "none",
  "channels": 2,
  "channel_weights": [
    0.5,
    0.5
  ],
  "raw_X": [
    [
      0.0,
      0.4
    ],
    [
      0.8769216919004693,
      0.15360679774997898
    ],
    [
      0.8094744111674236,
      -0.26360679774997897
    ],
    [
      0.7863961030678929,
      -0.23360679774997903
    ],
    [
      0.3905255888325767,
      0.2436067977499789
    ],
    [
      -0.5769216919004693,
      0.55
    ],
    [
      -0.6000000000000001,
      0.3036067977499791
    ],
    [
      -0.09587051423531628,
      -0.11360679774997892
    ],
    [
      0.2094744111674235,
      -0.08360679774997909
    ],
    [
      1.0863961030678926,
      0.3936067977499788
    ],
    [
      1.5905255888325764,
      0.7
    ],
    [
      0.9958705142353173,
      0.4536067977499798
    ],
    [
      0.6000000000000002,
      0.03639320225002113
    ],
    [
      0.20412948576468337,
      0.06639320225002088
    ],
    [
      -0.39052558883257615,
      0.5436067977499787
    ],
    [
      0.11360389693210537,
      0.85
    ]
  ],
  "raw_Y": [
    [
      -0.2003300858899106,
      0.45263659640173104
    ],
    [
      0.185,
      -0.13144121120883534
    ],
    [
      0.5703300858899106,
      -0.6444290133512534
    ],
    [
      1.005,
      -0.34975578305380517
    ],
    [
      1.0003300858899107,
      0.3729894112121631
    ],
    [
      0.3250000000000002,
      0.552636596401731
    ],
    [
      -0.35033008588991066,
      -0.03144121120883547
    ],
    [
      -0.3550000000000001,
      -0.5444290133512534
    ],
    [
      0.07966991411008931,
      -0.2497557830538053
    ],
    [
      0.46499999999999997,
      0.472989411212163
    ],
    [
      0.8503300858899105,
      0.652636596401731
    ],
    [
      1.2849999999999995,
      0.06855878879116573
    ],
    [
      1.2803300858899114,
      -0.4444290133512534
    ],
    [
      0.6050000000000002,
      -0.1497557830538063
    ],
    [
      -0.07033008588991083,
      0.5729894112121622
    ],
    [
      -0.07500000000000043,
      0.7526365964017315
    ]
  ],
  "display_layout": "channel-major flattening only"
}

Definition sources / 定义来源: NumPy: summary-statistic definitions; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Independent-channel paa block means distance independent_paa_distanceReference-formula demonstration
Independent-channel paa block means distance: static final state of the documented numerical example. distance = 0.473514.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.47351384 — Channel distances 0.61269408 and 0.33433359; arithmetic mean.

EchoTime coverage: Possible addition

d(X,Y) = mean_c ||phi(X[:,c])-phi(Y[:,c])||_2

Demonstration: Reference-formula demonstration

Extract paa block means separately in each of two channels, compute one Euclidean distance per channel, then take their arithmetic mean. The displayed input concatenates channels only for visualization; the computation preserves channel boundaries and has no cross-channel dependence term.

How the calculation works

  1. Keep corresponding channel identities and units aligned.
  2. Extract paa block means independently from each channel.
  3. Compute the Euclidean feature distance inside each channel.
  4. Average the two channel distances with equal weights.

Interpretation and limits

  • The displayed Euclidean feature distance is unscaled; the usual length-scaled PAA lower bound additionally multiplies it by sqrt(n/w).
  • Short events within a block can cancel, and moving a block boundary can alter the representation.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.
  • Averaging independent channel distances cannot detect cross-channel timing or dependence changes that preserve each marginal descriptor.

示例性质: 参考公式演示

分别从两个通道提取PAA 分段均值,各自计算一个欧氏距离,再取算术平均。图中的输入仅为展示而按通道拼接;计算始终保留通道边界,不包含跨通道依赖项。

计算步骤

  1. 保持对应通道身份与单位一致。
  2. 逐通道独立提取PAA 分段均值。
  3. 分别计算每个通道内部的欧氏特征距离。
  4. 对两个通道距离等权平均。

解释与使用边界

  • 图中欧氏特征距离未经长度缩放;常用 PAA 下界还需乘以 sqrt(n/w)。
  • 区间内的短暂事件可能互相抵消,改变分段边界也会改变表示。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
  • 独立通道距离的平均无法识别保持各通道边缘描述不变的跨通道时序或依赖变化。
Example parameters / 示例参数
{
  "n_segments": 4,
  "block_size": 4,
  "z_normalization": false,
  "distance_length_scaling": false,
  "channels": 2,
  "channel_weights": [
    0.5,
    0.5
  ],
  "raw_X": [
    [
      0.0,
      0.4
    ],
    [
      0.8769216919004693,
      0.15360679774997898
    ],
    [
      0.8094744111674236,
      -0.26360679774997897
    ],
    [
      0.7863961030678929,
      -0.23360679774997903
    ],
    [
      0.3905255888325767,
      0.2436067977499789
    ],
    [
      -0.5769216919004693,
      0.55
    ],
    [
      -0.6000000000000001,
      0.3036067977499791
    ],
    [
      -0.09587051423531628,
      -0.11360679774997892
    ],
    [
      0.2094744111674235,
      -0.08360679774997909
    ],
    [
      1.0863961030678926,
      0.3936067977499788
    ],
    [
      1.5905255888325764,
      0.7
    ],
    [
      0.9958705142353173,
      0.4536067977499798
    ],
    [
      0.6000000000000002,
      0.03639320225002113
    ],
    [
      0.20412948576468337,
      0.06639320225002088
    ],
    [
      -0.39052558883257615,
      0.5436067977499787
    ],
    [
      0.11360389693210537,
      0.85
    ]
  ],
  "raw_Y": [
    [
      -0.2003300858899106,
      0.45263659640173104
    ],
    [
      0.185,
      -0.13144121120883534
    ],
    [
      0.5703300858899106,
      -0.6444290133512534
    ],
    [
      1.005,
      -0.34975578305380517
    ],
    [
      1.0003300858899107,
      0.3729894112121631
    ],
    [
      0.3250000000000002,
      0.552636596401731
    ],
    [
      -0.35033008588991066,
      -0.03144121120883547
    ],
    [
      -0.3550000000000001,
      -0.5444290133512534
    ],
    [
      0.07966991411008931,
      -0.2497557830538053
    ],
    [
      0.46499999999999997,
      0.472989411212163
    ],
    [
      0.8503300858899105,
      0.652636596401731
    ],
    [
      1.2849999999999995,
      0.06855878879116573
    ],
    [
      1.2803300858899114,
      -0.4444290133512534
    ],
    [
      0.6050000000000002,
      -0.1497557830538063
    ],
    [
      -0.07033008588991083,
      0.5729894112121622
    ],
    [
      -0.07500000000000043,
      0.7526365964017315
    ]
  ],
  "display_layout": "channel-major flattening only"
}

Definition sources / 定义来源: tslearn: piecewise aggregate approximation; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Fitted dynamics and models / 动力学与模型 5
Autoregressive-coefficient distance ar_distanceSpecified illustrative protocol
Autoregressive-coefficient distance: static final state of the documented numerical example. distance = 0.33905.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.33905042 — Distance between separately demeaned conditional-OLS AR(2) coefficients.

EchoTime coverage: Possible addition

z_t = phi_1*z_(t-1)+phi_2*z_(t-2)+e_t; d=||phi_x-phi_y||_2

Demonstration: Specified illustrative protocol

Fit a separately centered AR(2) model by conditional least squares to each short input, then compare the two lag coefficients. The distance describes this specified fitted linear recurrence. Mean level and innovation variance are excluded from the coefficient vector in this example.

How the calculation works

  1. Remove each series' sample mean and construct two lagged predictors.
  2. Fit the same AR(2) equation by ordinary least squares for each input.
  3. Compare the corresponding lag-one and lag-two coefficients.
  4. Take the Euclidean norm of the coefficient difference.

Interpretation and limits

  • The example fixes order two and demeans each series separately. Changing order, centering or estimator changes the fitted object.
  • Sixteen samples suffice only for an illustration, not a reliable claim about the generating process.
  • Coefficient similarity does not establish equal innovation noise, nonlinear dependence or causal dynamics.

示例性质: 明确设定的流程示例

分别对两条短序列去均值,用条件最小二乘拟合 AR(2),再比较两个滞后系数。距离描述这一明确指定的线性递推拟合;本例系数向量不包含均值水平和创新方差。

计算步骤

  1. 去除各序列样本均值,构造两个滞后预测量。
  2. 分别用普通最小二乘拟合相同形式的 AR(2) 方程。
  3. 比较对应的一阶和二阶滞后系数。
  4. 计算系数差的欧氏范数。

解释与使用边界

  • 本例固定二阶,并分别去均值;改变阶数、中心化或估计器都会改变拟合对象。
  • 十六个样本仅用于解释过程,不能据此可靠推断生成机制。
  • 系数相似不能证明创新噪声、非线性依赖或因果动力学相同。
Example parameters / 示例参数
{
  "order": 2,
  "demean": "separately using full series mean",
  "intercept": false,
  "estimator": "conditional OLS, no regularization",
  "residual_variance": "mean squared fitted residual",
  "beta_x": [
    1.0243090422834804,
    -0.6188171023843692
  ],
  "beta_y": [
    1.2418713737062936,
    -0.8788590636409944
  ],
  "ar_companion_root_radii_x": [
    0.7866492880466931,
    0.7866492880466931
  ],
  "ar_companion_root_radii_y": [
    0.9374748336040784,
    0.9374748336040784
  ]
}

Definition sources / 定义来源: statsmodels: conditional least-squares autoregression; Exact illustrative inputs and encoder definitions

AR log-spectrum distance ar_spectrum_distanceSpecified illustrative protocol
AR log-spectrum distance: static final state of the documented numerical example. distance = 5.96536.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 5.9653596 — Unweighted L2 over 17 natural-log spectral coordinates; no integration weighting.

EchoTime coverage: Possible addition

S(w)=sigma^2/|1-sum_(j=1)^2 phi_j exp(-ijw)|^2; d=||log S_x-log S_y||_2

Demonstration: Specified illustrative protocol

Fit the same centered AR(2) model to each input and evaluate its implied spectrum on 17 shared frequencies. The animation compares natural-log spectra with Euclidean distance. The two final fits are stable; their fitted residual variances are included, so both spectral shape and power level affect the score.

How the calculation works

  1. Demean each input, build two lags and fit conditional-OLS AR(2) models.
  2. Check stability and evaluate sigma^2 / |1-phi_1 exp(-iw)-phi_2 exp(-2iw)|^2.
  3. Take natural logs on the same 17-point frequency grid.
  4. Take the Euclidean norm of the log-spectrum difference.

Interpretation and limits

  • The example fixes order two and demeans each series separately. Changing order, centering or estimator changes the fitted object.
  • Sixteen samples suffice only for an illustration, not a reliable claim about the generating process.
  • The spectrum is an AR model implication; stability and stationarity assumptions require scrutiny. Grid density and log conventions change the numeric distance.

示例性质: 明确设定的流程示例

对两条输入拟合相同的中心化 AR(2) 模型,并在 17 个共享频点上计算模型隐含谱。动图以欧氏距离比较自然对数谱。两个最终拟合均稳定,且纳入拟合残差方差,因此谱形状和功率水平都会影响分数。

计算步骤

  1. 分别去均值,构造两个滞后量并拟合条件最小二乘 AR(2)。
  2. 检查稳定性,计算 sigma^2 / |1-phi_1 exp(-iw)-phi_2 exp(-2iw)|^2。
  3. 在相同的 17 点频率网格上取自然对数。
  4. 计算对数谱差的欧氏范数。

解释与使用边界

  • 本例固定二阶,并分别去均值;改变阶数、中心化或估计器都会改变拟合对象。
  • 十六个样本仅用于解释过程,不能据此可靠推断生成机制。
  • 该谱是 AR 模型的推论,需要检查稳定性和平稳性假设。网格密度及对数约定会改变数值距离。
Example parameters / 示例参数
{
  "order": 2,
  "demean": "separately using full series mean",
  "intercept": false,
  "estimator": "conditional OLS, no regularization",
  "residual_variance": "mean squared fitted residual",
  "beta_x": [
    1.0243090422834804,
    -0.6188171023843692
  ],
  "beta_y": [
    1.2418713737062936,
    -0.8788590636409944
  ],
  "ar_companion_root_radii_x": [
    0.7866492880466931,
    0.7866492880466931
  ],
  "ar_companion_root_radii_y": [
    0.9374748336040784,
    0.9374748336040784
  ],
  "omega": [
    0.0,
    0.19634954084936207,
    0.39269908169872414,
    0.5890486225480862,
    0.7853981633974483,
    0.9817477042468103,
    1.1780972450961724,
    1.3744467859455345,
    1.5707963267948966,
    1.7671458676442586,
    1.9634954084936207,
    2.1598449493429825,
    2.356194490192345,
    2.552544031041707,
    2.748893571891069,
    2.945243112740431,
    3.141592653589793
  ],
  "spectrum_convention": "sigma2/abs(AR polynomial)^2; common 1/(2pi) omitted",
  "log_base": "e"
}

Definition sources / 定义来源: statsmodels: conditional least-squares autoregression; Exact illustrative inputs and encoder definitions; statsmodels: ARMA lag-polynomial spectra

Symmetric AR cross-prediction error ar_prediction_error_distanceSpecified illustrative protocol
Symmetric AR cross-prediction error: static final state of the documented numerical example. symmetric cross error = 0.0970472.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative symmetric cross error: 0.097047155 — MSE(x model -> y)=0.047154603; MSE(y model -> x)=0.14693971.

EchoTime coverage: Possible addition

d = (mean((y_centered-A_y phi_x)^2)+mean((x_centered-A_x phi_y)^2))/2

Demonstration: Specified illustrative protocol

Fit centered AR(2) models, apply the x model to y and the y model to x, then average their one-step mean-squared errors. This measures compatibility under a specified predictive model and centering convention. Even a self-comparison can remain positive because fitted innovations are not zero.

How the calculation works

  1. Fit one centered conditional-OLS AR(2) model to each full input.
  2. Transfer the x coefficients to centered y, and transfer the y coefficients to centered x.
  3. Compute each direction's one-step squared residuals on the available 14 lagged targets.
  4. Average the two directional MSEs; interpret this as error rather than a mathematical metric.

Interpretation and limits

  • The example fixes order two and demeans each series separately. Changing order, centering or estimator changes the fitted object.
  • Sixteen samples suffice only for an illustration, not a reliable claim about the generating process.
  • This is not a held-out forecast evaluation: both models are fitted to the displayed records and only the comparison mechanism is illustrated. Self-error need not be zero.

示例性质: 明确设定的流程示例

拟合中心化 AR(2) 模型,用 x 的模型预测 y,再用 y 的模型预测 x,最后平均两个一步预测均方误差。它度量指定预测模型和中心化约定下的兼容性;即使自比较,也可能因拟合创新不为零而得到正值。

计算步骤

  1. 分别对完整输入拟合中心化条件最小二乘 AR(2)。
  2. 将 x 的系数用于中心化 y,再将 y 的系数用于中心化 x。
  3. 对各方向的 14 个可用滞后目标计算一步预测残差平方。
  4. 平均两个方向的 MSE,把结果解释为误差分数。

解释与使用边界

  • 本例固定二阶,并分别去均值;改变阶数、中心化或估计器都会改变拟合对象。
  • 十六个样本仅用于解释过程,不能据此可靠推断生成机制。
  • 这里并非留出预测评估:模型拟合于展示的记录,仅用于解释比较机制;自比较误差不必为零。
Example parameters / 示例参数
{
  "order": 2,
  "demean": "separately using full series mean",
  "intercept": false,
  "estimator": "conditional OLS, no regularization",
  "residual_variance": "mean squared fitted residual",
  "beta_x": [
    1.0243090422834804,
    -0.6188171023843692
  ],
  "beta_y": [
    1.2418713737062936,
    -0.8788590636409944
  ],
  "ar_companion_root_radii_x": [
    0.7866492880466931,
    0.7866492880466931
  ],
  "ar_companion_root_radii_y": [
    0.9374748336040784,
    0.9374748336040784
  ]
}

Definition sources / 定义来源: statsmodels: conditional least-squares autoregression; Exact illustrative inputs and encoder definitions

Discretized Markov-transition distance markov_distanceSpecified illustrative protocol
Discretized Markov-transition distance: static final state of the documented numerical example. distance = 0.188562.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.18856181 — Frobenius norm on conditional transition probabilities; rows unweighted.

EchoTime coverage: Possible addition

P_ij = count(s_t=i,s_(t+1)=j) / count(s_t=i); d=||P_x-P_y||_F

Demonstration: Specified illustrative protocol

Map observations to three shared value states and count consecutive state transitions. Row-normalized count matrices describe the next-state distribution conditional on the current state. Compare these matrices by Frobenius distance. This illustrates a specified first-order discretization, without establishing that either signal is generated by a Markov chain.

How the calculation works

  1. Use shared thresholds 0 and 0.7, then count consecutive transitions between the three states.
  2. Divide each row by its outgoing-transition count; every row is observed in this example.
  3. Square differences between corresponding conditional transition probabilities.
  4. Sum these squared differences and take their square root, giving the Frobenius norm.

Interpretation and limits

  • State boundaries and sampling interval define the estimated transitions; independently chosen bins would not have matching meanings.
  • Unobserved rows need a documented smoothing or missing-row policy. No smoothing is used here because every row has observations.
  • First-order transition matrices discard longer history and do not prove causal equivalence or equal state occupancy.

示例性质: 明确设定的流程示例

把观测映射到三个共享数值状态,统计连续状态转移。按行归一化的计数矩阵描述给定当前状态时的下一状态分布,再以 Frobenius 距离比较两个矩阵。这只是指定的一阶离散化示例,并未证明信号由 Markov 链生成。

计算步骤

  1. 用共享阈值 0 和 0.7 定义三个状态,再统计连续转移。
  2. 用各行转出总数进行归一化;本例每行均有观测。
  3. 对相对应的条件转移概率计算差的平方。
  4. 累加这些平方差并开平方,得到 Frobenius 范数。

解释与使用边界

  • 状态边界和采样间隔决定转移估计;分别选取的分箱可能不具有对应含义。
  • 未观测行需要明确平滑或缺失规则。本例每行均有观测,因此不平滑。
  • 一阶转移矩阵舍弃更长历史,也不能证明因果等价或状态占比相同。
Example parameters / 示例参数
{
  "state_thresholds": [
    0.0,
    0.7
  ],
  "order": 1,
  "smoothing": 0,
  "unobserved_rows": "not present in this example",
  "P_x": [
    [
      0.5,
      0.5,
      0.0
    ],
    [
      0.4,
      0.2,
      0.4
    ],
    [
      0.0,
      0.3333333333333333,
      0.6666666666666666
    ]
  ],
  "P_y": [
    [
      0.5,
      0.5,
      0.0
    ],
    [
      0.3333333333333333,
      0.3333333333333333,
      0.3333333333333333
    ],
    [
      0.0,
      0.4,
      0.6
    ]
  ]
}

Definition sources / 定义来源: Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Linear-trend model distance linear_trend_model_distanceChecked against EchoTime
Linear-trend model distance: static final state of the documented numerical example. distance = 0.118057.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.11805668 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Implemented in EchoTime · linear_trend_model_distance

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Checked against EchoTime

Fit an ordinary least-squares line to each series on the sample-index axis. Compare the intercept, slope and population standard deviation of residuals. This is EchoTime's three-coordinate trend description; it retains overall direction and unexplained variation while compressing local structure. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Fit x_t = intercept + slope*t and append the residual population SD.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • The slope uses sample index, so changing the sampling interval changes its interpretation; physical-time comparisons require consistent units.
  • Intercept, slope and residual SD have different scales. Curved trends and different residual patterns can share the same vector.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 已与 EchoTime 计算核对

以样本索引为时间轴,对每条序列拟合普通最小二乘直线,再比较截距、斜率和残差的总体标准差。这是 EchoTime 的三坐标趋势描述,保留总体方向与未解释波动,同时压缩局部结构。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 拟合 x_t = 截距 + 斜率*t,并加入残差总体标准差。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 斜率使用样本索引,改变采样间隔会改变其含义;按物理时间比较需要统一单位。
  • 截距、斜率与残差标准差尺度不同;弯曲趋势或不同残差结构可能共享同一向量。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "time_axis": "sample index 0..15",
  "fit": "ordinary least squares",
  "residual_std_ddof": 0,
  "features": [
    "intercept",
    "slope",
    "residual_std"
  ],
  "comparison": "euclidean"
}

Definition sources / 定义来源: EchoTime low-level implementation; Exact illustrative inputs and encoder definitions

Representation and comparison / 表示与比较 24
Specified encoder protocol embedding distance embedding_distanceSpecified illustrative protocol
Specified encoder protocol embedding distance: static final state of the documented numerical example. distance = 0.0826724.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.082672381 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Specified illustrative protocol

An embedding comparison first specifies an encoder, then a distance or similarity on its output. This diagram instantiates that protocol with the fixed vector [mean, population SD, adjusted lag-one ACF, linear slope]. It demonstrates the interface with actual numbers; no learned or pretrained representation is used. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Apply the explicitly specified four-statistic encoder identically to both inputs.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • This name is an interface pattern, not one uniquely defined algorithm; another encoder can produce entirely different neighbors.
  • The illustrative coordinates have different units and receive no scaling. No semantic, causal or task-transfer guarantee follows from a small score.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 明确设定的流程示例

嵌入比较先指定编码器,再指定输出空间的距离或相似度。本图使用固定的 [均值、总体标准差、调整后一阶自相关、线性斜率] 向量,以真实计算演示接口;未使用学习得到的表示或预训练模型。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 对两条输入使用完全相同、明确指定的四统计量编码器。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 该名称描述接口模式,不对应唯一算法;换用其他编码器会改变近邻关系。
  • 示例坐标单位不同且未缩放;较小分数不蕴含语义、因果或任务迁移保证。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "encoder": [
    "mean",
    "std_ddof0",
    "adjusted_ACF_lag1",
    "OLS_slope"
  ],
  "learned_weights": false,
  "coordinate_scaling": "none",
  "comparison": "euclidean"
}

Definition sources / 定义来源: Exact illustrative inputs and encoder definitions; Imported registry: named feature and comparison conventions

Specified encoder protocol embedding similarity embedding_similaritySpecified illustrative protocol
Specified encoder protocol embedding similarity: static final state of the documented numerical example. similarity = 0.996464.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.99646416 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

s(x,y) = dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))

Demonstration: Specified illustrative protocol

An embedding comparison first specifies an encoder, then a distance or similarity on its output. This diagram instantiates that protocol with the fixed vector [mean, population SD, adjusted lag-one ACF, linear slope]. It demonstrates the interface with actual numbers; no learned or pretrained representation is used. Cosine compares vector direction and is defined here for nonzero feature vectors.

How the calculation works

  1. Apply the explicitly specified four-statistic encoder identically to both inputs.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Normalize by both vector lengths and sum coordinate products to obtain cosine similarity.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • This name is an interface pattern, not one uniquely defined algorithm; another encoder can produce entirely different neighbors.
  • The illustrative coordinates have different units and receive no scaling. No semantic, causal or task-transfer guarantee follows from a small score.
  • Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy.

示例性质: 明确设定的流程示例

嵌入比较先指定编码器,再指定输出空间的距离或相似度。本图使用固定的 [均值、总体标准差、调整后一阶自相关、线性斜率] 向量,以真实计算演示接口;未使用学习得到的表示或预训练模型。 余弦比较向量方向,本例特征向量均非零。

计算步骤

  1. 对两条输入使用完全相同、明确指定的四统计量编码器。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 用两个向量的长度归一化坐标乘积之和,得到余弦相似度。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 该名称描述接口模式,不对应唯一算法;换用其他编码器会改变近邻关系。
  • 示例坐标单位不同且未缩放;较小分数不蕴含语义、因果或任务迁移保证。
  • 余弦忽略整个特征向量的正比例缩放;1-cosine 通常不满足度量公理,零向量还需明确处理规则。
Example parameters / 示例参数
{
  "encoder": [
    "mean",
    "std_ddof0",
    "adjusted_ACF_lag1",
    "OLS_slope"
  ],
  "learned_weights": false,
  "coordinate_scaling": "none",
  "comparison": "cosine"
}

Definition sources / 定义来源: Exact illustrative inputs and encoder definitions; Imported registry: named feature and comparison conventions

PAA block means embedding distance paa_embedding_distanceReference-formula demonstration
PAA block means embedding distance: static final state of the documented numerical example. distance = 0.612694.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.61269408 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Reference-formula demonstration

Split the 16 observations into four equal, consecutive blocks and replace each block by its mean. Comparing these ordered block averages emphasizes coarse temporal structure. The animation highlights the exact observations contributing to each coordinate. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Average each consecutive block of four observations to obtain four coordinates.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • The displayed Euclidean feature distance is unscaled; the usual length-scaled PAA lower bound additionally multiplies it by sqrt(n/w).
  • Short events within a block can cancel, and moving a block boundary can alter the representation.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 参考公式演示

把 16 个观测分成四个连续等长区间,每个区间用均值表示。比较这些有序均值可突出较粗的时间结构;动图逐块高亮每个坐标所使用的观测。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 每四个连续观测求一次均值,得到四个坐标。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 图中欧氏特征距离未经长度缩放;常用 PAA 下界还需乘以 sqrt(n/w)。
  • 区间内的短暂事件可能互相抵消,改变分段边界也会改变表示。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "n_segments": 4,
  "block_size": 4,
  "z_normalization": false,
  "distance_length_scaling": false,
  "comparison": "euclidean"
}

Definition sources / 定义来源: tslearn: piecewise aggregate approximation; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

PAA block means embedding similarity paa_embedding_similarityReference-formula demonstration
PAA block means embedding similarity: static final state of the documented numerical example. similarity = 0.859565.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.85956485 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

s(x,y) = dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))

Demonstration: Reference-formula demonstration

Split the 16 observations into four equal, consecutive blocks and replace each block by its mean. Comparing these ordered block averages emphasizes coarse temporal structure. The animation highlights the exact observations contributing to each coordinate. Cosine compares vector direction and is defined here for nonzero feature vectors.

How the calculation works

  1. Average each consecutive block of four observations to obtain four coordinates.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Normalize by both vector lengths and sum coordinate products to obtain cosine similarity.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • The displayed Euclidean feature distance is unscaled; the usual length-scaled PAA lower bound additionally multiplies it by sqrt(n/w).
  • Short events within a block can cancel, and moving a block boundary can alter the representation.
  • Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy.

示例性质: 参考公式演示

把 16 个观测分成四个连续等长区间,每个区间用均值表示。比较这些有序均值可突出较粗的时间结构;动图逐块高亮每个坐标所使用的观测。 余弦比较向量方向,本例特征向量均非零。

计算步骤

  1. 每四个连续观测求一次均值,得到四个坐标。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 用两个向量的长度归一化坐标乘积之和,得到余弦相似度。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 图中欧氏特征距离未经长度缩放;常用 PAA 下界还需乘以 sqrt(n/w)。
  • 区间内的短暂事件可能互相抵消,改变分段边界也会改变表示。
  • 余弦忽略整个特征向量的正比例缩放;1-cosine 通常不满足度量公理,零向量还需明确处理规则。
Example parameters / 示例参数
{
  "n_segments": 4,
  "block_size": 4,
  "z_normalization": false,
  "distance_length_scaling": false,
  "comparison": "cosine"
}

Definition sources / 定义来源: tslearn: piecewise aggregate approximation; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

DFT magnitudes embedding distance dft_embedding_distanceReference-formula demonstration
DFT magnitudes embedding distance: static final state of the documented numerical example. distance = 1.90421.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 1.9042105 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Reference-formula demonstration

Project the series onto sine and cosine bases, combine the real and imaginary parts into magnitudes, and compare the resulting frequency bins. The example retains all nine nonnegative-frequency bins of a length-16 real transform, including the DC bin. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Compute the unnormalized real FFT and retain the magnitude of each bin.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Magnitude discards phase; a circular shift changes Fourier phase while preserving these magnitudes.
  • The DC coordinate reflects the mean, and raw magnitudes depend on record length and amplitude. Matching sampling rates and frequency grids is required.
  • This example compares unweighted nonnegative-frequency rFFT magnitudes. Comparing a full FFT, or weighting interior rFFT magnitudes by sqrt(2), gives a different distance/cosine convention.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 参考公式演示

把序列投影到正弦、余弦基上,将实部和虚部合成为幅值,再比较频率坐标。本例保留长度 16 实数变换的全部九个非负频率坐标,包括直流分量。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 计算未归一化的实数 FFT,保留各频率坐标的模。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 幅值表示舍弃相位;循环平移改变傅里叶相位,却保留这些幅值。
  • 直流坐标反映均值,原始幅值依赖记录长度与振幅;比较时需要一致的采样率和频率网格。
  • 本例比较未加权的非负频率 rFFT 幅值。比较完整 FFT 或将内部 rFFT 幅值乘 sqrt(2),对应不同的距离与余弦约定。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "fft": "rfft",
  "normalization": "backward",
  "n_bins": 9,
  "include_DC": true,
  "comparison": "euclidean"
}

Definition sources / 定义来源: NumPy: real-input discrete Fourier transform; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

DFT magnitudes embedding similarity dft_embedding_similarityReference-formula demonstration
DFT magnitudes embedding similarity: static final state of the documented numerical example. similarity = 0.978179.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.97817876 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

s(x,y) = dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))

Demonstration: Reference-formula demonstration

Project the series onto sine and cosine bases, combine the real and imaginary parts into magnitudes, and compare the resulting frequency bins. The example retains all nine nonnegative-frequency bins of a length-16 real transform, including the DC bin. Cosine compares vector direction and is defined here for nonzero feature vectors.

How the calculation works

  1. Compute the unnormalized real FFT and retain the magnitude of each bin.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Normalize by both vector lengths and sum coordinate products to obtain cosine similarity.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Magnitude discards phase; a circular shift changes Fourier phase while preserving these magnitudes.
  • The DC coordinate reflects the mean, and raw magnitudes depend on record length and amplitude. Matching sampling rates and frequency grids is required.
  • This example compares unweighted nonnegative-frequency rFFT magnitudes. Comparing a full FFT, or weighting interior rFFT magnitudes by sqrt(2), gives a different distance/cosine convention.
  • Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy.

示例性质: 参考公式演示

把序列投影到正弦、余弦基上,将实部和虚部合成为幅值,再比较频率坐标。本例保留长度 16 实数变换的全部九个非负频率坐标,包括直流分量。 余弦比较向量方向,本例特征向量均非零。

计算步骤

  1. 计算未归一化的实数 FFT,保留各频率坐标的模。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 用两个向量的长度归一化坐标乘积之和,得到余弦相似度。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 幅值表示舍弃相位;循环平移改变傅里叶相位,却保留这些幅值。
  • 直流坐标反映均值,原始幅值依赖记录长度与振幅;比较时需要一致的采样率和频率网格。
  • 本例比较未加权的非负频率 rFFT 幅值。比较完整 FFT 或将内部 rFFT 幅值乘 sqrt(2),对应不同的距离与余弦约定。
  • 余弦忽略整个特征向量的正比例缩放;1-cosine 通常不满足度量公理,零向量还需明确处理规则。
Example parameters / 示例参数
{
  "fft": "rfft",
  "normalization": "backward",
  "n_bins": 9,
  "include_DC": true,
  "comparison": "cosine"
}

Definition sources / 定义来源: NumPy: real-input discrete Fourier transform; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Basic statistics embedding distance stats_embedding_distanceReference-formula demonstration
Basic statistics embedding distance: static final state of the documented numerical example. distance = 0.399763.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.3997628 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Reference-formula demonstration

Represent each series by its mean, population standard deviation, minimum and maximum. These four coordinates summarize level, spread and range; their order in the vector is fixed, while the original temporal order is discarded. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Compute mean, population SD, minimum and maximum in that order.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Permuting observations leaves this vector unchanged, even when temporal behavior changes completely.
  • Features have different scales; this example uses no coordinate weighting. A production scaler must be fitted without test-data leakage.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 参考公式演示

把每条序列表示为均值、总体标准差、最小值和最大值四个坐标。它们概括水平、波动和范围,坐标顺序固定,但原始时间顺序被舍弃。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 按均值、总体标准差、最小值、最大值的顺序提取特征。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 任意重排序列不会改变该向量,即使时间行为发生显著变化。
  • 各坐标尺度不同;本例不加权。实际使用的缩放器应避免测试数据泄漏。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "features": [
    "mean",
    "std_ddof0",
    "min",
    "max"
  ],
  "coordinate_scaling": "none",
  "comparison": "euclidean"
}

Definition sources / 定义来源: NumPy: summary-statistic definitions; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Basic statistics embedding similarity stats_embedding_similarityReference-formula demonstration
Basic statistics embedding similarity: static final state of the documented numerical example. similarity = 0.993062.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.99306157 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

s(x,y) = dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))

Demonstration: Reference-formula demonstration

Represent each series by its mean, population standard deviation, minimum and maximum. These four coordinates summarize level, spread and range; their order in the vector is fixed, while the original temporal order is discarded. Cosine compares vector direction and is defined here for nonzero feature vectors.

How the calculation works

  1. Compute mean, population SD, minimum and maximum in that order.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Normalize by both vector lengths and sum coordinate products to obtain cosine similarity.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Permuting observations leaves this vector unchanged, even when temporal behavior changes completely.
  • Features have different scales; this example uses no coordinate weighting. A production scaler must be fitted without test-data leakage.
  • Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy.

示例性质: 参考公式演示

把每条序列表示为均值、总体标准差、最小值和最大值四个坐标。它们概括水平、波动和范围,坐标顺序固定,但原始时间顺序被舍弃。 余弦比较向量方向,本例特征向量均非零。

计算步骤

  1. 按均值、总体标准差、最小值、最大值的顺序提取特征。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 用两个向量的长度归一化坐标乘积之和,得到余弦相似度。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 任意重排序列不会改变该向量,即使时间行为发生显著变化。
  • 各坐标尺度不同;本例不加权。实际使用的缩放器应避免测试数据泄漏。
  • 余弦忽略整个特征向量的正比例缩放;1-cosine 通常不满足度量公理,零向量还需明确处理规则。
Example parameters / 示例参数
{
  "features": [
    "mean",
    "std_ddof0",
    "min",
    "max"
  ],
  "coordinate_scaling": "none",
  "comparison": "cosine"
}

Definition sources / 定义来源: NumPy: summary-statistic definitions; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Robust statistics embedding distance robust_stats_embedding_distanceReference-formula demonstration
Robust statistics embedding distance: static final state of the documented numerical example. distance = 0.126419.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.12641944 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Reference-formula demonstration

Replace extrema and moments with the lower quartile, median, upper quartile and median absolute deviation. This explicit descriptor emphasizes the central distribution and reduces the influence of isolated extreme values. It does not preserve the timing of those values. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Calculate Q25, median, Q75 and unscaled median absolute deviation.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Robustness concerns these particular statistics, not immunity to arbitrary contamination or distribution shift.
  • Quantiles use linear interpolation and MAD is unscaled; alternative conventions produce different vectors.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 参考公式演示

使用下四分位数、中位数、上四分位数和中位绝对偏差构成明确的描述向量。它强调分布的中心部分,降低孤立极端值的影响,同时舍弃这些数值出现的时刻。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 计算 Q25、中位数、Q75 和未经常数缩放的中位绝对偏差。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 稳健性针对所选统计量,并不表示可抵抗任意污染或分布变化。
  • 本例分位数采用线性插值,MAD 不乘缩放常数;其他约定会产生不同向量。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "features": [
    "q25",
    "median",
    "q75",
    "unscaled_MAD"
  ],
  "quantile_method": "linear",
  "comparison": "euclidean"
}

Definition sources / 定义来源: NumPy: summary-statistic definitions; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Robust statistics embedding similarity robust_stats_embedding_similarityReference-formula demonstration
Robust statistics embedding similarity: static final state of the documented numerical example. similarity = 0.994938.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.9949377 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

s(x,y) = dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))

Demonstration: Reference-formula demonstration

Replace extrema and moments with the lower quartile, median, upper quartile and median absolute deviation. This explicit descriptor emphasizes the central distribution and reduces the influence of isolated extreme values. It does not preserve the timing of those values. Cosine compares vector direction and is defined here for nonzero feature vectors.

How the calculation works

  1. Calculate Q25, median, Q75 and unscaled median absolute deviation.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Normalize by both vector lengths and sum coordinate products to obtain cosine similarity.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Robustness concerns these particular statistics, not immunity to arbitrary contamination or distribution shift.
  • Quantiles use linear interpolation and MAD is unscaled; alternative conventions produce different vectors.
  • Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy.

示例性质: 参考公式演示

使用下四分位数、中位数、上四分位数和中位绝对偏差构成明确的描述向量。它强调分布的中心部分,降低孤立极端值的影响,同时舍弃这些数值出现的时刻。 余弦比较向量方向,本例特征向量均非零。

计算步骤

  1. 计算 Q25、中位数、Q75 和未经常数缩放的中位绝对偏差。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 用两个向量的长度归一化坐标乘积之和,得到余弦相似度。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 稳健性针对所选统计量,并不表示可抵抗任意污染或分布变化。
  • 本例分位数采用线性插值,MAD 不乘缩放常数;其他约定会产生不同向量。
  • 余弦忽略整个特征向量的正比例缩放;1-cosine 通常不满足度量公理,零向量还需明确处理规则。
Example parameters / 示例参数
{
  "features": [
    "q25",
    "median",
    "q75",
    "unscaled_MAD"
  ],
  "quantile_method": "linear",
  "comparison": "cosine"
}

Definition sources / 定义来源: NumPy: summary-statistic definitions; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Autocorrelation features embedding distance acf_embedding_distanceReference-formula demonstration
Autocorrelation features embedding distance: static final state of the documented numerical example. distance = 0.368804.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.36880413 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Reference-formula demonstration

Center each series and compare it with delayed versions of itself. Six lag coordinates summarize repeated linear dependence. This example follows EchoTime's adjusted denominator, (n-lag) times the population variance, and omits the always-one lag-zero coordinate. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. At each lag, sum centered lagged products and divide by (n-lag) times variance.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Adjusted high-lag sample estimates need not remain inside [-1,1]; estimates are less reliable with fewer overlapping pairs.
  • ACF drops the mean and amplitude scale and cannot fully identify nonlinear dependence or the original waveform.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 参考公式演示

先对序列去均值,再与自身的延迟版本比较。六个滞后坐标描述重复出现的线性依赖。本例采用 EchoTime 的调整分母,即 (n-lag) 乘总体方差,并省略恒为一的零滞后坐标。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 逐个滞后累加去均值后的乘积,除以 (n-lag) 乘方差。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 经过样本数调整的高滞后估计不一定落在 [-1,1],重叠点越少估计越不稳定。
  • ACF 舍弃均值和振幅尺度,无法完整识别非线性依赖或恢复原波形。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "max_lag": 6,
  "denominator": "(n-lag)*population_variance",
  "lag_zero": "omitted",
  "comparison": "euclidean"
}

Definition sources / 定义来源: EchoTime low-level implementation; statsmodels: ACF denominator and adjusted convention; Exact illustrative inputs and encoder definitions

Autocorrelation features embedding similarity acf_embedding_similarityReference-formula demonstration
Autocorrelation features embedding similarity: static final state of the documented numerical example. similarity = 0.971449.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.97144913 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

s(x,y) = dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))

Demonstration: Reference-formula demonstration

Center each series and compare it with delayed versions of itself. Six lag coordinates summarize repeated linear dependence. This example follows EchoTime's adjusted denominator, (n-lag) times the population variance, and omits the always-one lag-zero coordinate. Cosine compares vector direction and is defined here for nonzero feature vectors.

How the calculation works

  1. At each lag, sum centered lagged products and divide by (n-lag) times variance.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Normalize by both vector lengths and sum coordinate products to obtain cosine similarity.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Adjusted high-lag sample estimates need not remain inside [-1,1]; estimates are less reliable with fewer overlapping pairs.
  • ACF drops the mean and amplitude scale and cannot fully identify nonlinear dependence or the original waveform.
  • Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy.

示例性质: 参考公式演示

先对序列去均值,再与自身的延迟版本比较。六个滞后坐标描述重复出现的线性依赖。本例采用 EchoTime 的调整分母,即 (n-lag) 乘总体方差,并省略恒为一的零滞后坐标。 余弦比较向量方向,本例特征向量均非零。

计算步骤

  1. 逐个滞后累加去均值后的乘积,除以 (n-lag) 乘方差。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 用两个向量的长度归一化坐标乘积之和,得到余弦相似度。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 经过样本数调整的高滞后估计不一定落在 [-1,1],重叠点越少估计越不稳定。
  • ACF 舍弃均值和振幅尺度,无法完整识别非线性依赖或恢复原波形。
  • 余弦忽略整个特征向量的正比例缩放;1-cosine 通常不满足度量公理,零向量还需明确处理规则。
Example parameters / 示例参数
{
  "max_lag": 6,
  "denominator": "(n-lag)*population_variance",
  "lag_zero": "omitted",
  "comparison": "cosine"
}

Definition sources / 定义来源: EchoTime low-level implementation; statsmodels: ACF denominator and adjusted convention; Exact illustrative inputs and encoder definitions

Coarse Haar coefficients embedding distance wavelet_embedding_distanceReference-formula demonstration
Coarse Haar coefficients embedding distance: static final state of the documented numerical example. distance = 1.58682.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 1.586823 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Reference-formula demonstration

Recursively average and difference adjacent pairs with orthonormal Haar scaling. Keep the coarsest average and the next three detail levels: eight of the 16 coefficients. Comparing this vector emphasizes retained scales while deliberately discarding the finest eight detail coefficients. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Apply Haar pair averages/differences recursively and retain [A4,D4,D3,D2].
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • This is a truncated transform; different high-frequency details can produce exactly the same retained vector.
  • Haar coefficients depend on alignment and boundary handling. Here the length is a power of two and no padding is needed.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 参考公式演示

对相邻点反复计算带正交归一化的和与差。本例保留最粗近似及随后三级细节,共 16 个系数中的八个;比较这些坐标强调所保留尺度,并主动舍弃最细的八个细节系数。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 递归计算 Haar 相邻点和差,保留 [A4,D4,D3,D2]。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 这里使用截断变换;不同的高频细节可能产生完全相同的保留向量。
  • Haar 系数依赖对齐与边界处理。本例长度为二的幂,因此无需填充。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "wavelet": "orthonormal Haar",
  "length": 16,
  "coefficient_order": "A4,D4,D3,D2,D1",
  "retained": 8,
  "boundary": "no padding",
  "comparison": "euclidean"
}

Definition sources / 定义来源: PyWavelets: Haar approximation and detail coefficients; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Coarse Haar coefficients embedding similarity wavelet_embedding_similarityReference-formula demonstration
Coarse Haar coefficients embedding similarity: static final state of the documented numerical example. similarity = 0.807044.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.80704365 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

s(x,y) = dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))

Demonstration: Reference-formula demonstration

Recursively average and difference adjacent pairs with orthonormal Haar scaling. Keep the coarsest average and the next three detail levels: eight of the 16 coefficients. Comparing this vector emphasizes retained scales while deliberately discarding the finest eight detail coefficients. Cosine compares vector direction and is defined here for nonzero feature vectors.

How the calculation works

  1. Apply Haar pair averages/differences recursively and retain [A4,D4,D3,D2].
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Normalize by both vector lengths and sum coordinate products to obtain cosine similarity.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • This is a truncated transform; different high-frequency details can produce exactly the same retained vector.
  • Haar coefficients depend on alignment and boundary handling. Here the length is a power of two and no padding is needed.
  • Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy.

示例性质: 参考公式演示

对相邻点反复计算带正交归一化的和与差。本例保留最粗近似及随后三级细节,共 16 个系数中的八个;比较这些坐标强调所保留尺度,并主动舍弃最细的八个细节系数。 余弦比较向量方向,本例特征向量均非零。

计算步骤

  1. 递归计算 Haar 相邻点和差,保留 [A4,D4,D3,D2]。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 用两个向量的长度归一化坐标乘积之和,得到余弦相似度。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 这里使用截断变换;不同的高频细节可能产生完全相同的保留向量。
  • Haar 系数依赖对齐与边界处理。本例长度为二的幂,因此无需填充。
  • 余弦忽略整个特征向量的正比例缩放;1-cosine 通常不满足度量公理,零向量还需明确处理规则。
Example parameters / 示例参数
{
  "wavelet": "orthonormal Haar",
  "length": 16,
  "coefficient_order": "A4,D4,D3,D2,D1",
  "retained": 8,
  "boundary": "no padding",
  "comparison": "cosine"
}

Definition sources / 定义来源: PyWavelets: Haar approximation and detail coefficients; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Value histograms embedding distance histogram_embedding_distanceReference-formula demonstration
Value histograms embedding distance: static final state of the documented numerical example. distance = 0.330719.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.33071891 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Reference-formula demonstration

Count observations in seven shared, fixed value intervals and divide by the sample count. The two probability vectors describe how often values occur. Shared edges make the coordinates comparable; all temporal ordering is intentionally removed. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Use identical bin edges for both inputs and normalize counts into bin probabilities.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Separate automatic binning can make coordinate-wise comparison invalid; the edges must be shared.
  • Values within one bin are indistinguishable, and permuted sequences have identical histograms.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 参考公式演示

在七个共享、固定的数值区间中计数,再除以样本数。两个概率向量描述数值出现的频率。共享边界保证坐标可比较,同时有意舍弃全部时间顺序。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 对两条序列使用相同分箱边界,将计数归一化为概率。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 分别自动分箱可能导致坐标不可比,因此必须共享边界。
  • 同一区间内的数值无法区分,重排序列也具有相同直方图。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "edges": [
    -1.5,
    -1.0,
    -0.5,
    0.0,
    0.5,
    1.0,
    1.5,
    2.0
  ],
  "normalization": "probability mass, not density",
  "comparison": "euclidean"
}

Definition sources / 定义来源: NumPy: histogram bins and normalization; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Value histograms embedding similarity histogram_embedding_similarityReference-formula demonstration
Value histograms embedding similarity: static final state of the documented numerical example. similarity = 0.778661.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.77866111 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

s(x,y) = dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))

Demonstration: Reference-formula demonstration

Count observations in seven shared, fixed value intervals and divide by the sample count. The two probability vectors describe how often values occur. Shared edges make the coordinates comparable; all temporal ordering is intentionally removed. Cosine compares vector direction and is defined here for nonzero feature vectors.

How the calculation works

  1. Use identical bin edges for both inputs and normalize counts into bin probabilities.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Normalize by both vector lengths and sum coordinate products to obtain cosine similarity.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Separate automatic binning can make coordinate-wise comparison invalid; the edges must be shared.
  • Values within one bin are indistinguishable, and permuted sequences have identical histograms.
  • Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy.

示例性质: 参考公式演示

在七个共享、固定的数值区间中计数,再除以样本数。两个概率向量描述数值出现的频率。共享边界保证坐标可比较,同时有意舍弃全部时间顺序。 余弦比较向量方向,本例特征向量均非零。

计算步骤

  1. 对两条序列使用相同分箱边界,将计数归一化为概率。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 用两个向量的长度归一化坐标乘积之和,得到余弦相似度。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 分别自动分箱可能导致坐标不可比,因此必须共享边界。
  • 同一区间内的数值无法区分,重排序列也具有相同直方图。
  • 余弦忽略整个特征向量的正比例缩放;1-cosine 通常不满足度量公理,零向量还需明确处理规则。
Example parameters / 示例参数
{
  "edges": [
    -1.5,
    -1.0,
    -0.5,
    0.0,
    0.5,
    1.0,
    1.5,
    2.0
  ],
  "normalization": "probability mass, not density",
  "comparison": "cosine"
}

Definition sources / 定义来源: NumPy: histogram bins and normalization; Imported registry: named feature and comparison conventions; Exact illustrative inputs and encoder definitions

Normalized FFT-bin powers embedding distance periodogram_embedding_distanceReference-formula demonstration
Normalized FFT-bin powers embedding distance: static final state of the documented numerical example. distance = 0.131733.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.13173288 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Reference-formula demonstration

Square the real-FFT magnitudes and normalize their sum to one. EchoTime compares these power-share vectors with Euclidean distance. The example retains all nine bins and the mean-related DC component, so every coordinate represents a share of this particular discrete power convention. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Square each rFFT magnitude, then divide by the sum over all retained nonnegative-frequency bins.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • This is EchoTime's normalized rFFT-bin convention: no detrending, window, or one-sided interior-bin doubling. It is not a physical-density PSD estimate.
  • Normalization discards total power and phase; positive amplitude rescaling alone leaves this representation unchanged.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 参考公式演示

将实数 FFT 幅值平方,再除以总和得到功率占比向量。EchoTime 使用欧氏距离比较该向量。本例保留全部九个频点和与均值相关的直流项,因此每个坐标都是这一离散功率约定下的占比。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 对 rFFT 幅值逐点平方,再除以全部非负频点功率的总和。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 这是 EchoTime 的归一化 rFFT 频点约定:不去趋势、不加窗,也不把单边谱内部频点乘二;它不等于具有物理单位的功率谱密度估计。
  • 归一化舍弃总功率和相位;单纯的正振幅缩放不会改变此表示。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "n_coeffs": 9,
  "normalization": "divide rFFT squared magnitudes by their sum",
  "detrend": false,
  "one_sided_doubling": false,
  "comparison": "euclidean"
}

Definition sources / 定义来源: EchoTime low-level implementation; NumPy: real-input discrete Fourier transform; Exact illustrative inputs and encoder definitions

Normalized FFT-bin powers embedding similarity periodogram_embedding_similarityReference-formula demonstration
Normalized FFT-bin powers embedding similarity: static final state of the documented numerical example. similarity = 0.981643.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.9816434 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

s(x,y) = dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))

Demonstration: Reference-formula demonstration

Square the real-FFT magnitudes and normalize their sum to one. EchoTime compares these power-share vectors with Euclidean distance. The example retains all nine bins and the mean-related DC component, so every coordinate represents a share of this particular discrete power convention. Cosine compares vector direction and is defined here for nonzero feature vectors.

How the calculation works

  1. Square each rFFT magnitude, then divide by the sum over all retained nonnegative-frequency bins.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Normalize by both vector lengths and sum coordinate products to obtain cosine similarity.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • This is EchoTime's normalized rFFT-bin convention: no detrending, window, or one-sided interior-bin doubling. It is not a physical-density PSD estimate.
  • Normalization discards total power and phase; positive amplitude rescaling alone leaves this representation unchanged.
  • Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy.

示例性质: 参考公式演示

将实数 FFT 幅值平方,再除以总和得到功率占比向量。EchoTime 使用欧氏距离比较该向量。本例保留全部九个频点和与均值相关的直流项,因此每个坐标都是这一离散功率约定下的占比。 余弦比较向量方向,本例特征向量均非零。

计算步骤

  1. 对 rFFT 幅值逐点平方,再除以全部非负频点功率的总和。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 用两个向量的长度归一化坐标乘积之和,得到余弦相似度。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 这是 EchoTime 的归一化 rFFT 频点约定:不去趋势、不加窗,也不把单边谱内部频点乘二;它不等于具有物理单位的功率谱密度估计。
  • 归一化舍弃总功率和相位;单纯的正振幅缩放不会改变此表示。
  • 余弦忽略整个特征向量的正比例缩放;1-cosine 通常不满足度量公理,零向量还需明确处理规则。
Example parameters / 示例参数
{
  "n_coeffs": 9,
  "normalization": "divide rFFT squared magnitudes by their sum",
  "detrend": false,
  "one_sided_doubling": false,
  "comparison": "cosine"
}

Definition sources / 定义来源: EchoTime low-level implementation; NumPy: real-input discrete Fourier transform; Exact illustrative inputs and encoder definitions

Linear trend features embedding distance trend_embedding_distanceReference-formula demonstration
Linear trend features embedding distance: static final state of the documented numerical example. distance = 0.118057.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.11805668 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Reference-formula demonstration

Fit an ordinary least-squares line to each series on the sample-index axis. Compare the intercept, slope and population standard deviation of residuals. This is EchoTime's three-coordinate trend description; it retains overall direction and unexplained variation while compressing local structure. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Fit x_t = intercept + slope*t and append the residual population SD.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • The slope uses sample index, so changing the sampling interval changes its interpretation; physical-time comparisons require consistent units.
  • Intercept, slope and residual SD have different scales. Curved trends and different residual patterns can share the same vector.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 参考公式演示

以样本索引为时间轴,对每条序列拟合普通最小二乘直线,再比较截距、斜率和残差的总体标准差。这是 EchoTime 的三坐标趋势描述,保留总体方向与未解释波动,同时压缩局部结构。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 拟合 x_t = 截距 + 斜率*t,并加入残差总体标准差。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 斜率使用样本索引,改变采样间隔会改变其含义;按物理时间比较需要统一单位。
  • 截距、斜率与残差标准差尺度不同;弯曲趋势或不同残差结构可能共享同一向量。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "time_axis": "sample index 0..15",
  "fit": "ordinary least squares",
  "residual_std_ddof": 0,
  "features": [
    "intercept",
    "slope",
    "residual_std"
  ],
  "comparison": "euclidean"
}

Definition sources / 定义来源: EchoTime low-level implementation; Exact illustrative inputs and encoder definitions

Linear trend features embedding similarity trend_embedding_similarityReference-formula demonstration
Linear trend features embedding similarity: static final state of the documented numerical example. similarity = 0.99812.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.99811962 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

s(x,y) = dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))

Demonstration: Reference-formula demonstration

Fit an ordinary least-squares line to each series on the sample-index axis. Compare the intercept, slope and population standard deviation of residuals. This is EchoTime's three-coordinate trend description; it retains overall direction and unexplained variation while compressing local structure. Cosine compares vector direction and is defined here for nonzero feature vectors.

How the calculation works

  1. Fit x_t = intercept + slope*t and append the residual population SD.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Normalize by both vector lengths and sum coordinate products to obtain cosine similarity.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • The slope uses sample index, so changing the sampling interval changes its interpretation; physical-time comparisons require consistent units.
  • Intercept, slope and residual SD have different scales. Curved trends and different residual patterns can share the same vector.
  • Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy.

示例性质: 参考公式演示

以样本索引为时间轴,对每条序列拟合普通最小二乘直线,再比较截距、斜率和残差的总体标准差。这是 EchoTime 的三坐标趋势描述,保留总体方向与未解释波动,同时压缩局部结构。 余弦比较向量方向,本例特征向量均非零。

计算步骤

  1. 拟合 x_t = 截距 + 斜率*t,并加入残差总体标准差。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 用两个向量的长度归一化坐标乘积之和,得到余弦相似度。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 斜率使用样本索引,改变采样间隔会改变其含义;按物理时间比较需要统一单位。
  • 截距、斜率与残差标准差尺度不同;弯曲趋势或不同残差结构可能共享同一向量。
  • 余弦忽略整个特征向量的正比例缩放;1-cosine 通常不满足度量公理,零向量还需明确处理规则。
Example parameters / 示例参数
{
  "time_axis": "sample index 0..15",
  "fit": "ordinary least squares",
  "residual_std_ddof": 0,
  "features": [
    "intercept",
    "slope",
    "residual_std"
  ],
  "comparison": "cosine"
}

Definition sources / 定义来源: EchoTime low-level implementation; Exact illustrative inputs and encoder definitions

Fixed Gaussian projection embedding distance random_projection_embedding_distanceReference-formula demonstration
Fixed Gaussian projection embedding distance: static final state of the documented numerical example. distance = 2.17478.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 2.1747811 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Reference-formula demonstration

Multiply both 16-coordinate inputs by the same six-by-16 Gaussian matrix. Each output coordinate is a weighted sum of all observations. The matrix is fixed by an explicit random seed, allowing the comparison to be reproduced without fitting a neural encoder. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Use the same fixed matrix with entries N(0,1/6) to project both inputs to six dimensions.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • The six-dimensional example has no asserted distortion guarantee. Johnson-Lindenstrauss guarantees require dimensions and probability assumptions tied to a finite point set.
  • Changing the random seed changes the representation; a shared matrix and identical input length/order are essential.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 参考公式演示

将两个 16 维输入乘以同一个六乘十六高斯矩阵。每个输出坐标都是全部观测的加权和。矩阵由明确的随机种子固定,因此无需拟合神经编码器也可复现比较。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 使用同一个元素分布为 N(0,1/6) 的固定矩阵,把两条输入投影到六维。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 本例六维投影不声称满足给定失真保证。Johnson-Lindenstrauss 保证需要维数、概率与有限样本集等条件。
  • 改变随机种子会改变表示;必须共享矩阵并保持输入长度及顺序一致。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "seed": 20261029,
  "matrix_shape": [
    6,
    16
  ],
  "entry_variance": 0.16666666666666666,
  "matrix": [
    [
      -0.5194508388046408,
      0.6925531409100528,
      0.5276738178253589,
      0.3421103162417348,
      -0.24189739800758292,
      -0.9318042670330671,
      -0.34699445019019953,
      0.14895157038933,
      0.6577606001663231,
      -0.21587247502476686,
      -0.2105641686898666,
      -0.015183263110597449,
      -0.20443004209346777,
      -0.10526240498773033,
      -0.5486230062454652,
      0.4718299455848165
    ],
    [
      0.2327057158176952,
      0.6454625109247026,
      -0.12318259251046923,
      0.25288704457474365,
      0.5299530066457878,
      0.14748919107826164,
      -0.5529611921267462,
      -0.7973348966527448,
      -0.08858696791282737,
      0.3087051680423722,
      -0.007836755555181388,
      0.019690312134448135,
      0.006657913594121614,
      0.3019453761132193,
      -0.19151184428095228,
      -0.13148287000823003
    ],
    [
      0.21955486202821017,
      0.48781296520432166,
      0.07854972933328519,
      0.02919957197589381,
      0.6884227119244153,
      -0.09857667067434531,
      -0.5437985569677152,
      -0.4491742559455326,
      0.08120241246922642,
      0.3630345341848169,
      0.30908359446022704,
      -0.7365370367941714,
      0.15527484782427062,
      -0.4016272660891914,
      -0.12859587242424278,
      -0.5582775404109902
    ],
    [
      -0.44441214068371343,
      -0.6466959020726512,
      -0.08407162511751691,
      0.03746271400150741,
      0.6884879939914507,
      0.22936749259862166,
      -0.019760913537307537,
      0.2904130430090459,
      0.15322119753002061,
      -0.225364493051222,
      0.49494073969284363,
      -0.2821395369092543,
      0.41034750400122044,
      -0.16927341099846036,
      -0.07673290479639887,
      0.12944873559450343
    ],
    [
      -0.51820184901937,
      -0.25613690547027307,
      0.6864569705061614,
      0.11672156402718992,
      0.12811765966664293,
      0.4888237591453126,
      0.6243619724292387,
      0.10779096348337862,
      -0.24638569673590888,
      0.35934223480128535,
      0.31266069712623906,
      0.42222017603534623,
      -0.42806978292645914,
      0.6200435544376961,
      -0.32300884834046717,
      0.31090852239967715
    ],
    [
      -1.0255688097145366,
      0.006464660794459475,
      0.037491746873668665,
      -0.2758645415506253,
      -0.17787689637825516,
      -0.1919426644991183,
      -0.23769543055234207,
      -0.16238956597387602,
      0.05048832099679738,
      -0.24592874184414845,
      0.007701695534513878,
      0.07873697208976303,
      -0.4160840825154048,
      0.5885124515203,
      0.18272399200616546,
      0.17656027328524054
    ]
  ],
  "comparison": "euclidean"
}

Definition sources / 定义来源: scikit-learn: Gaussian random projection; Exact illustrative inputs and encoder definitions

Fixed Gaussian projection embedding similarity random_projection_embedding_similarityReference-formula demonstration
Fixed Gaussian projection embedding similarity: static final state of the documented numerical example. similarity = 0.688633.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.68863331 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

s(x,y) = dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))

Demonstration: Reference-formula demonstration

Multiply both 16-coordinate inputs by the same six-by-16 Gaussian matrix. Each output coordinate is a weighted sum of all observations. The matrix is fixed by an explicit random seed, allowing the comparison to be reproduced without fitting a neural encoder. Cosine compares vector direction and is defined here for nonzero feature vectors.

How the calculation works

  1. Use the same fixed matrix with entries N(0,1/6) to project both inputs to six dimensions.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Normalize by both vector lengths and sum coordinate products to obtain cosine similarity.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • The six-dimensional example has no asserted distortion guarantee. Johnson-Lindenstrauss guarantees require dimensions and probability assumptions tied to a finite point set.
  • Changing the random seed changes the representation; a shared matrix and identical input length/order are essential.
  • Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy.

示例性质: 参考公式演示

将两个 16 维输入乘以同一个六乘十六高斯矩阵。每个输出坐标都是全部观测的加权和。矩阵由明确的随机种子固定,因此无需拟合神经编码器也可复现比较。 余弦比较向量方向,本例特征向量均非零。

计算步骤

  1. 使用同一个元素分布为 N(0,1/6) 的固定矩阵,把两条输入投影到六维。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 用两个向量的长度归一化坐标乘积之和,得到余弦相似度。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 本例六维投影不声称满足给定失真保证。Johnson-Lindenstrauss 保证需要维数、概率与有限样本集等条件。
  • 改变随机种子会改变表示;必须共享矩阵并保持输入长度及顺序一致。
  • 余弦忽略整个特征向量的正比例缩放;1-cosine 通常不满足度量公理,零向量还需明确处理规则。
Example parameters / 示例参数
{
  "seed": 20261029,
  "matrix_shape": [
    6,
    16
  ],
  "entry_variance": 0.16666666666666666,
  "matrix": [
    [
      -0.5194508388046408,
      0.6925531409100528,
      0.5276738178253589,
      0.3421103162417348,
      -0.24189739800758292,
      -0.9318042670330671,
      -0.34699445019019953,
      0.14895157038933,
      0.6577606001663231,
      -0.21587247502476686,
      -0.2105641686898666,
      -0.015183263110597449,
      -0.20443004209346777,
      -0.10526240498773033,
      -0.5486230062454652,
      0.4718299455848165
    ],
    [
      0.2327057158176952,
      0.6454625109247026,
      -0.12318259251046923,
      0.25288704457474365,
      0.5299530066457878,
      0.14748919107826164,
      -0.5529611921267462,
      -0.7973348966527448,
      -0.08858696791282737,
      0.3087051680423722,
      -0.007836755555181388,
      0.019690312134448135,
      0.006657913594121614,
      0.3019453761132193,
      -0.19151184428095228,
      -0.13148287000823003
    ],
    [
      0.21955486202821017,
      0.48781296520432166,
      0.07854972933328519,
      0.02919957197589381,
      0.6884227119244153,
      -0.09857667067434531,
      -0.5437985569677152,
      -0.4491742559455326,
      0.08120241246922642,
      0.3630345341848169,
      0.30908359446022704,
      -0.7365370367941714,
      0.15527484782427062,
      -0.4016272660891914,
      -0.12859587242424278,
      -0.5582775404109902
    ],
    [
      -0.44441214068371343,
      -0.6466959020726512,
      -0.08407162511751691,
      0.03746271400150741,
      0.6884879939914507,
      0.22936749259862166,
      -0.019760913537307537,
      0.2904130430090459,
      0.15322119753002061,
      -0.225364493051222,
      0.49494073969284363,
      -0.2821395369092543,
      0.41034750400122044,
      -0.16927341099846036,
      -0.07673290479639887,
      0.12944873559450343
    ],
    [
      -0.51820184901937,
      -0.25613690547027307,
      0.6864569705061614,
      0.11672156402718992,
      0.12811765966664293,
      0.4888237591453126,
      0.6243619724292387,
      0.10779096348337862,
      -0.24638569673590888,
      0.35934223480128535,
      0.31266069712623906,
      0.42222017603534623,
      -0.42806978292645914,
      0.6200435544376961,
      -0.32300884834046717,
      0.31090852239967715
    ],
    [
      -1.0255688097145366,
      0.006464660794459475,
      0.037491746873668665,
      -0.2758645415506253,
      -0.17787689637825516,
      -0.1919426644991183,
      -0.23769543055234207,
      -0.16238956597387602,
      0.05048832099679738,
      -0.24592874184414845,
      0.007701695534513878,
      0.07873697208976303,
      -0.4160840825154048,
      0.5885124515203,
      0.18272399200616546,
      0.17656027328524054
    ]
  ],
  "comparison": "cosine"
}

Definition sources / 定义来源: scikit-learn: Gaussian random projection; Exact illustrative inputs and encoder definitions

Identity-resample features embedding distance identity_embedding_distanceReference-formula demonstration
Identity-resample features embedding distance: static final state of the documented numerical example. distance = 0.974946.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative distance: 0.9749464 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)

Demonstration: Reference-formula demonstration

Linearly interpolate each series onto the same eight-point normalized-time grid and use the samples themselves as coordinates. This explicit identity-resample adapter aligns the representation length without learning a latent model or aligning local events. Euclidean distance retains differences in both vector scale and coordinates.

How the calculation works

  1. Map each span to [0,1] and linearly interpolate at eight shared grid positions.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Take the Euclidean norm of the coordinate differences.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Normalizing time spans discards absolute duration unless it is retained separately.
  • Interpolation can miss or smooth brief events; it provides no invariance to arbitrary local timing changes.
  • A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information.

示例性质: 参考公式演示

将每条序列线性插值到同一个八点归一化时间网格,直接把重采样值作为坐标。这个明确的恒等重采样适配器统一表示长度,无需学习潜在模型,也不进行局部事件对齐。 欧氏距离同时保留向量尺度与坐标差异。

计算步骤

  1. 把各自时间跨度映射到 [0,1],在八个共享位置进行线性插值。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 对坐标差计算欧氏范数。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 分别归一化时间跨度会舍弃绝对持续时间,除非另行保留。
  • 插值可能遗漏或平滑短暂事件,也不提供任意局部时间变化下的不变性。
  • 当表示损失信息时,特征空间中的度量在原序列空间上可能只是伪度量。
Example parameters / 示例参数
{
  "n_points": 8,
  "interpolation": "linear",
  "grid": "independent normalized spans [0,1]",
  "comparison": "euclidean"
}

Definition sources / 定义来源: Imported registry: named feature and comparison conventions; NumPy: one-dimensional linear interpolation; Exact illustrative inputs and encoder definitions

Identity-resample features embedding similarity identity_embedding_similarityReference-formula demonstration
Identity-resample features embedding similarity: static final state of the documented numerical example. similarity = 0.84096.
Open GIF / 打开动图 Static image / 静态图 Inputs and trace / 输入与计算过程

Illustrative similarity: 0.84096008 — Computed from the explicitly defined illustrative encoder; no learned weights.

EchoTime coverage: Low-priority addition

s(x,y) = dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))

Demonstration: Reference-formula demonstration

Linearly interpolate each series onto the same eight-point normalized-time grid and use the samples themselves as coordinates. This explicit identity-resample adapter aligns the representation length without learning a latent model or aligning local events. Cosine compares vector direction and is defined here for nonzero feature vectors.

How the calculation works

  1. Map each span to [0,1] and linearly interpolate at eight shared grid positions.
  2. Collect the computed coordinates in the same fixed order for both inputs.
  3. Normalize by both vector lengths and sum coordinate products to obtain cosine similarity.
  4. Interpret the score in this representation, accounting for the information it discards.

Interpretation and limits

  • Normalizing time spans discards absolute duration unless it is retained separately.
  • Interpolation can miss or smooth brief events; it provides no invariance to arbitrary local timing changes.
  • Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy.

示例性质: 参考公式演示

将每条序列线性插值到同一个八点归一化时间网格,直接把重采样值作为坐标。这个明确的恒等重采样适配器统一表示长度,无需学习潜在模型,也不进行局部事件对齐。 余弦比较向量方向,本例特征向量均非零。

计算步骤

  1. 把各自时间跨度映射到 [0,1],在八个共享位置进行线性插值。
  2. 把计算得到的坐标按同一个固定顺序组成两个向量。
  3. 用两个向量的长度归一化坐标乘积之和,得到余弦相似度。
  4. 结合表示所舍弃的信息,在该表示空间中解释分数。

解释与使用边界

  • 分别归一化时间跨度会舍弃绝对持续时间,除非另行保留。
  • 插值可能遗漏或平滑短暂事件,也不提供任意局部时间变化下的不变性。
  • 余弦忽略整个特征向量的正比例缩放;1-cosine 通常不满足度量公理,零向量还需明确处理规则。
Example parameters / 示例参数
{
  "n_points": 8,
  "interpolation": "linear",
  "grid": "independent normalized spans [0,1]",
  "comparison": "cosine"
}

Definition sources / 定义来源: Imported registry: named feature and comparison conventions; NumPy: one-dimensional linear interpolation; Exact illustrative inputs and encoder definitions

Operating modes for elastic methods
  • `mode="exact"` keeps the full elastic score path and stays the default when you need a final value for a report, notebook, or paper.
  • `mode="fast"` is the screening path for large candidate pools and interactive shortlist work; it favors speed over exact-path fidelity.
  • `window=...` is available on `lcss_similarity`, `lcss_distance`, `edr_distance`, `erp_distance`, and `twed_distance` so you can keep the dynamic-programming path local when large warps are not plausible.
  • Recommended workflow: score all candidates with `mode="fast"` first, then rerun the shortlisted pairs with `mode="exact"` before you present the result as a final analog claim.
Implemented and high-fit additions from ts_similarity_package_v2_pkg

This table stays selective: it shows only the methods already added to EchoTime and the strongest candidates from the 127-method v2 registry. In the current build, the full high-fit shortlist is already implemented.

MethodEchoTime fitEchoTime APIFormulaWhy it fits
independent_max_ncc
sliding
Animated explanation / 动图详解
Implemented in EchoTimeindependent_max_ncc$s(X,Y)=\frac{1}{d}\sum_c \max_k NCC_k(X^{(c)},Y^{(c)})$This method is now available as a public low-level EchoTime similarity function.
independent_sbd
sliding
Animated explanation / 动图详解
Implemented in EchoTimeindependent_sbd$d(X,Y)=\frac{1}{d}\sum_c SBD(X^{(c)},Y^{(c)})$This method is now available as a public low-level EchoTime similarity function.
max_normalized_cross_correlation
sliding
Animated explanation / 动图详解
Implemented in EchoTimemax_ncc$s(x,y)=\max_k NCC_k(x,y)$This method is now available as a public low-level EchoTime similarity function.
sbd
sliding
Animated explanation / 动图详解
Implemented in EchoTimesbd$d(x,y)=1-\max_k NCC_k(x,y)$This method is now available as a public low-level EchoTime similarity function.
edr
elastic
Animated explanation / 动图详解
Implemented in EchoTimeedr_distance$EDR_{\epsilon}(x,y)$This method is now available as a public low-level EchoTime similarity function.
erp
elastic
Animated explanation / 动图详解
Implemented in EchoTimeerp_distance$ERP(x,y;g)$This method is now available as a public low-level EchoTime similarity function.
lcss_distance
elastic
Animated explanation / 动图详解
Implemented in EchoTimelcss_distance$d(x,y)=1-s_{LCSS}(x,y)$This method is now available as a public low-level EchoTime similarity function.
lcss_similarity
elastic
Animated explanation / 动图详解
Implemented in EchoTimelcss_similarity$s(x,y)=LCSS_{\epsilon}(x,y)/\min(n,m)$This method is now available as a public low-level EchoTime similarity function.
twed
elastic
Animated explanation / 动图详解
Implemented in EchoTimetwed_distance$TWED_{\lambda,\nu}(x,y)$This method is now available as a public low-level EchoTime similarity function.
acf_distance
feature-based
Animated explanation / 动图详解
Implemented in EchoTimeacf_distance$d(x,y)=\|ACF(x)-ACF(y)\|_2$This method is now available as a public low-level EchoTime similarity function.
ordinal_pattern_js_distance
feature-based
Animated explanation / 动图详解
Implemented in EchoTimeordinal_pattern_js_distance$d(x,y)=\sqrt{JSD(\Pi(x),\Pi(y))}$This method is now available as a public low-level EchoTime similarity function.
periodogram_distance
feature-based
Animated explanation / 动图详解
Implemented in EchoTimeperiodogram_distance$d(x,y)=\|P_x-P_y\|_2$This method is now available as a public low-level EchoTime similarity function.
trend_distance
feature-based
Animated explanation / 动图详解
Implemented in EchoTimetrend_distance$d(x,y)=\|\phi_{\mathrm{trend}}(x)-\phi_{\mathrm{trend}}(y)\|_2$This method is now available as a public low-level EchoTime similarity function.
linear_trend_model_distance
model-based
Animated explanation / 动图详解
Implemented in EchoTimelinear_trend_model_distance$d(x,y)=\|\theta_{\mathrm{trend}}(x)-\theta_{\mathrm{trend}}(y)\|_2$This method is now available as a public low-level EchoTime similarity function.
lock-step

Pointwise comparison on an already aligned timeline.

MethodOutputMetricComplexityUnequal lengthMultivariateImplementationEchoTime fitEchoTime APIFormulaNote
euclidean
Animated explanation / 动图详解
distanceyesO(n·d)noyesexactLow-priority addition-$d(x,y)=\sqrt{\sum_t \|x_t-y_t\|_2^2}$Equal-length pointwise Euclidean distance.
squared_euclidean
Animated explanation / 动图详解
distancenoO(n·d)noyesexactLow-priority addition-$d(x,y)=\sum_t \|x_t-y_t\|_2^2$Squared Euclidean loss.
rmse_distance
Animated explanation / 动图详解
distanceyes on a common fixed-dimensional domainO(n·d)noyesexactLow-priority addition-$d(x,y)=\sqrt{\frac{1}{nd}\sum_t \|x_t-y_t\|_2^2}$Root-mean-square error over aligned points: a positive constant times Euclidean distance when n and d are fixed.
manhattan
Animated explanation / 动图详解
distanceyesO(n·d)noyesexactLow-priority addition-$d(x,y)=\sum_t \|x_t-y_t\|_1$L1 distance.
mae_distance
Animated explanation / 动图详解
distanceyes on a common fixed-dimensional domainO(n·d)noyesexactLow-priority addition-$d(x,y)=\frac{1}{nd}\sum_t \|x_t-y_t\|_1$Mean absolute error: a positive constant times L1 distance when n and d are fixed.
minkowski
Animated explanation / 动图详解
distanceyes (p≥1)O(n·d)noyesexactLow-priority addition-$d_p(x,y)=\left(\sum_t \|x_t-y_t\|_p^p\right)^{1/p}$Generalized Lp distance.
chebyshev
Animated explanation / 动图详解
distanceyesO(n·d)noyesexactLow-priority addition-$d(x,y)=\max_t \|x_t-y_t\|_{\infty}$Maximum deviation distance.
canberra
Animated explanation / 动图详解
distanceyesO(n·d)noyesexactLow-priority addition-$d(x,y)=\sum_i \frac{|x_i-y_i|}{|x_i|+|y_i|}$Relative L1 distance sensitive near zero.
bray_curtis
Animated explanation / 动图详解
distance-likenoO(n·d)noyesexactLow-priority addition-$d(x,y)=\frac{\sum_i |x_i-y_i|}{\sum_i |x_i+y_i|}$Bray-Curtis dissimilarity.
sorensen
Animated explanation / 动图详解
distance-likenoO(n·d)noyesexactLow-priority addition-$d(x,y)=\frac{\sum_i |x_i-y_i|}{\sum_i (|x_i|+|y_i|)}$Sorensen dissimilarity.
soergel
Animated explanation / 动图详解
distance-likenoO(n·d)noyesexactLow-priority addition-$d(x,y)=\frac{\sum_i |x_i-y_i|}{\sum_i \max(|x_i|,|y_i|)}$Relative distance normalized by max magnitudes.
kulczynski
Animated explanation / 动图详解
distance-likenoO(n·d)noyesexactLow-priority addition-$d(x,y)=\frac{\sum_i |x_i-y_i|}{\sum_i \min(|x_i|,|y_i|)}$Kulczynski-style relative dissimilarity.
clark
Animated explanation / 动图详解
distance-likenoO(n·d)noyesexactLow-priority addition-$d(x,y)=\sqrt{\sum_i\left(\frac{|x_i-y_i|}{|x_i|+|y_i|}\right)^2}$Clark distance.
wave_hedges
Animated explanation / 动图详解
distance-likenoO(n·d)noyesexactLow-priority addition-$d(x,y)=\sum_i \frac{|x_i-y_i|}{\max(|x_i|,|y_i|)}$Wave-Hedges distance.
lorentzian
Animated explanation / 动图详解
distance-likenot guaranteedO(n·d)noyesreferenceLow-priority addition-$d(x,y)=\sum_i \log(1+|x_i-y_i|)$Log-compressed deviation.
cosine_similarity
Animated explanation / 动图详解
similaritynoO(n·d)noyesexactLow-priority addition-$s(x,y)=\frac{\langle x,y\rangle}{\|x\|\|y\|}$Directional similarity.
cosine_distance
Animated explanation / 动图详解
distance-likenoO(n·d)noyesexactLow-priority addition-$d(x,y)=1-s_{\cos}(x,y)$Monotone transform of cosine similarity.
angular_distance
Animated explanation / 动图详解
distanceyes on normalized vectorsO(n·d)noyesexactLow-priority addition-$d(x,y)=\arccos(s_{\cos}(x,y))/\pi$Angle-based distance.
pearson_similarity
Animated explanation / 动图详解
similaritynoO(n·d)noyesexactConceptually coveredpearson_r$r(x,y)=\frac{\sum_i(x_i-\bar x)(y_i-\bar y)}{\sqrt{\sum_i(x_i-\bar x)^2}\sqrt{\sum_i(y_i-\bar y)^2}}$Linear correlation.
pearson_distance
Animated explanation / 动图详解
distance-likenoO(n·d)noyesexactConceptually coveredpearson_r$d(x,y)=1-r(x,y)$Correlation distance.
spearman_similarity
Animated explanation / 动图详解
similaritynoO(n \log n)noyesreferenceConceptually coveredspearman_rho$s(x,y)=r(\mathrm{rank}(x),\mathrm{rank}(y))$Rank correlation similarity.
spearman_distance
Animated explanation / 动图详解
distance-likenoO(n \log n)noyesreferenceConceptually coveredspearman_rho$d(x,y)=1-\rho(x,y)$Distance-like rank dissimilarity.
kendall_similarity
Animated explanation / 动图详解
similaritynoO(n^2)noyesreferenceConceptually coveredkendall_tau$s(x,y)=\tau_b(x,y)$Kendall tau-b rank agreement.
kendall_distance
Animated explanation / 动图详解
distance-likenoO(n^2)noyesreferenceConceptually coveredkendall_tau$d(x,y)=1-\tau_b(x,y)$Distance-like form of Kendall agreement.
jensen_shannon
Animated explanation / 动图详解
distanceyes on probability distributionsO(n)noyesexactConceptually coveredspectral_similarity$d(x,y)=\sqrt{\frac{1}{2}KL(x\|m)+\frac{1}{2}KL(y\|m)}$Square root of Jensen-Shannon divergence, defined on probability distributions over a common support.
kl_divergence
Animated explanation / 动图详解
divergencenoO(n)noyesexactLow-priority addition-$D_{KL}(x\|y)=\sum_i p_i\log\frac{p_i}{q_i}$Asymmetric divergence.
jeffreys_divergence
Animated explanation / 动图详解
divergencenoO(n)noyesexactLow-priority addition-$J(x,y)=KL(x\|y)+KL(y\|x)$Symmetrized KL divergence.
bhattacharyya_distance
Animated explanation / 动图详解
distance-likenoO(n)noyesexactLow-priority addition-$d(x,y)=-\log\sum_i \sqrt{p_i q_i}$Distribution overlap distance.
hellinger_distance
Animated explanation / 动图详解
distanceyesO(n)noyesexactLow-priority addition-$d(x,y)=\sqrt{\frac{1}{2}\sum_i(\sqrt{p_i}-\sqrt{q_i})^2}$Probability-distribution distance.
chi_square_distance
Animated explanation / 动图详解
distance-likenoO(n)noyesexactLow-priority addition-$d(x,y)=\frac{1}{2}\sum_i\frac{(x_i-y_i)^2}{x_i+y_i}$Chi-square distance for histograms.
seuclidean_distance
Animated explanation / 动图详解
distanceyesO(n)noyesreferenceLow-priority addition-$d(x,y)=\sqrt{\sum_i \frac{(x_i-y_i)^2}{v_i}}$Variance-standardized Euclidean distance.
znorm_euclidean
Animated explanation / 动图详解
distanceyes in normalized space; pseudometric on original seriesO(n·d)noyesexactLow-priority addition-$d(x,y)=\|\hat x-\hat y\|_2$Euclidean after per-channel z-normalization. Positive rescaling and offset can map distinct series to the same representation; constant channels need a declared convention.
znorm_manhattan
Animated explanation / 动图详解
distanceyes in normalized space; pseudometric on original seriesO(n·d)noyesexactLow-priority addition-$d(x,y)=\|\hat x-\hat y\|_1$L1 after per-channel z-normalization. Positive rescaling and offset can map distinct series to the same representation; constant channels need a declared convention.
cid_distance
Animated explanation / 动图详解
distance-likenoO(n·d)noyesreferenceLow-priority addition-$CID(x,y)=ED(x,y)\cdot \frac{\max(CE(x),CE(y))}{\min(CE(x),CE(y))}$Complexity-invariant distance.
sliding

Shift-aware comparison under pure translation or lead-lag offsets.

MethodOutputMetricComplexityUnequal lengthMultivariateImplementationEchoTime fitEchoTime APIFormulaNote
max_normalized_cross_correlation
Animated explanation / 动图详解
similaritynoO(n \log n) or O(n^2)yesyesexactImplemented in EchoTimemax_ncc$s(x,y)=\max_k NCC_k(x,y)$Maximum normalized cross-correlation over shifts.
sbd
Animated explanation / 动图详解
distance-likenoO(n \log n) or O(n^2)yesyesexactImplemented in EchoTimesbd$d(x,y)=1-\max_k NCC_k(x,y)$Shape-based distance.
shift_euclidean_distance
Animated explanation / 动图详解
distance-likenoO(n^2·d)yesyesreferencePossible addition-$d(x,y)=\min_k \|x_{\Omega_k}-y_{\Omega_k}\|_2$Best-overlap Euclidean distance over integer shifts.
shift_rmse_distance
Animated explanation / 动图详解
distance-likenoO(n^2·d)yesyesreferencePossible addition-$d(x,y)=\min_k \sqrt{\frac{1}{|\Omega_k|}\sum_{t\in\Omega_k}(x_t-y_{t-k})^2}$Best-overlap RMSE.
shift_manhattan_distance
Animated explanation / 动图详解
distance-likenoO(n^2·d)yesyesreferencePossible addition-$d(x,y)=\min_k \|x_{\Omega_k}-y_{\Omega_k}\|_1$Best-overlap L1 distance.
shift_mae_distance
Animated explanation / 动图详解
distance-likenoO(n^2·d)yesyesreferencePossible addition-$d(x,y)=\min_k \frac{1}{|\Omega_k|}\|x_{\Omega_k}-y_{\Omega_k}\|_1$Best-overlap MAE.
shift_cosine_similarity
Animated explanation / 动图详解
similaritynoO(n^2·d)yesyesreferencePossible addition-$s(x,y)=\max_k s_{\cos}(x_{\Omega_k},y_{\Omega_k})$Best-overlap cosine similarity.
shift_cosine_distance
Animated explanation / 动图详解
distance-likenoO(n^2·d)yesyesreferencePossible addition-$d(x,y)=1-\max_k s_{\cos}(x_{\Omega_k},y_{\Omega_k})$Distance-like shift-invariant cosine measure.
shift_pearson_similarity
Animated explanation / 动图详解
similaritynoO(n^2·d)yesyesreferenceConceptually coveredbest_lag_pearson_r$s(x,y)=\max_k r(x_{\Omega_k},y_{\Omega_k})$Best-overlap Pearson correlation.
shift_pearson_distance
Animated explanation / 动图详解
distance-likenoO(n^2·d)yesyesreferenceConceptually coveredbest_lag_pearson_r$d(x,y)=1-\max_k r(x_{\Omega_k},y_{\Omega_k})$Distance-like shift-invariant correlation measure.
independent_sbd
Animated explanation / 动图详解
distance-likenoO(dn\log n)yesmultivariate onlyexactImplemented in EchoTimeindependent_sbd$d(X,Y)=\frac{1}{d}\sum_c SBD(X^{(c)},Y^{(c)})$Channel-independent SBD.
independent_max_ncc
Animated explanation / 动图详解
similaritynoO(dn\log n)yesmultivariate onlyexactImplemented in EchoTimeindependent_max_ncc$s(X,Y)=\frac{1}{d}\sum_c \max_k NCC_k(X^{(c)},Y^{(c)})$Channel-independent maximum NCC.
elastic

Dynamic-programming alignments that allow local stretching or compression.

MethodOutputMetricComplexityUnequal lengthMultivariateImplementationEchoTime fitEchoTime APIFormulaNote
dtw
Animated explanation / 动图详解
distancenoO(nm)yesyesexactConceptually covereddtw_similarity$DTW(x,y)=\min_{\pi}\sqrt{\sum_{(i,j)\in\pi} \|x_i-y_j\|_2^2}$Dynamic Time Warping.
cdtw
Animated explanation / 动图详解
distancenoO(nw)yesyesexactConceptually covereddtw_similarity$DTW_w(x,y)$ with Sakoe-Chiba windowConstrained DTW.
itakura_dtw
Animated explanation / 动图详解
distancenoO(nm)yesyesreferencePossible addition-$DTW_{\mathrm{Itakura}}(x,y)$DTW under Itakura parallelogram constraint.
wdtw
Animated explanation / 动图详解
distancenoO(nm)yesyesexactPossible addition-$WDTW(x,y)=\min_{\pi}\sqrt{\sum_{(i,j)\in\pi} w_{|i-j|}\|x_i-y_j\|_2^2}$Weighted DTW.
ddtw
Animated explanation / 动图详解
distancenoO(nm)yesyesexactConceptually covereddtw_similarity$DTW(\Delta x,\Delta y)$Derivative DTW.
wddtw
Animated explanation / 动图详解
distancenoO(nm)yesyesexactPossible addition-$WDTW(\Delta x,\Delta y)$Weighted derivative DTW.
soft_dtw
Animated explanation / 动图详解
distance-likenoO(nm)yesyesexactPossible addition-$sDTW_{\gamma}(x,y)$Soft minimum relaxation of DTW.
soft_dtw_divergence
Animated explanation / 动图详解
distance-likenoO(nm)yesyesexactPossible addition-$D^{\gamma}(x,y)=sDTW(x,y)-\frac{1}{2}sDTW(x,x)-\frac{1}{2}sDTW(y,y)$Soft-DTW divergence.
lcss_similarity
Animated explanation / 动图详解
similaritynoO(nm)yesyesexactImplemented in EchoTimelcss_similarity$s(x,y)=LCSS_{\epsilon}(x,y)/\min(n,m)$Longest Common Subsequence similarity.
lcss_distance
Animated explanation / 动图详解
distance-likenoO(nm)yesyesexactImplemented in EchoTimelcss_distance$d(x,y)=1-s_{LCSS}(x,y)$Distance-like LCSS form.
edr
Animated explanation / 动图详解
distancenoO(nm)yesyesexactImplemented in EchoTimeedr_distance$EDR_{\epsilon}(x,y)$Edit distance on real sequence.
swale_similarity
Animated explanation / 动图详解
similaritynoO(nm)yesyesreferencePossible addition-$SWALE_{\epsilon}(x,y)$Similarity with reward and penalty.
erp
Animated explanation / 动图详解
distancerequires a gap-domain conventionO(nm)yesyesexactImplemented in EchoTimeerp_distance$ERP(x,y;g)$Edit distance with real penalty. If gap values are valid observations, distinct raw sequences can have zero distance: with g=0, [1] and [0,1] do. State the sequence equivalence/domain before claiming a metric.
msm
Animated explanation / 动图详解
distanceyesO(nm)yesunivariate onlyexactPossible addition-$MSM(x,y)$Move-Split-Merge distance.
twed
Animated explanation / 动图详解
distanceunder the original assumptions with nu > 0O(nm)yesyesexactImplemented in EchoTimetwed_distance$TWED_{\lambda,\nu}(x,y)$Time Warp Edit distance. The metric result requires positive stiffness and the original timestamp/cost/boundary conventions; fast resampling and window constraints do not inherit that guarantee.
discrete_frechet
Animated explanation / 动图详解
distancepseudometric on raw vertex sequencesO(nm)yesyesreferencePossible addition-$\delta_F(x,y)$Discrete Frechet distance can identify different vertex lists obtained by repeating vertices. A metric claim needs an appropriate equivalence/domain convention.
needleman_wunsch_similarity
Animated explanation / 动图详解
similaritynoO(nm)yesyesreferencePossible addition-$NW(x,y)$Global alignment score.
smith_waterman_similarity
Animated explanation / 动图详解
similaritynoO(nm)yesyesreferencePossible addition-$SW(x,y)$Local alignment score.
shape_dtw
Animated explanation / 动图详解
distancenoO(nmr)yesyesreferencePossible addition-$DTW(\phi_{\mathrm{shape}}(x),\phi_{\mathrm{shape}}(y))$DTW on local shape descriptors.
independent_dtw
Animated explanation / 动图详解
distancenoO(dnm)yesmultivariate onlyexactPossible addition-$d(X,Y)=\frac{1}{d}\sum_c DTW(X^{(c)},Y^{(c)})$Channel-independent DTW average.
independent_cdtw
Animated explanation / 动图详解
distancenoO(dnw)yesmultivariate onlyexactPossible addition-$d(X,Y)=\frac{1}{d}\sum_c cDTW(X^{(c)},Y^{(c)})$Channel-independent constrained DTW.
independent_wdtw
Animated explanation / 动图详解
distancenoO(dnm)yesmultivariate onlyexactPossible addition-$d(X,Y)=\frac{1}{d}\sum_c WDTW(X^{(c)},Y^{(c)})$Channel-independent weighted DTW.
independent_ddtw
Animated explanation / 动图详解
distancenoO(dnm)yesmultivariate onlyexactPossible addition-$d(X,Y)=\frac{1}{d}\sum_c DDTW(X^{(c)},Y^{(c)})$Channel-independent derivative DTW.
independent_erp
Animated explanation / 动图详解
distancerequires a gap-domain conventionO(dnm)yesmultivariate onlyexactPossible addition-$d(X,Y)=\frac{1}{d}\sum_c ERP(X^{(c)},Y^{(c)})$Channel-independent ERP average; inherits the gap-domain qualifications of ERP.
kernel

Similarity through kernel scores rather than direct distances.

MethodOutputMetricComplexityUnequal lengthMultivariateImplementationEchoTime fitEchoTime APIFormulaNote
linear_kernel
Animated explanation / 动图详解
similarityPSD if input space validO(n·d)noyesexactLow-priority addition-$K(x,y)=\langle x,y \rangle$Linear kernel on flattened vectors.
polynomial_kernel
Animated explanation / 动图详解
similaritydepends on parametersO(n·d)noyesexactLow-priority addition-$K(x,y)=(\gamma \langle x,y \rangle + c)^p$Polynomial kernel.
sigmoid_kernel
Animated explanation / 动图详解
similaritynot always PSDO(n·d)noyesexactLow-priority addition-$K(x,y)=\tanh(\gamma \langle x,y \rangle + c)$Sigmoid kernel.
rbf_kernel
Animated explanation / 动图详解
similarityyesO(n·d)noyesexactLow-priority addition-$K(x,y)=\exp(-\gamma \|x-y\|_2^2)$Gaussian kernel over aligned vectors.
dtw_rbf_kernel
Animated explanation / 动图详解
similaritynot guaranteedO(nm)yesyesreferenceLow-priority addition-$K(x,y)=\exp(-\gamma DTW(x,y)^2)$RBF on DTW distance.
sbd_kernel
Animated explanation / 动图详解
similaritynot guaranteedO(n \log n) or O(n^2)yesyesreferenceLow-priority addition-$K(x,y)=\exp(-\gamma SBD(x,y))$RBF-like kernel on SBD.
soft_dtw_kernel
Animated explanation / 动图详解
similaritynot guaranteedO(nm)yesyesreferenceLow-priority addition-$K(x,y)=\exp(-D^\gamma(x,y)/\gamma)$Kernelized soft-DTW divergence.
gak
Animated explanation / 动图详解
similarityyes after normalization in practiceO(nm)yesyesexactLow-priority addition-$K_G(x,y)=\sum_{\pi} \prod_{(i,j)\in\pi} k(x_i,y_j)$Global Alignment Kernel.
lgak
Animated explanation / 动图详解
similaritynot a metricO(nm)yesyesexactLow-priority addition-$\log(K_G(x,y)+\epsilon)$Log-transformed GAK.
weighted_ncc_kernel
Animated explanation / 动图详解
similaritynot guaranteedO(n \log n) or O(n^2)yesyesreferenceLow-priority addition-$K(x,y)=\sum_k w_k \cdot NCC_k(x,y)$Shift-aware weighted cross-correlation kernel.
feature-based

Compare derived features instead of raw waveforms.

MethodOutputMetricComplexityUnequal lengthMultivariateImplementationEchoTime fitEchoTime APIFormulaNote
stats_distance
Animated explanation / 动图详解
distanceyes in feature spaceO(n·d)yesyesexactPossible addition-$d(x,y)=\|\phi_{\mathrm{stats}}(x)-\phi_{\mathrm{stats}}(y)\|_2$Distance on basic summary statistics.
robust_stats_distance
Animated explanation / 动图详解
distanceyes in feature spaceO(n·d)yesyesexactPossible addition-$d(x,y)=\|\phi_{\mathrm{robust}}(x)-\phi_{\mathrm{robust}}(y)\|_2$Distance on robust statistics.
acf_distance
Animated explanation / 动图详解
distanceyes in feature spaceO(nL)yesunivariate onlyexactImplemented in EchoTimeacf_distance$d(x,y)=\|ACF(x)-ACF(y)\|_2$Autocorrelation-feature distance.
spectral_cosine_similarity
Animated explanation / 动图详解
similaritynoO(n \log n)yesyesexactConceptually coveredspectral_similarity$s(x,y)=s_{\cos}(|FFT(x)|,|FFT(y)|)$Cosine similarity in the magnitude spectrum.
spectral_distance
Animated explanation / 动图详解
distance-likenoO(n \log n)yesyesexactPossible addition-$d(x,y)=1-s_{\cos}(|FFT(x)|,|FFT(y)|)$Distance-like spectral measure.
periodogram_distance
Animated explanation / 动图详解
distanceyes in feature spaceO(n \log n)yesyesexactImplemented in EchoTimeperiodogram_distance$d(x,y)=\|P_x-P_y\|_2$Distance between normalized periodograms.
paa_distance
Animated explanation / 动图详解
distanceyes in feature spaceO(n·d)yesyesexactPossible addition-$d(x,y)=\|PAA(x)-PAA(y)\|_2$Piecewise Aggregate Approximation distance.
dwt_distance
Animated explanation / 动图详解
distanceyes in feature spaceO(n·d)yesyesreferencePossible addition-$d(x,y)=\|W(x)-W(y)\|_2$Distance on Haar wavelet coefficients.
histogram_distance
Animated explanation / 动图详解
distanceyes in feature spaceO(n·d)yesyesexactPossible addition-$d(x,y)=\|h(x)-h(y)\|_2$Value-histogram distance.
permutation_entropy_distance
Animated explanation / 动图详解
distance-likenoO(n)yesunivariate onlyexactPossible addition-$d(x,y)=|H_{\pi}(x)-H_{\pi}(y)|$Absolute difference in permutation entropy.
ordinal_pattern_js_distance
Animated explanation / 动图详解
distanceyes on pattern distributions; pseudometric on seriesO(n)yesunivariate onlyexactImplemented in EchoTimeordinal_pattern_js_distance$d(x,y)=\sqrt{JSD(\Pi(x),\Pi(y))}$Square root of Jensen-Shannon divergence between ordinal-pattern distributions; distinct series can have identical pattern distributions.
trend_distance
Animated explanation / 动图详解
distanceyes in feature spaceO(n·d)yesyesexactImplemented in EchoTimetrend_distance$d(x,y)=\|\phi_{\mathrm{trend}}(x)-\phi_{\mathrm{trend}}(y)\|_2$Distance on trend/intercept/residual features.
sax_hamming_distance
Animated explanation / 动图详解
distanceyes on symbolic stringsO(n)yesunivariate onlyexactPossible addition-$d(x,y)=\frac{1}{w}\sum_{i=1}^w [SAX_i(x)\neq SAX_i(y)]$Hamming distance on SAX words.
sax_mindist
Animated explanation / 动图详解
distanceno; lower bound under SAX assumptionsO(w)yesunivariate onlyexactPossible addition-$MINDIST(\hat x,\hat y)=\sqrt{\frac{n}{w}}\sqrt{\sum_i dist(\hat x_i,\hat y_i)^2}$Lower-bounding symbolic dissimilarity under SAX normalization and aggregation assumptions. Adjacent symbols can have zero distance; lower-bounding does not imply metric properties.
bag_of_patterns_cosine_similarity
Animated explanation / 动图详解
similaritynoO(nw)yesunivariate onlyreferencePossible addition-$s(x,y)=s_{\cos}(BoP(x),BoP(y))$Cosine similarity on bag-of-patterns histograms.
bag_of_patterns_distance
Animated explanation / 动图详解
distance-likenoO(nw)yesunivariate onlyreferencePossible addition-$d(x,y)=1-s_{\cos}(BoP(x),BoP(y))$Distance-like bag-of-patterns measure.
independent_stats_distance
Animated explanation / 动图详解
distanceyes in feature spaceO(dn)yesmultivariate onlyexactPossible addition-$d(X,Y)=\frac{1}{d}\sum_c \|\phi(X^{(c)})-\phi(Y^{(c)})\|_2$Channel-independent stats distance.
independent_paa_distance
Animated explanation / 动图详解
distanceyes in feature spaceO(dn)yesmultivariate onlyexactPossible addition-$d(X,Y)=\frac{1}{d}\sum_c \|PAA(X^{(c)})-PAA(Y^{(c)})\|_2$Channel-independent PAA distance.
model-based

Compare fitted dynamics or transition structure.

MethodOutputMetricComplexityUnequal lengthMultivariateImplementationEchoTime fitEchoTime APIFormulaNote
ar_distance
Animated explanation / 动图详解
distanceyes in parameter spaceO(np^2)yesunivariate onlyexactPossible addition-$d(x,y)=\|\theta_{AR}(x)-\theta_{AR}(y)\|_2$Distance between autoregressive coefficients.
ar_spectrum_distance
Animated explanation / 动图详解
distanceyes in spectral spaceO(np^2 + Fp)yesunivariate onlyreferencePossible addition-$d(x,y)=\|\log S_{AR}(x)-\log S_{AR}(y)\|_2$Distance between AR-implied log spectra.
ar_prediction_error_distance
Animated explanation / 动图详解
distance-likenoO(np^2)yesunivariate onlyreferencePossible addition-$d(x,y)=\frac{1}{2}(MSE_{x\to y}+MSE_{y\to x})$Symmetric cross-prediction error.
markov_distance
Animated explanation / 动图详解
distanceyes in transition spaceO(n)yesunivariate onlyexactPossible addition-$d(x,y)=\|P_x-P_y\|_F$Distance between discretized transition matrices.
linear_trend_model_distance
Animated explanation / 动图详解
distanceyes in parameter spaceO(n)yesunivariate onlyexactImplemented in EchoTimelinear_trend_model_distance$d(x,y)=\|\theta_{\mathrm{trend}}(x)-\theta_{\mathrm{trend}}(y)\|_2$Distance between linear trend models.
embedding

Encode first, then compare in a latent or compressed space.

MethodOutputMetricComplexityUnequal lengthMultivariateImplementationEchoTime fitEchoTime APIFormulaNote
embedding_distance
Animated explanation / 动图详解
distancedepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$d(x,y)=d_{\mathcal Z}(\phi(x),\phi(y))$Generic embedding-space distance.
embedding_similarity
Animated explanation / 动图详解
similaritydepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$s(x,y)=s_{\mathcal Z}(\phi(x),\phi(y))$Generic embedding-space similarity.
paa_embedding_distance
Animated explanation / 动图详解
distancedepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$d(x,y)=\|\phi(x)-\phi(y)\|_2$Euclidean distance using the PAA encoder.
paa_embedding_similarity
Animated explanation / 动图详解
similaritydepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$s(x,y)=s_{\cos}(\phi(x),\phi(y))$Cosine similarity using the PAA encoder.
dft_embedding_distance
Animated explanation / 动图详解
distancedepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$d(x,y)=\|\phi(x)-\phi(y)\|_2$Euclidean distance using the DFT-magnitude encoder.
dft_embedding_similarity
Animated explanation / 动图详解
similaritydepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$s(x,y)=s_{\cos}(\phi(x),\phi(y))$Cosine similarity using the DFT-magnitude encoder.
stats_embedding_distance
Animated explanation / 动图详解
distancedepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$d(x,y)=\|\phi(x)-\phi(y)\|_2$Euclidean distance using the basic-statistics encoder.
stats_embedding_similarity
Animated explanation / 动图详解
similaritydepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$s(x,y)=s_{\cos}(\phi(x),\phi(y))$Cosine similarity using the basic-statistics encoder.
robust_stats_embedding_distance
Animated explanation / 动图详解
distancedepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$d(x,y)=\|\phi(x)-\phi(y)\|_2$Euclidean distance using the robust-statistics encoder.
robust_stats_embedding_similarity
Animated explanation / 动图详解
similaritydepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$s(x,y)=s_{\cos}(\phi(x),\phi(y))$Cosine similarity using the robust-statistics encoder.
acf_embedding_distance
Animated explanation / 动图详解
distancedepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$d(x,y)=\|\phi(x)-\phi(y)\|_2$Euclidean distance using the ACF encoder.
acf_embedding_similarity
Animated explanation / 动图详解
similaritydepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$s(x,y)=s_{\cos}(\phi(x),\phi(y))$Cosine similarity using the ACF encoder.
wavelet_embedding_distance
Animated explanation / 动图详解
distancedepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$d(x,y)=\|\phi(x)-\phi(y)\|_2$Euclidean distance using the wavelet encoder.
wavelet_embedding_similarity
Animated explanation / 动图详解
similaritydepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$s(x,y)=s_{\cos}(\phi(x),\phi(y))$Cosine similarity using the wavelet encoder.
histogram_embedding_distance
Animated explanation / 动图详解
distancedepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$d(x,y)=\|\phi(x)-\phi(y)\|_2$Euclidean distance using the histogram encoder.
histogram_embedding_similarity
Animated explanation / 动图详解
similaritydepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$s(x,y)=s_{\cos}(\phi(x),\phi(y))$Cosine similarity using the histogram encoder.
periodogram_embedding_distance
Animated explanation / 动图详解
distancedepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$d(x,y)=\|\phi(x)-\phi(y)\|_2$Euclidean distance using the periodogram encoder.
periodogram_embedding_similarity
Animated explanation / 动图详解
similaritydepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$s(x,y)=s_{\cos}(\phi(x),\phi(y))$Cosine similarity using the periodogram encoder.
trend_embedding_distance
Animated explanation / 动图详解
distancedepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$d(x,y)=\|\phi(x)-\phi(y)\|_2$Euclidean distance using the trend-feature encoder.
trend_embedding_similarity
Animated explanation / 动图详解
similaritydepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$s(x,y)=s_{\cos}(\phi(x),\phi(y))$Cosine similarity using the trend-feature encoder.
random_projection_embedding_distance
Animated explanation / 动图详解
distancedepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$d(x,y)=\|\phi(x)-\phi(y)\|_2$Euclidean distance using the random projection encoder.
random_projection_embedding_similarity
Animated explanation / 动图详解
similaritydepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$s(x,y)=s_{\cos}(\phi(x),\phi(y))$Cosine similarity using the random projection encoder.
identity_embedding_distance
Animated explanation / 动图详解
distancedepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$d(x,y)=\|\phi(x)-\phi(y)\|_2$Euclidean distance using the identity-resample encoder.
identity_embedding_similarity
Animated explanation / 动图详解
similaritydepends on latent metricdepends on encoderyesyesadapterLow-priority addition-$s(x,y)=s_{\cos}(\phi(x),\phi(y))$Cosine similarity using the identity-resample encoder.