{"id":"clark","title":"Clark distance","family":"lock-step","definition":"reference","intro_en":"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.","intro_zh":"Clark 距离先形成逐坐标相对误差，再对这些比值求欧氏范数。它与直接累加相对误差的 Canberra 不同。动图先计算局部比值，再平方聚合，展示相对差异较大的位置如何影响总体结果。","steps_en":["Keep the two series on the same sample grid; no shift or warping is estimated.","Square the coordinate-wise relative error; the highlighted point supplies one coordinate contribution.","Accumulate the coordinate contributions in sample order.","Take the root of the sum of squared relative errors."],"steps_zh":["在同一采样网格上比较两条序列，不估计平移或时间规整。","逐坐标计算相对绝对误差，再将比值平方。","按采样顺序累积局部贡献。","对相对误差平方和开平方。"],"formula":"sqrt(sum_i (abs(x_i-y_i)/(abs(x_i)+abs(y_i)))^2)","caveats_en":["The local zero-over-zero convention matters, especially for sparse signals.","Sample alignment and amplitude units are part of the comparison protocol."],"caveats_zh":["稀疏信号尤其需要明确局部 0/0 的处理约定。","采样对齐和幅值单位属于比较协议的一部分。"],"sources":[{"label":"Imported registry: explicit formula convention","url":"https://github.com/ZipengWu365/EchoTime/blob/main/src/echotime/data/ts_similarity_package_v2_registry.csv"}],"x":[1.0,1.5,2.4,3.7,4.5,3.8,2.6,2.1,2.8,3.8,4.1,3.3],"y":[1.3,1.8,2.0,3.2,5.2,4.4,2.9,1.6,2.6,3.1,4.4,3.9],"input_label":"Deterministic synthetic illustration; sample index is the time axis.","parameters":{"samples":12,"preprocessing":"none","domain":"strictly positive illustration"},"result":{"label":"distance","value":0.3007414499465984,"detail":"Exact formula evaluation on the displayed aligned vectors."},"frames":[{"phase":0,"caption":"Aligned samples","panel":{"kind":"lines","title":"Aligned samples","a":[1.0,1.5],"a_label":"x","b":[1.3,1.8],"b_label":"y","marker":1}},{"phase":0,"caption":"Aligned samples","panel":{"kind":"lines","title":"Aligned samples","a":[1.0,1.5,2.4,3.7,4.5],"a_label":"x","b":[1.3,1.8,2.0,3.2,5.2],"b_label":"y","marker":4}},{"phase":0,"caption":"Aligned samples","panel":{"kind":"lines","title":"Aligned samples","a":[1.0,1.5,2.4,3.7,4.5,3.8,2.6,2.1],"a_label":"x","b":[1.3,1.8,2.0,3.2,5.2,4.4,2.9,1.6],"b_label":"y","marker":7}},{"phase":0,"caption":"Aligned samples","panel":{"kind":"lines","title":"Aligned samples","a":[1.0,1.5,2.4,3.7,4.5,3.8,2.6,2.1,2.8,3.8,4.1,3.3],"a_label":"x","b":[1.3,1.8,2.0,3.2,5.2,4.4,2.9,1.6,2.6,3.1,4.4,3.9],"b_label":"y","marker":11}},{"phase":1,"caption":"Compute coordinate 1: Square the coordinate-wise relative error","panel":{"kind":"bars","title":"Square the coordinate-wise relative error","a":[0.0170132325141777,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":0},"value":0.0170132325141777,"value_label":"coordinate term","input_highlight":[0]},{"phase":1,"caption":"Compute coordinate 4: Square the coordinate-wise relative error","panel":{"kind":"bars","title":"Square the coordinate-wise relative error","a":[0.0170132325141777,0.008264462809917359,0.00826446280991735,0.005250997689561017,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":3},"value":0.005250997689561017,"value_label":"coordinate term","input_highlight":[3]},{"phase":1,"caption":"Compute coordinate 8: Square the coordinate-wise relative error","panel":{"kind":"bars","title":"Square the coordinate-wise relative error","a":[0.0170132325141777,0.008264462809917359,0.00826446280991735,0.005250997689561017,0.005207779785311939,0.0053539559785841856,0.0029752066115702447,0.01826150474799123,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":7},"value":0.01826150474799123,"value_label":"coordinate term","input_highlight":[7]},{"phase":1,"caption":"Compute coordinate 12: Square the coordinate-wise relative error","panel":{"kind":"bars","title":"Square the coordinate-wise relative error","a":[0.0170132325141777,0.008264462809917359,0.00826446280991735,0.005250997689561017,0.005207779785311939,0.0053539559785841856,0.0029752066115702447,0.01826150474799123,0.0013717421124828494,0.010291955471539582,0.0012456747404844348,0.006944444444444448],"a_label":"contribution","marker":11},"value":0.006944444444444448,"value_label":"coordinate term","input_highlight":[11]},{"phase":2,"caption":"Accumulate 1 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.0170132325141777,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":0},"value":0.0170132325141777,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 2 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.0170132325141777,0.008264462809917359,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":1},"value":0.02527769532409506,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 4 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.0170132325141777,0.008264462809917359,0.00826446280991735,0.005250997689561017,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":3},"value":0.03879315582357343,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 5 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.0170132325141777,0.008264462809917359,0.00826446280991735,0.005250997689561017,0.005207779785311939,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":4},"value":0.044000935608885364,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 7 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.0170132325141777,0.008264462809917359,0.00826446280991735,0.005250997689561017,0.005207779785311939,0.0053539559785841856,0.0029752066115702447,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":6},"value":0.0523300981990398,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 8 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.0170132325141777,0.008264462809917359,0.00826446280991735,0.005250997689561017,0.005207779785311939,0.0053539559785841856,0.0029752066115702447,0.01826150474799123,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":7},"value":0.07059160294703103,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 10 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.0170132325141777,0.008264462809917359,0.00826446280991735,0.005250997689561017,0.005207779785311939,0.0053539559785841856,0.0029752066115702447,0.01826150474799123,0.0013717421124828494,0.010291955471539582,0.0,0.0],"a_label":"contribution","marker":9},"value":0.08225530053105345,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 12 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.0170132325141777,0.008264462809917359,0.00826446280991735,0.005250997689561017,0.005207779785311939,0.0053539559785841856,0.0029752066115702447,0.01826150474799123,0.0013717421124828494,0.010291955471539582,0.0012456747404844348,0.006944444444444448],"a_label":"contribution","marker":11},"value":0.09044541971598234,"value_label":"running sum"},{"phase":3,"caption":"Take the root of the sum of squared relative errors","panel":{"kind":"bars","title":"Square the coordinate-wise relative error","a":[0.0170132325141777,0.008264462809917359,0.00826446280991735,0.005250997689561017,0.005207779785311939,0.0053539559785841856,0.0029752066115702447,0.01826150474799123,0.0013717421124828494,0.010291955471539582,0.0012456747404844348,0.006944444444444448],"a_label":"contribution","marker":0},"value":0.3007414499465984,"value_label":"final result"},{"phase":3,"caption":"Take the root of the sum of squared relative errors","panel":{"kind":"bars","title":"Square the coordinate-wise relative error","a":[0.0170132325141777,0.008264462809917359,0.00826446280991735,0.005250997689561017,0.005207779785311939,0.0053539559785841856,0.0029752066115702447,0.01826150474799123,0.0013717421124828494,0.010291955471539582,0.0012456747404844348,0.006944444444444448],"a_label":"contribution","marker":3},"value":0.3007414499465984,"value_label":"final result"},{"phase":3,"caption":"Take the root of the sum of squared relative errors","panel":{"kind":"bars","title":"Square the coordinate-wise relative error","a":[0.0170132325141777,0.008264462809917359,0.00826446280991735,0.005250997689561017,0.005207779785311939,0.0053539559785841856,0.0029752066115702447,0.01826150474799123,0.0013717421124828494,0.010291955471539582,0.0012456747404844348,0.006944444444444448],"a_label":"contribution","marker":7},"value":0.3007414499465984,"value_label":"final result"},{"phase":3,"caption":"Take the root of the sum of squared relative errors","panel":{"kind":"bars","title":"Square the coordinate-wise relative error","a":[0.0170132325141777,0.008264462809917359,0.00826446280991735,0.005250997689561017,0.005207779785311939,0.0053539559785841856,0.0029752066115702447,0.01826150474799123,0.0013717421124828494,0.010291955471539582,0.0012456747404844348,0.006944444444444448],"a_label":"contribution","marker":11},"value":0.3007414499465984,"value_label":"final result"}],"animation_steps_en":["Keep samples on the same time grid.","Square the coordinate-wise relative error.","Accumulate the coordinate contributions.","Take the root of the sum of squared relative errors."],"echotime_status":"Low-priority addition","echotime_api":""}
