{"id":"squared_euclidean","title":"Squared Euclidean","family":"lock-step","definition":"reference","intro_en":"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.","intro_zh":"平方欧氏距离直接累加平方残差，不再开平方。因此各坐标贡献可相加，大误差受到更强惩罚。在同一组向量上，它与欧氏距离给出相同的近邻排序，但结果单位为幅值平方，也不满足一般的三角不等式。","steps_en":["Keep the two series on the same sample grid; no shift or warping is estimated.","Square each residual; the highlighted point supplies one coordinate contribution.","Accumulate the coordinate contributions in sample order.","Keep the squared sum; do not take a square root."],"steps_zh":["在同一采样网格上比较两条序列，不估计平移或时间规整。","计算各坐标残差的平方。","按采样顺序累积局部贡献。","直接保留平方差总和，不开平方。"],"formula":"sum_i (x_i-y_i)^2","caveats_en":["Squaring a metric does not generally preserve the triangle inequality.","Sample alignment and amplitude units are part of the comparison protocol."],"caveats_zh":["对度量取平方通常不保留三角不等式。","采样对齐和幅值单位属于比较协议的一部分。"],"sources":[{"label":"SciPy: sqeuclidean","url":"https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.sqeuclidean.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":2.7600000000000007,"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 each residual","panel":{"kind":"bars","title":"Square each residual","a":[0.09000000000000002,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.09000000000000002,"value_label":"coordinate term","input_highlight":[0]},{"phase":1,"caption":"Compute coordinate 4: Square each residual","panel":{"kind":"bars","title":"Square each residual","a":[0.09000000000000002,0.09000000000000002,0.15999999999999992,0.25,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":3},"value":0.25,"value_label":"coordinate term","input_highlight":[3]},{"phase":1,"caption":"Compute coordinate 8: Square each residual","panel":{"kind":"bars","title":"Square each residual","a":[0.09000000000000002,0.09000000000000002,0.15999999999999992,0.25,0.49000000000000027,0.36000000000000065,0.0899999999999999,0.25,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":7},"value":0.25,"value_label":"coordinate term","input_highlight":[7]},{"phase":1,"caption":"Compute coordinate 12: Square each residual","panel":{"kind":"bars","title":"Square each residual","a":[0.09000000000000002,0.09000000000000002,0.15999999999999992,0.25,0.49000000000000027,0.36000000000000065,0.0899999999999999,0.25,0.0399999999999999,0.4899999999999996,0.09000000000000043,0.3600000000000001],"a_label":"contribution","marker":11},"value":0.3600000000000001,"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.09000000000000002,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.09000000000000002,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 2 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.09000000000000002,0.09000000000000002,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.18000000000000005,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 4 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.09000000000000002,0.09000000000000002,0.15999999999999992,0.25,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":3},"value":0.59,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 5 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.09000000000000002,0.09000000000000002,0.15999999999999992,0.25,0.49000000000000027,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":4},"value":1.0800000000000003,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 7 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.09000000000000002,0.09000000000000002,0.15999999999999992,0.25,0.49000000000000027,0.36000000000000065,0.0899999999999999,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":6},"value":1.5300000000000007,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 8 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.09000000000000002,0.09000000000000002,0.15999999999999992,0.25,0.49000000000000027,0.36000000000000065,0.0899999999999999,0.25,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":7},"value":1.7800000000000007,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 10 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.09000000000000002,0.09000000000000002,0.15999999999999992,0.25,0.49000000000000027,0.36000000000000065,0.0899999999999999,0.25,0.0399999999999999,0.4899999999999996,0.0,0.0],"a_label":"contribution","marker":9},"value":2.31,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 12 of 12 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[0.09000000000000002,0.09000000000000002,0.15999999999999992,0.25,0.49000000000000027,0.36000000000000065,0.0899999999999999,0.25,0.0399999999999999,0.4899999999999996,0.09000000000000043,0.3600000000000001],"a_label":"contribution","marker":11},"value":2.7600000000000007,"value_label":"running sum"},{"phase":3,"caption":"Keep the squared sum; do not take a square root","panel":{"kind":"bars","title":"Square each residual","a":[0.09000000000000002,0.09000000000000002,0.15999999999999992,0.25,0.49000000000000027,0.36000000000000065,0.0899999999999999,0.25,0.0399999999999999,0.4899999999999996,0.09000000000000043,0.3600000000000001],"a_label":"contribution","marker":0},"value":2.7600000000000007,"value_label":"final result"},{"phase":3,"caption":"Keep the squared sum; do not take a square root","panel":{"kind":"bars","title":"Square each residual","a":[0.09000000000000002,0.09000000000000002,0.15999999999999992,0.25,0.49000000000000027,0.36000000000000065,0.0899999999999999,0.25,0.0399999999999999,0.4899999999999996,0.09000000000000043,0.3600000000000001],"a_label":"contribution","marker":3},"value":2.7600000000000007,"value_label":"final result"},{"phase":3,"caption":"Keep the squared sum; do not take a square root","panel":{"kind":"bars","title":"Square each residual","a":[0.09000000000000002,0.09000000000000002,0.15999999999999992,0.25,0.49000000000000027,0.36000000000000065,0.0899999999999999,0.25,0.0399999999999999,0.4899999999999996,0.09000000000000043,0.3600000000000001],"a_label":"contribution","marker":7},"value":2.7600000000000007,"value_label":"final result"},{"phase":3,"caption":"Keep the squared sum; do not take a square root","panel":{"kind":"bars","title":"Square each residual","a":[0.09000000000000002,0.09000000000000002,0.15999999999999992,0.25,0.49000000000000027,0.36000000000000065,0.0899999999999999,0.25,0.0399999999999999,0.4899999999999996,0.09000000000000043,0.3600000000000001],"a_label":"contribution","marker":11},"value":2.7600000000000007,"value_label":"final result"}],"animation_steps_en":["Keep samples on the same time grid.","Square each residual.","Accumulate the coordinate contributions.","Keep the squared sum; do not take a square root."],"echotime_status":"Low-priority addition","echotime_api":""}
