{"id":"hellinger_distance","title":"Hellinger distance","family":"lock-step","definition":"reference","intro_en":"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.","intro_zh":"Hellinger 距离对概率开平方后，计算缩放的欧氏距离。动画展示变换如何改变坐标差，再平方累加。根号内的二分之一确定常见的 0 到 1 归一化。每个概率质量必须对应相同的箱定义。","steps_en":["Declare one shared bin support and normalize nonnegative mass to sum to one.","Square the difference between square-root masses; divide by two.","Accumulate the displayed bin contributions, retaining any signed terms.","Take the square root of the accumulated contributions."],"steps_zh":["声明共同箱支持集，将非负质量归一化为概率。","按该方法公式计算逐箱贡献。","累加所示贡献，保留可能出现的符号。","应用所示最后的根号、对数或直接求和。"],"formula":"sqrt(0.5*sum_i (sqrt(p_i)-sqrt(q_i))^2)","caveats_en":["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."],"caveats_zh":["此约定包含 1/√2 因子，部分资料会省略。","直方图间距离不保留生成它们的原始时间顺序。"],"sources":[{"label":"Imported registry: normalized Hellinger formula","url":"https://github.com/ZipengWu365/EchoTime/blob/main/src/echotime/data/ts_similarity_package_v2_registry.csv"}],"x":[1.0,3.0,6.0,9.0,7.0,4.0,2.0,1.0],"y":[1.0,2.0,3.0,6.0,9.0,7.0,4.0,2.0],"input_label":"Synthetic counts on eight shared bins; these bins are not timestamps.","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"},"result":{"label":"distance","value":0.17141911612584487,"detail":""},"frames":[{"phase":0,"caption":"Square-root probability vectors","panel":{"kind":"lines","title":"Square-root probability vectors","a":[0.17407765595569785,0.30151134457776363],"a_label":"x","b":[0.17149858514250885,0.24253562503633297],"b_label":"y","marker":1}},{"phase":0,"caption":"Square-root probability vectors","panel":{"kind":"lines","title":"Square-root probability vectors","a":[0.17407765595569785,0.30151134457776363,0.4264014327112209,0.5222329678670935],"a_label":"x","b":[0.17149858514250885,0.24253562503633297,0.2970442628930023,0.42008402520840293],"b_label":"y","marker":3}},{"phase":0,"caption":"Square-root probability vectors","panel":{"kind":"lines","title":"Square-root probability vectors","a":[0.17407765595569785,0.30151134457776363,0.4264014327112209,0.5222329678670935,0.4605661864718383,0.3481553119113957],"a_label":"x","b":[0.17149858514250885,0.24253562503633297,0.2970442628930023,0.42008402520840293,0.5144957554275266,0.45374260648651504],"b_label":"y","marker":5}},{"phase":0,"caption":"Square-root probability vectors","panel":{"kind":"lines","title":"Square-root probability vectors","a":[0.17407765595569785,0.30151134457776363,0.4264014327112209,0.5222329678670935,0.4605661864718383,0.3481553119113957,0.24618298195866548,0.17407765595569785],"a_label":"x","b":[0.17149858514250885,0.24253562503633297,0.2970442628930023,0.42008402520840293,0.5144957554275266,0.45374260648651504,0.3429971702850177,0.24253562503633297],"b_label":"y","marker":7}},{"phase":1,"caption":"Compute coordinate 1: Square the difference between square-root masses; divide by two","panel":{"kind":"bars","title":"Square the difference between square-root masses; divide by two","a":[3.3258031297216977e-06,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":0},"value":3.3258031297216977e-06,"value_label":"coordinate term","input_highlight":[0]},{"phase":1,"caption":"Compute coordinate 3: Square the difference between square-root masses; divide by two","panel":{"kind":"bars","title":"Square the difference between square-root masses; divide by two","a":[3.3258031297216977e-06,0.0017390677477147432,0.008366638691689722,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":2},"value":0.008366638691689722,"value_label":"coordinate term","input_highlight":[2]},{"phase":1,"caption":"Compute coordinate 5: Square the difference between square-root masses; divide by two","panel":{"kind":"bars","title":"Square the difference between square-root masses; divide by two","a":[3.3258031297216977e-06,0.0017390677477147432,0.008366638691689722,0.005217203243144227,0.001454199203873169,0.0,0.0,0.0],"a_label":"contribution","marker":4},"value":0.001454199203873169,"value_label":"coordinate term","input_highlight":[4]},{"phase":1,"caption":"Compute coordinate 8: Square the difference between square-root masses; divide by two","panel":{"kind":"bars","title":"Square the difference between square-root masses; divide by two","a":[3.3258031297216977e-06,0.0017390677477147432,0.008366638691689722,0.005217203243144227,0.001454199203873169,0.005574338387846513,0.004686493530645197,0.0023432467653225967],"a_label":"contribution","marker":7},"value":0.0023432467653225967,"value_label":"coordinate term","input_highlight":[7]},{"phase":2,"caption":"Accumulate 1 of 8 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[3.3258031297216977e-06,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":0},"value":3.3258031297216977e-06,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 2 of 8 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[3.3258031297216977e-06,0.0017390677477147432,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":1},"value":0.001742393550844465,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 3 of 8 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[3.3258031297216977e-06,0.0017390677477147432,0.008366638691689722,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":2},"value":0.010109032242534188,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 4 of 8 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[3.3258031297216977e-06,0.0017390677477147432,0.008366638691689722,0.005217203243144227,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":3},"value":0.015326235485678415,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 5 of 8 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[3.3258031297216977e-06,0.0017390677477147432,0.008366638691689722,0.005217203243144227,0.001454199203873169,0.0,0.0,0.0],"a_label":"contribution","marker":4},"value":0.016780434689551583,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 6 of 8 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[3.3258031297216977e-06,0.0017390677477147432,0.008366638691689722,0.005217203243144227,0.001454199203873169,0.005574338387846513,0.0,0.0],"a_label":"contribution","marker":5},"value":0.022354773077398096,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 7 of 8 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[3.3258031297216977e-06,0.0017390677477147432,0.008366638691689722,0.005217203243144227,0.001454199203873169,0.005574338387846513,0.004686493530645197,0.0],"a_label":"contribution","marker":6},"value":0.027041266608043294,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 8 of 8 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[3.3258031297216977e-06,0.0017390677477147432,0.008366638691689722,0.005217203243144227,0.001454199203873169,0.005574338387846513,0.004686493530645197,0.0023432467653225967],"a_label":"contribution","marker":7},"value":0.029384513373365888,"value_label":"running sum"},{"phase":3,"caption":"Take the square root of the accumulated contributions","panel":{"kind":"bars","title":"Square the difference between square-root masses; divide by two","a":[3.3258031297216977e-06,0.0017390677477147432,0.008366638691689722,0.005217203243144227,0.001454199203873169,0.005574338387846513,0.004686493530645197,0.0023432467653225967],"a_label":"contribution","marker":0},"value":0.17141911612584487,"value_label":"final result"},{"phase":3,"caption":"Take the square root of the accumulated contributions","panel":{"kind":"bars","title":"Square the difference between square-root masses; divide by two","a":[3.3258031297216977e-06,0.0017390677477147432,0.008366638691689722,0.005217203243144227,0.001454199203873169,0.005574338387846513,0.004686493530645197,0.0023432467653225967],"a_label":"contribution","marker":2},"value":0.17141911612584487,"value_label":"final result"},{"phase":3,"caption":"Take the square root of the accumulated contributions","panel":{"kind":"bars","title":"Square the difference between square-root masses; divide by two","a":[3.3258031297216977e-06,0.0017390677477147432,0.008366638691689722,0.005217203243144227,0.001454199203873169,0.005574338387846513,0.004686493530645197,0.0023432467653225967],"a_label":"contribution","marker":4},"value":0.17141911612584487,"value_label":"final result"},{"phase":3,"caption":"Take the square root of the accumulated contributions","panel":{"kind":"bars","title":"Square the difference between square-root masses; divide by two","a":[3.3258031297216977e-06,0.0017390677477147432,0.008366638691689722,0.005217203243144227,0.001454199203873169,0.005574338387846513,0.004686493530645197,0.0023432467653225967],"a_label":"contribution","marker":7},"value":0.17141911612584487,"value_label":"final result"}],"animation_steps_en":["Normalize counts on one shared bin support.","Square the difference between square-root masses; divide by two.","Accumulate the displayed bin contributions.","Take the square root of the accumulated contributions."],"echotime_status":"Low-priority addition","echotime_api":""}
