{"id":"normalized_mutual_information","title":"EchoTime reference: normalized mutual information","family":"native","definition":"echotime","intro_en":"EchoTime estimates mutual information from a joint histogram of aligned, resampled observations. It compares observed joint mass with the product of marginal masses, then divides by the geometric mean of marginal entropies. The animation shows the actual bin counts and information terms. The resulting finite-sample dependence estimate is sensitive to the declared binning rule.","intro_zh":"EchoTime 通过对齐且重采样观测的联合直方图估计互信息，比较联合概率与边缘概率乘积，再除以两侧熵的几何平均。动画显示真实箱计数及信息贡献项。有限样本依赖估计对所声明的分箱规则敏感。","steps_en":["Use the aligned resampled observations and the native bin-count rule.","Count their joint histogram and normalize it to probability mass.","Compute MI from joint-versus-independent mass and both marginal entropies.","Divide MI by sqrt(Hx*Hy) and clip to [0,1]."],"steps_zh":["使用对齐的重采样观测和原生分箱数规则。","计算联合直方图并归一化为概率。","由联合质量与独立质量比较得到 MI，同时计算边缘熵。","以 sqrt(Hx*Hy) 归一化 MI 并截至 [0,1]。"],"formula":"I(X;Y)/sqrt(H(X)*H(Y)); bins=clip(round(sqrt(n/4)),4,20); natural logarithms","caveats_en":["Binning and finite sample size introduce estimation bias; a nonzero score is not a significance test.","The native function needs at least twelve finite paired observations and gives constant inputs a zero convention.","Dependence does not establish causality, waveform equality or temporal forecasting ability."],"caveats_zh":["分箱和有限样本引入估计偏差；非零分数不是显著性检验。","原生函数要求至少十二对有限观测，并对常量输入约定为零。","依赖关系不证明因果、波形相等或时间预测能力。"],"sources":[{"label":"EchoTime comparison implementation","url":"https://github.com/ZipengWu365/EchoTime/blob/main/src/echotime/similarity.py"}],"x":[0.0,0.3,0.9,1.8,2.7,2.1,1.5,1.1,1.3,2.0,2.8,3.4,3.0,2.4,2.1,2.5,3.4,4.2,4.4,4.0,3.7,3.9,4.8,5.2],"y":[1.5,2.0519225760215023,2.5029737413368567,2.8847890070498634,3.3269392741386694,2.933060886050363,2.8090394772296827,2.72585888185695,2.7447210175121164,2.9398624371786375,3.3900034277072537,4.0626233874128905,4.107225730147529,3.7653701874961145,3.286091424860995,3.2508751301708068,3.8879044257286575,4.807850340965032,5.3047858081274875,5.010505135042322,4.45690204174836,4.306684421263111,5.058860495657116,5.718268001238006],"input_label":"Deterministic synthetic illustration; sample index is the time axis.","parameters":{"n_points":24,"default_n_points":256,"channels":1,"preprocessing":"compare_series linear resampling followed by per-channel population z-score","demonstration_note":"24 points expose the computation; production default is 256","bins_per_axis":4,"x_bin_edges":[-1.9249938311141905,-0.9791700904722576,-0.033346349830324584,0.9124773908116084,1.8583011314535414],"y_bin_edges":[-2.010364037206175,-1.0094117352307777,-0.008459433255380233,0.9924928687200172,1.9934451706954148],"log_base":"e"},"result":{"label":"similarity","value":0.6828413053615148,"detail":""},"frames":[{"phase":0,"caption":"Pair standardized observations; fix four bins on each axis","panel":{"kind":"scatter","title":"Observations before joint histogramming","a":[-1.9249938311141905,-1.7067268140429754,-1.2701927799005448,-0.6153917286868987],"b":[-2.010364037206175,-1.4865014729321389,-1.0583819678664712,-0.6959783756503127],"marker":3}},{"phase":0,"caption":"Pair standardized observations; fix four bins on each axis","panel":{"kind":"scatter","title":"Observations before joint histogramming","a":[-1.9249938311141905,-1.7067268140429754,-1.2701927799005448,-0.6153917286868987,0.039409322526747226,-0.3971247116156834,-0.833658745758114,-1.1246814351864012,-0.9791700904722576,-0.4698803839727553],"b":[-2.010364037206175,-1.4865014729321389,-1.0583819678664712,-0.6959783756503127,-0.27630724282358066,-0.6501606624163054,-0.767876762594728,-0.8468284161108967,-0.8289252405908301,-0.6437049054498428],"marker":9}},{"phase":0,"caption":"Pair standardized observations; fix four bins on each axis","panel":{"kind":"scatter","title":"Observations before joint histogramming","a":[-1.9249938311141905,-1.7067268140429754,-1.2701927799005448,-0.6153917286868987,0.039409322526747226,-0.3971247116156834,-0.833658745758114,-1.1246814351864012,-0.9791700904722576,-0.4698803839727553,0.11216499488381873,0.5486990290262495,0.2576763395979624,-0.17885769454446826,-0.3971247116156834,-0.10610202218739644,0.5486990290262495],"b":[-2.010364037206175,-1.4865014729321389,-1.0583819678664712,-0.6959783756503127,-0.27630724282358066,-0.6501606624163054,-0.767876762594728,-0.8468284161108967,-0.8289252405908301,-0.6437049054498428,-0.216449301442826,0.42197433292498865,0.4643090708986111,0.13983363002140164,-0.31507836761056185,-0.34850424877965086,0.25613816808647405],"marker":16}},{"phase":0,"caption":"Pair standardized observations; fix four bins on each axis","panel":{"kind":"scatter","title":"Observations before joint histogramming","a":[-1.9249938311141905,-1.7067268140429754,-1.2701927799005448,-0.6153917286868987,0.039409322526747226,-0.3971247116156834,-0.833658745758114,-1.1246814351864012,-0.9791700904722576,-0.4698803839727553,0.11216499488381873,0.5486990290262495,0.2576763395979624,-0.17885769454446826,-0.3971247116156834,-0.10610202218739644,0.5486990290262495,1.1307444078828237,1.2762557525969673,0.9852330631686801,0.7669660460974649,0.9124773908116083,1.5672784420252541,1.8583011314535414],"b":[-2.010364037206175,-1.4865014729321389,-1.0583819678664712,-0.6959783756503127,-0.27630724282358066,-0.6501606624163054,-0.767876762594728,-0.8468284161108967,-0.8289252405908301,-0.6437049054498428,-0.216449301442826,0.42197433292498865,0.4643090708986111,0.13983363002140164,-0.31507836761056185,-0.34850424877965086,0.25613816808647405,1.129313586318283,1.6009846130463108,1.3216653122669242,0.7962076690345238,0.6536271853119654,1.3675622628694208,1.9934451706954148],"marker":23}},{"phase":1,"caption":"Count paired observations using the same fixed bin edges","panel":{"kind":"matrix","title":"Joint histogram counts","z":[[3.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],"row_label":"x bin","col_label":"y bin"}},{"phase":1,"caption":"Count paired observations using the same fixed bin edges","panel":{"kind":"matrix","title":"Joint histogram counts","z":[[3.0,0.0,0.0,0.0],[0.0,2.0,0.0,0.0],[0.0,1.0,0.0,0.0],[0.0,0.0,0.0,0.0]],"row_label":"x bin","col_label":"y bin"}},{"phase":1,"caption":"Count paired observations using the same fixed bin edges","panel":{"kind":"matrix","title":"Joint histogram counts","z":[[3.0,1.0,0.0,0.0],[0.0,4.0,0.0,0.0],[0.0,1.0,0.0,0.0],[0.0,0.0,0.0,0.0]],"row_label":"x bin","col_label":"y bin"}},{"phase":1,"caption":"Count paired observations using the same fixed bin edges","panel":{"kind":"matrix","title":"Joint histogram counts","z":[[3.0,1.0,0.0,0.0],[0.0,5.0,0.0,0.0],[0.0,2.0,1.0,0.0],[0.0,0.0,0.0,0.0]],"row_label":"x bin","col_label":"y bin"}},{"phase":1,"caption":"Count paired observations using the same fixed bin edges","panel":{"kind":"matrix","title":"Joint histogram counts","z":[[3.0,1.0,0.0,0.0],[0.0,6.0,1.0,0.0],[0.0,2.0,2.0,0.0],[0.0,0.0,0.0,0.0]],"row_label":"x bin","col_label":"y bin"}},{"phase":1,"caption":"Count paired observations using the same fixed bin edges","panel":{"kind":"matrix","title":"Joint histogram counts","z":[[3.0,1.0,0.0,0.0],[0.0,7.0,1.0,0.0],[0.0,2.0,3.0,0.0],[0.0,0.0,0.0,1.0]],"row_label":"x bin","col_label":"y bin"}},{"phase":1,"caption":"Count paired observations using the same fixed bin edges","panel":{"kind":"matrix","title":"Joint histogram counts","z":[[3.0,1.0,0.0,0.0],[0.0,7.0,1.0,0.0],[0.0,2.0,4.0,0.0],[0.0,0.0,0.0,3.0]],"row_label":"x bin","col_label":"y bin"}},{"phase":1,"caption":"Count paired observations using the same fixed bin edges","panel":{"kind":"matrix","title":"Joint histogram counts","z":[[3.0,1.0,0.0,0.0],[0.0,7.0,1.0,0.0],[0.0,2.0,5.0,0.0],[0.0,0.0,0.0,5.0]],"row_label":"x bin","col_label":"y bin"}},{"phase":2,"caption":"Compare joint mass with the product of its marginals","panel":{"kind":"matrix","title":"Contributions p(x,y) log[p(x,y)/(p(x)p(y))]","z":[[0.22396993365350687,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],"row_label":"x bin","col_label":"y bin"},"value":0.22396993365350687,"value_label":"partial mutual information (nats)"},{"phase":2,"caption":"Compare joint mass with the product of its marginals","panel":{"kind":"matrix","title":"Contributions p(x,y) log[p(x,y)/(p(x)p(y))]","z":[[0.22396993365350687,-0.021284400990249613,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],"row_label":"x bin","col_label":"y bin"},"value":0.20268553266325726,"value_label":"partial mutual information (nats)"},{"phase":2,"caption":"Compare joint mass with the product of its marginals","panel":{"kind":"matrix","title":"Contributions p(x,y) log[p(x,y)/(p(x)p(y))]","z":[[0.22396993365350687,-0.021284400990249613,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],"row_label":"x bin","col_label":"y bin"},"value":0.20268553266325726,"value_label":"partial mutual information (nats)"},{"phase":2,"caption":"Compare joint mass with the product of its marginals","panel":{"kind":"matrix","title":"Contributions p(x,y) log[p(x,y)/(p(x)p(y))]","z":[[0.22396993365350687,-0.021284400990249613,0.0,0.0],[0.0,0.216398392212735,-0.028881132523331056,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],"row_label":"x bin","col_label":"y bin"},"value":0.39020279235266114,"value_label":"partial mutual information (nats)"},{"phase":2,"caption":"Compare joint mass with the product of its marginals","panel":{"kind":"matrix","title":"Contributions p(x,y) log[p(x,y)/(p(x)p(y))]","z":[[0.22396993365350687,-0.021284400990249613,0.0,0.0],[0.0,0.216398392212735,-0.028881132523331056,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],"row_label":"x bin","col_label":"y bin"},"value":0.3902027923526612,"value_label":"partial mutual information (nats)"},{"phase":2,"caption":"Compare joint mass with the product of its marginals","panel":{"kind":"matrix","title":"Contributions p(x,y) log[p(x,y)/(p(x)p(y))]","z":[[0.22396993365350687,-0.021284400990249613,0.0,0.0],[0.0,0.216398392212735,-0.028881132523331056,0.0],[0.0,-0.031441185928455684,0.21871294260389118,0.0],[0.0,0.0,0.0,0.0]],"row_label":"x bin","col_label":"y bin"},"value":0.5774745490280967,"value_label":"partial mutual information (nats)"},{"phase":2,"caption":"Compare joint mass with the product of its marginals","panel":{"kind":"matrix","title":"Contributions p(x,y) log[p(x,y)/(p(x)p(y))]","z":[[0.22396993365350687,-0.021284400990249613,0.0,0.0],[0.0,0.216398392212735,-0.028881132523331056,0.0],[0.0,-0.031441185928455684,0.21871294260389118,0.0],[0.0,0.0,0.0,0.0]],"row_label":"x bin","col_label":"y bin"},"value":0.5774745490280967,"value_label":"partial mutual information (nats)"},{"phase":2,"caption":"Compare joint mass with the product of its marginals","panel":{"kind":"matrix","title":"Contributions p(x,y) log[p(x,y)/(p(x)p(y))]","z":[[0.22396993365350687,-0.021284400990249613,0.0,0.0],[0.0,0.216398392212735,-0.028881132523331056,0.0],[0.0,-0.031441185928455684,0.21871294260389118,0.0],[0.0,0.0,0.0,0.3267949828987178]],"row_label":"x bin","col_label":"y bin"},"value":0.9042695319268145,"value_label":"partial mutual information (nats)"},{"phase":3,"caption":"Normalize MI by sqrt(H(x)*H(y)) and clip to [0,1]","panel":{"kind":"bars","title":"MI, marginal entropies and normalized score","a":[0.9042695319268145,1.3510008977031147,1.298077406452795,0.6828413053615148],"a_label":"contribution","marker":0,"labels":["MI","H(x)","H(y)","NMI"]},"value":0.6828413053615148,"value_label":"normalized mutual information"},{"phase":3,"caption":"Normalize MI by sqrt(H(x)*H(y)) and clip to [0,1]","panel":{"kind":"bars","title":"MI, marginal entropies and normalized score","a":[0.9042695319268145,1.3510008977031147,1.298077406452795,0.6828413053615148],"a_label":"contribution","marker":1,"labels":["MI","H(x)","H(y)","NMI"]},"value":0.6828413053615148,"value_label":"normalized mutual information"},{"phase":3,"caption":"Normalize MI by sqrt(H(x)*H(y)) and clip to [0,1]","panel":{"kind":"bars","title":"MI, marginal entropies and normalized score","a":[0.9042695319268145,1.3510008977031147,1.298077406452795,0.6828413053615148],"a_label":"contribution","marker":2,"labels":["MI","H(x)","H(y)","NMI"]},"value":0.6828413053615148,"value_label":"normalized mutual information"},{"phase":3,"caption":"Normalize MI by sqrt(H(x)*H(y)) and clip to [0,1]","panel":{"kind":"bars","title":"MI, marginal entropies and normalized score","a":[0.9042695319268145,1.3510008977031147,1.298077406452795,0.6828413053615148],"a_label":"contribution","marker":3,"labels":["MI","H(x)","H(y)","NMI"]},"value":0.6828413053615148,"value_label":"normalized mutual information"}],"checks":{"api":"compare_series(..., n_points=24): normalized_mutual_information","expected":0.6828413053615148,"observed":0.6828413053615147,"tolerance":1e-11},"animation_steps_en":["Pair observations and apply the native bin-count rule.","Form the joint histogram and normalize its counts.","Compute MI and both marginal entropies.","Divide MI by sqrt(Hx*Hy) and clip to [0,1]."],"echotime_status":"EchoTime report component / reference metric","echotime_api":"normalized_mutual_information"}
