{"id":"chi_square_distance","title":"Symmetric chi-square distance","family":"lock-step","definition":"reference","intro_en":"This symmetric chi-square histogram distance divides squared probability differences by the combined mass of each bin, then sums half of those ratios. Small-mass bins can matter disproportionately relative to unweighted squared error. The animation follows the exact symmetric convention in the registry; it does not perform a statistical chi-square hypothesis test.","intro_zh":"此对称卡方直方图距离用每箱概率和归一化平方概率差，再累加其一半。低概率箱相较无权平方误差可能获得更高影响。动画遵循登记表的对称定义，不进行卡方假设检验。","steps_en":["Declare one shared bin support and normalize nonnegative mass to sum to one.","Divide squared bin differences by combined probability mass.","Accumulate the displayed bin contributions, retaining any signed terms.","Sum half of the mass-scaled squared differences."],"steps_zh":["声明共同箱支持集，将非负质量归一化为概率。","按该方法公式计算逐箱贡献。","累加所示贡献，保留可能出现的符号。","应用所示最后的根号、对数或直接求和。"],"formula":"0.5*sum_i (p_i-q_i)^2/(p_i+q_i)","caveats_en":["The name also denotes other asymmetric distances and test statistics; use the displayed formula.","A zero-over-zero bin needs an explicit zero contribution convention."],"caveats_zh":["该名称还用于非对称距离和检验统计量，应以所示公式为准。","两侧均为零的箱需要显式约定贡献为零。"],"sources":[{"label":"Imported registry: symmetric chi-square convention","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.05752051227903933,"detail":""},"frames":[{"phase":0,"caption":"Probability mass on shared bins","panel":{"kind":"lines","title":"Probability mass on shared bins","a":[0.030303030303030304,0.09090909090909091],"a_label":"x","b":[0.029411764705882353,0.058823529411764705],"b_label":"y","marker":1}},{"phase":0,"caption":"Probability mass on shared bins","panel":{"kind":"lines","title":"Probability mass on shared bins","a":[0.030303030303030304,0.09090909090909091,0.18181818181818182,0.2727272727272727],"a_label":"x","b":[0.029411764705882353,0.058823529411764705,0.08823529411764706,0.17647058823529413],"b_label":"y","marker":3}},{"phase":0,"caption":"Probability mass on shared bins","panel":{"kind":"lines","title":"Probability mass on shared bins","a":[0.030303030303030304,0.09090909090909091,0.18181818181818182,0.2727272727272727,0.21212121212121213,0.12121212121212122],"a_label":"x","b":[0.029411764705882353,0.058823529411764705,0.08823529411764706,0.17647058823529413,0.2647058823529412,0.20588235294117646],"b_label":"y","marker":5}},{"phase":0,"caption":"Probability mass on shared bins","panel":{"kind":"lines","title":"Probability mass on shared bins","a":[0.030303030303030304,0.09090909090909091,0.18181818181818182,0.2727272727272727,0.21212121212121213,0.12121212121212122,0.06060606060606061,0.030303030303030304],"a_label":"x","b":[0.029411764705882353,0.058823529411764705,0.08823529411764706,0.17647058823529413,0.2647058823529412,0.20588235294117646,0.11764705882352941,0.058823529411764705],"b_label":"y","marker":7}},{"phase":1,"caption":"Compute coordinate 1: Divide squared bin differences by combined probability mass","panel":{"kind":"bars","title":"Divide squared bin differences by combined probability mass","a":[6.6512357996115865e-06,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":0},"value":6.6512357996115865e-06,"value_label":"coordinate term","input_highlight":[0]},{"phase":1,"caption":"Compute coordinate 3: Divide squared bin differences by combined probability mass","panel":{"kind":"bars","title":"Divide squared bin differences by combined probability mass","a":[6.6512357996115865e-06,0.0034377387318563803,0.016214856779795627,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":2},"value":0.016214856779795627,"value_label":"coordinate term","input_highlight":[2]},{"phase":1,"caption":"Compute coordinate 5: Divide squared bin differences by combined probability mass","panel":{"kind":"bars","title":"Divide squared bin differences by combined probability mass","a":[6.6512357996115865e-06,0.0034377387318563803,0.016214856779795627,0.010313216195569129,0.0028995285454878634,0.0,0.0,0.0],"a_label":"contribution","marker":4},"value":0.0028995285454878634,"value_label":"coordinate term","input_highlight":[4]},{"phase":1,"caption":"Compute coordinate 8: Divide squared bin differences by combined probability mass","panel":{"kind":"bars","title":"Divide squared bin differences by combined probability mass","a":[6.6512357996115865e-06,0.0034377387318563803,0.016214856779795627,0.010313216195569129,0.0028995285454878634,0.010958681218338212,0.009126559714795007,0.004563279857397504],"a_label":"contribution","marker":7},"value":0.004563279857397504,"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":[6.6512357996115865e-06,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":0},"value":6.6512357996115865e-06,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 2 of 8 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[6.6512357996115865e-06,0.0034377387318563803,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":1},"value":0.0034443899676559918,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 3 of 8 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[6.6512357996115865e-06,0.0034377387318563803,0.016214856779795627,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":2},"value":0.01965924674745162,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 4 of 8 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[6.6512357996115865e-06,0.0034377387318563803,0.016214856779795627,0.010313216195569129,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":3},"value":0.02997246294302075,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 5 of 8 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[6.6512357996115865e-06,0.0034377387318563803,0.016214856779795627,0.010313216195569129,0.0028995285454878634,0.0,0.0,0.0],"a_label":"contribution","marker":4},"value":0.03287199148850861,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 6 of 8 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[6.6512357996115865e-06,0.0034377387318563803,0.016214856779795627,0.010313216195569129,0.0028995285454878634,0.010958681218338212,0.0,0.0],"a_label":"contribution","marker":5},"value":0.043830672706846825,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 7 of 8 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[6.6512357996115865e-06,0.0034377387318563803,0.016214856779795627,0.010313216195569129,0.0028995285454878634,0.010958681218338212,0.009126559714795007,0.0],"a_label":"contribution","marker":6},"value":0.05295723242164183,"value_label":"running sum"},{"phase":2,"caption":"Accumulate 8 of 8 coordinate terms","panel":{"kind":"bars","title":"Terms included so far","a":[6.6512357996115865e-06,0.0034377387318563803,0.016214856779795627,0.010313216195569129,0.0028995285454878634,0.010958681218338212,0.009126559714795007,0.004563279857397504],"a_label":"contribution","marker":7},"value":0.05752051227903933,"value_label":"running sum"},{"phase":3,"caption":"Sum half of the mass-scaled squared differences","panel":{"kind":"bars","title":"Divide squared bin differences by combined probability mass","a":[6.6512357996115865e-06,0.0034377387318563803,0.016214856779795627,0.010313216195569129,0.0028995285454878634,0.010958681218338212,0.009126559714795007,0.004563279857397504],"a_label":"contribution","marker":0},"value":0.05752051227903933,"value_label":"final result"},{"phase":3,"caption":"Sum half of the mass-scaled squared differences","panel":{"kind":"bars","title":"Divide squared bin differences by combined probability mass","a":[6.6512357996115865e-06,0.0034377387318563803,0.016214856779795627,0.010313216195569129,0.0028995285454878634,0.010958681218338212,0.009126559714795007,0.004563279857397504],"a_label":"contribution","marker":2},"value":0.05752051227903933,"value_label":"final result"},{"phase":3,"caption":"Sum half of the mass-scaled squared differences","panel":{"kind":"bars","title":"Divide squared bin differences by combined probability mass","a":[6.6512357996115865e-06,0.0034377387318563803,0.016214856779795627,0.010313216195569129,0.0028995285454878634,0.010958681218338212,0.009126559714795007,0.004563279857397504],"a_label":"contribution","marker":4},"value":0.05752051227903933,"value_label":"final result"},{"phase":3,"caption":"Sum half of the mass-scaled squared differences","panel":{"kind":"bars","title":"Divide squared bin differences by combined probability mass","a":[6.6512357996115865e-06,0.0034377387318563803,0.016214856779795627,0.010313216195569129,0.0028995285454878634,0.010958681218338212,0.009126559714795007,0.004563279857397504],"a_label":"contribution","marker":7},"value":0.05752051227903933,"value_label":"final result"}],"animation_steps_en":["Normalize counts on one shared bin support.","Divide squared bin differences by combined probability mass.","Accumulate the displayed bin contributions.","Sum half of the mass-scaled squared differences."],"echotime_status":"Low-priority addition","echotime_api":""}
