{"id":"canberra","title":"Canberra distance","family":"lock-step","definition":"reference","intro_en":"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.","intro_zh":"Canberra 距离先用每个坐标两侧幅值之和归一化该点误差，再累加比值。相较未缩放的绝对误差，低幅值位置可能获得较大影响。本例使用正值，明确展示逐点分母并避免 0/0。","steps_en":["Keep the two series on the same sample grid; no shift or warping is estimated.","Divide each gap by local absolute magnitudes; the highlighted point supplies one coordinate contribution.","Accumulate the coordinate contributions in sample order.","Sum coordinate-wise relative errors."],"steps_zh":["在同一采样网格上比较两条序列，不估计平移或时间规整。","逐坐标以两侧绝对幅值之和归一化绝对差。","按采样顺序累积局部贡献。","累加所有逐坐标相对误差。"],"formula":"sum_i abs(x_i-y_i)/(abs(x_i)+abs(y_i))","caveats_en":["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."],"caveats_zh":["接近零的坐标可能影响很大；必须声明 0/0 的处理约定。","采样对齐和幅值单位属于比较协议的一部分。"],"sources":[{"label":"SciPy: canberra","url":"https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.canberra.html"}],"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.9768467657640826,"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: Divide each gap by local absolute magnitudes","panel":{"kind":"bars","title":"Divide each gap by local absolute magnitudes","a":[0.13043478260869568,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.13043478260869568,"value_label":"coordinate term","input_highlight":[0]},{"phase":1,"caption":"Compute coordinate 4: Divide each gap by local absolute magnitudes","panel":{"kind":"bars","title":"Divide each gap by local absolute magnitudes","a":[0.13043478260869568,0.09090909090909093,0.09090909090909088,0.07246376811594203,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":3},"value":0.07246376811594203,"value_label":"coordinate term","input_highlight":[3]},{"phase":1,"caption":"Compute coordinate 8: Divide each gap by local absolute magnitudes","panel":{"kind":"bars","title":"Divide each gap by local absolute magnitudes","a":[0.13043478260869568,0.09090909090909093,0.09090909090909088,0.07246376811594203,0.07216494845360827,0.07317073170731714,0.054545454545454515,0.13513513513513511,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":7},"value":0.13513513513513511,"value_label":"coordinate term","input_highlight":[7]},{"phase":1,"caption":"Compute coordinate 12: Divide each gap by local absolute magnitudes","panel":{"kind":"bars","title":"Divide each gap by local absolute magnitudes","a":[0.13043478260869568,0.09090909090909093,0.09090909090909088,0.07246376811594203,0.07216494845360827,0.07317073170731714,0.054545454545454515,0.13513513513513511,0.037037037037036986,0.10144927536231879,0.035294117647058906,0.08333333333333336],"a_label":"contribution","marker":11},"value":0.08333333333333336,"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.13043478260869568,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.13043478260869568,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 2 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.13043478260869568,0.09090909090909093,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.22134387351778662,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 4 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.13043478260869568,0.09090909090909093,0.09090909090909088,0.07246376811594203,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":3},"value":0.3847167325428195,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 5 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.13043478260869568,0.09090909090909093,0.09090909090909088,0.07246376811594203,0.07216494845360827,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":4},"value":0.4568816809964278,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 7 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.13043478260869568,0.09090909090909093,0.09090909090909088,0.07246376811594203,0.07216494845360827,0.07317073170731714,0.054545454545454515,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":6},"value":0.5845978672491995,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 8 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.13043478260869568,0.09090909090909093,0.09090909090909088,0.07246376811594203,0.07216494845360827,0.07317073170731714,0.054545454545454515,0.13513513513513511,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":7},"value":0.7197330023843345,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 10 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.13043478260869568,0.09090909090909093,0.09090909090909088,0.07246376811594203,0.07216494845360827,0.07317073170731714,0.054545454545454515,0.13513513513513511,0.037037037037036986,0.10144927536231879,0.0,0.0],"a_label":"contribution","marker":9},"value":0.8582193147836903,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 12 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.13043478260869568,0.09090909090909093,0.09090909090909088,0.07246376811594203,0.07216494845360827,0.07317073170731714,0.054545454545454515,0.13513513513513511,0.037037037037036986,0.10144927536231879,0.035294117647058906,0.08333333333333336],"a_label":"contribution","marker":11},"value":0.9768467657640826,"value_label":"running sum"},{"phase":3,"caption":"Sum coordinate-wise relative errors","panel":{"kind":"bars","title":"Divide each gap by local absolute magnitudes","a":[0.13043478260869568,0.09090909090909093,0.09090909090909088,0.07246376811594203,0.07216494845360827,0.07317073170731714,0.054545454545454515,0.13513513513513511,0.037037037037036986,0.10144927536231879,0.035294117647058906,0.08333333333333336],"a_label":"contribution","marker":0},"value":0.9768467657640826,"value_label":"final result"},{"phase":3,"caption":"Sum coordinate-wise relative errors","panel":{"kind":"bars","title":"Divide each gap by local absolute magnitudes","a":[0.13043478260869568,0.09090909090909093,0.09090909090909088,0.07246376811594203,0.07216494845360827,0.07317073170731714,0.054545454545454515,0.13513513513513511,0.037037037037036986,0.10144927536231879,0.035294117647058906,0.08333333333333336],"a_label":"contribution","marker":3},"value":0.9768467657640826,"value_label":"final result"},{"phase":3,"caption":"Sum coordinate-wise relative errors","panel":{"kind":"bars","title":"Divide each gap by local absolute magnitudes","a":[0.13043478260869568,0.09090909090909093,0.09090909090909088,0.07246376811594203,0.07216494845360827,0.07317073170731714,0.054545454545454515,0.13513513513513511,0.037037037037036986,0.10144927536231879,0.035294117647058906,0.08333333333333336],"a_label":"contribution","marker":7},"value":0.9768467657640826,"value_label":"final result"},{"phase":3,"caption":"Sum coordinate-wise relative errors","panel":{"kind":"bars","title":"Divide each gap by local absolute magnitudes","a":[0.13043478260869568,0.09090909090909093,0.09090909090909088,0.07246376811594203,0.07216494845360827,0.07317073170731714,0.054545454545454515,0.13513513513513511,0.037037037037036986,0.10144927536231879,0.035294117647058906,0.08333333333333336],"a_label":"contribution","marker":11},"value":0.9768467657640826,"value_label":"final result"}],"animation_steps_en":["Keep samples on the same time grid.","Divide each gap by local absolute magnitudes.","Accumulate the coordinate contributions.","Sum coordinate-wise relative errors."],"echotime_status":"Low-priority addition","echotime_api":""}
