{"id":"cid_distance","title":"Complexity-invariant distance","family":"lock-step","definition":"reference","intro_en":"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.","intro_zh":"CID 用较大与较小复杂度之比修正欧氏距离。本例复杂度定义为一阶差分向量的欧氏长度。动图依次计算基准差异、两侧复杂度及修正因子；名称并不意味着对所有改变复杂度的操作都严格不变。","steps_en":["Compute the ordinary Euclidean distance on aligned samples.","Form first differences and sum their squared values for each series.","Take both roots and divide the larger complexity by the smaller.","Multiply the baseline distance by this complexity ratio."],"steps_zh":["计算对齐样本的欧氏距离。","分别计算一阶差分及平方和。","分别开平方，用较大复杂度除以较小复杂度。","以复杂度比乘以基准距离。"],"formula":"CID=||x-y||_2 * max(CE(x),CE(y))/min(CE(x),CE(y)); CE(x)=||diff(x)||_2","caveats_en":["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."],"caveats_zh":["常量序列的复杂度为零，修正项需要明确的边界规则。","估计值依赖采样和噪声；此动图不提供准确率或普遍不变性结论。"],"sources":[{"label":"Batista, Wang and Keogh: original CID paper","url":"https://www.cs.ucr.edu/~eamonn/Complexity-Invariant%20Distance%20Measure.pdf"}],"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":{"base_distance":"Euclidean","complexity":"L2 norm of first differences","CE_x":2.791057147390572,"CE_y":3.6742346141747673},"result":{"label":"distance","value":2.1870197070381066,"detail":""},"frames":[{"phase":0,"caption":"Compute the aligned Euclidean baseline","panel":{"kind":"lines","title":"Aligned input prefixes","a":[1.0,1.5],"a_label":"x","b":[1.3,1.8],"b_label":"y"}},{"phase":0,"caption":"Compute the aligned Euclidean baseline","panel":{"kind":"lines","title":"Aligned input prefixes","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"}},{"phase":0,"caption":"Compute the aligned Euclidean baseline","panel":{"kind":"lines","title":"Aligned input prefixes","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"}},{"phase":0,"caption":"Compute the aligned Euclidean baseline","panel":{"kind":"lines","title":"Aligned input prefixes","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"}},{"phase":1,"caption":"Consecutive changes define the chosen complexity estimate","panel":{"kind":"bars","title":"Squared first differences","a":[0.25,0.8099999999999998],"a_label":"x","b":[0.25,0.03999999999999998],"b_label":"y"}},{"phase":1,"caption":"Consecutive changes define the chosen complexity estimate","panel":{"kind":"bars","title":"Squared first differences","a":[0.25,0.8099999999999998,1.6900000000000006,0.6399999999999997,0.49000000000000027],"a_label":"x","b":[0.25,0.03999999999999998,1.4400000000000004,4.0,0.6399999999999997],"b_label":"y"}},{"phase":1,"caption":"Consecutive changes define the chosen complexity estimate","panel":{"kind":"bars","title":"Squared first differences","a":[0.25,0.8099999999999998,1.6900000000000006,0.6399999999999997,0.49000000000000027,1.4399999999999993,0.25,0.4899999999999996],"a_label":"x","b":[0.25,0.03999999999999998,1.4400000000000004,4.0,0.6399999999999997,2.2500000000000013,1.6899999999999995,1.0],"b_label":"y"}},{"phase":1,"caption":"Consecutive changes define the chosen complexity estimate","panel":{"kind":"bars","title":"Squared first differences","a":[0.25,0.8099999999999998,1.6900000000000006,0.6399999999999997,0.49000000000000027,1.4399999999999993,0.25,0.4899999999999996,1.0,0.0899999999999999,0.6399999999999997],"a_label":"x","b":[0.25,0.03999999999999998,1.4400000000000004,4.0,0.6399999999999997,2.2500000000000013,1.6899999999999995,1.0,0.25,1.6900000000000006,0.25000000000000044],"b_label":"y"}},{"phase":2,"caption":"Accumulate first-difference energy in both sequences","panel":{"kind":"bars","title":"Complexity accumulated so far","a":[0.5,0.5],"a_label":"contribution","labels":["CE(x)","CE(y)"]},"value":1.0,"value_label":"partial complexity ratio"},{"phase":2,"caption":"Accumulate first-difference energy in both sequences","panel":{"kind":"bars","title":"Complexity accumulated so far","a":[1.0295630140987,0.5385164807134504],"a_label":"contribution","labels":["CE(x)","CE(y)"]},"value":1.9118505207764291,"value_label":"partial complexity ratio"},{"phase":2,"caption":"Accumulate first-difference energy in both sequences","panel":{"kind":"bars","title":"Complexity accumulated so far","a":[1.6583123951777001,1.3152946437965907],"a_label":"contribution","labels":["CE(x)","CE(y)"]},"value":1.2607915671206495,"value_label":"partial complexity ratio"},{"phase":2,"caption":"Accumulate first-difference energy in both sequences","panel":{"kind":"bars","title":"Complexity accumulated so far","a":[1.969771560359221,2.5238858928247927],"a_label":"contribution","labels":["CE(x)","CE(y)"]},"value":1.2813089312572468,"value_label":"partial complexity ratio"},{"phase":2,"caption":"Accumulate first-difference energy in both sequences","panel":{"kind":"bars","title":"Complexity accumulated so far","a":[2.306512518934159,2.93598365118064],"a_label":"contribution","labels":["CE(x)","CE(y)"]},"value":1.2729103471492798,"value_label":"partial complexity ratio"},{"phase":2,"caption":"Accumulate first-difference energy in both sequences","panel":{"kind":"bars","title":"Complexity accumulated so far","a":[2.461706725018234,3.3630343441600474],"a_label":"contribution","labels":["CE(x)","CE(y)"]},"value":1.3661393170769103,"value_label":"partial complexity ratio"},{"phase":2,"caption":"Accumulate first-difference energy in both sequences","panel":{"kind":"bars","title":"Complexity accumulated so far","a":[2.657066051117284,3.4],"a_label":"contribution","labels":["CE(x)","CE(y)"]},"value":1.2796068801414686,"value_label":"partial complexity ratio"},{"phase":2,"caption":"Accumulate first-difference energy in both sequences","panel":{"kind":"bars","title":"Complexity accumulated so far","a":[2.791057147390572,3.6742346141747673],"a_label":"contribution","labels":["CE(x)","CE(y)"]},"value":1.3164311657358574,"value_label":"partial complexity ratio"},{"phase":3,"caption":"Multiply Euclidean distance by the final complexity ratio","panel":{"kind":"bars","title":"ED baseline, CE ratio, corrected distance","a":[1.661324772583615,1.3164311657358574,2.1870197070381066],"a_label":"contribution","marker":0,"labels":["ED","ratio","CID"]},"value":2.1870197070381066,"value_label":"CID"},{"phase":3,"caption":"Multiply Euclidean distance by the final complexity ratio","panel":{"kind":"bars","title":"ED baseline, CE ratio, corrected distance","a":[1.661324772583615,1.3164311657358574,2.1870197070381066],"a_label":"contribution","marker":1,"labels":["ED","ratio","CID"]},"value":2.1870197070381066,"value_label":"CID"},{"phase":3,"caption":"Multiply Euclidean distance by the final complexity ratio","panel":{"kind":"bars","title":"ED baseline, CE ratio, corrected distance","a":[1.661324772583615,1.3164311657358574,2.1870197070381066],"a_label":"contribution","marker":2,"labels":["ED","ratio","CID"]},"value":2.1870197070381066,"value_label":"CID"},{"phase":3,"caption":"Multiply Euclidean distance by the final complexity ratio","panel":{"kind":"bars","title":"ED baseline, CE ratio, corrected distance","a":[1.661324772583615,1.3164311657358574,2.1870197070381066],"a_label":"contribution","marker":0,"labels":["ED","ratio","CID"]},"value":2.1870197070381066,"value_label":"CID"}],"animation_steps_en":["Compute the aligned Euclidean distance.","Measure first-difference energy in each series.","Divide larger complexity by smaller complexity.","Multiply Euclidean distance by the complexity ratio."],"echotime_status":"Low-priority addition","echotime_api":""}
