{"id":"spearman_rho","title":"EchoTime reference: Spearman rho","family":"native","definition":"echotime","intro_en":"The native Spearman reference converts the report's resampled observations to average ranks and correlates those ranks. It complements amplitude-based comparisons by exposing monotone agreement on the same grid. The animation makes the ranking operation visible, including ties, and retains a signed coefficient; its value depends on the observations created by the chosen interpolation resolution.","intro_zh":"原生 Spearman 参照把报告重采样后的观测转换为平均排名，再计算相关。它在相同网格上展示单调一致性，补充幅值比较。动画显示含并列处理的排名操作并保留符号；结果依赖所选插值分辨率产生的观测。","steps_en":["Use the same resampled observations as the native report.","Assign average ranks independently, retaining paired sample identities.","Center ranks and normalize their product sum.","Report the signed rank coefficient."],"steps_zh":["使用原生报告相同的重采样观测。","独立赋予平均排名，保留配对身份。","对排名去均值并归一化乘积。","报告带符号排名系数。"],"formula":"corr(rank_average(x),rank_average(y)) after compare_series preprocessing","caveats_en":["EchoTime assigns zero for constant inputs; statistical correlation is undefined in that case.","These are dependence summaries, not causal tests or identity probabilities.","The illustrative report explicitly uses n_points=24; the default is 256."],"caveats_zh":["EchoTime 对常量输入赋零；此时统计相关本身未定义。","这些是依赖关系摘要，不是因果检验或同一性概率。","演示报告显式使用 n_points=24，默认值为 256。"],"sources":[{"label":"EchoTime comparison implementation","url":"https://github.com/ZipengWu365/EchoTime/blob/main/src/echotime/similarity.py"},{"label":"SciPy: spearmanr","url":"https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.spearmanr.html"}],"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"},"result":{"label":"similarity","value":0.9856460262566713,"detail":""},"frames":[{"phase":0,"caption":"Compare paired observations on the same time grid","panel":{"kind":"scatter","title":"Paired observations: x versus y","a":[-1.9249938311141905,-1.7067268140429754,-1.2701927799005448],"b":[-2.010364037206175,-1.4865014729321389,-1.0583819678664712],"marker":2}},{"phase":0,"caption":"Compare paired observations on the same time grid","panel":{"kind":"scatter","title":"Paired observations: x versus y","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":"Compare paired observations on the same time grid","panel":{"kind":"scatter","title":"Paired observations: x versus y","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":"Compare paired observations on the same time grid","panel":{"kind":"scatter","title":"Paired observations: x versus y","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":"Average ranks, then center","panel":{"kind":"lines","title":"Centered ranks","a":[-11.5,-10.5,-9.5],"a_label":"x","b":[-11.5,-10.5,-9.5],"b_label":"y"}},{"phase":1,"caption":"Average ranks, then center","panel":{"kind":"lines","title":"Centered ranks","a":[-11.5,-10.5,-9.5,-5.5,0.5,-3.0,-6.5,-8.5,-7.5,-4.5],"a_label":"x","b":[-11.5,-10.5,-9.5,-5.5,-0.5,-4.5,-6.5,-8.5,-7.5,-3.5],"b_label":"y"}},{"phase":1,"caption":"Average ranks, then center","panel":{"kind":"lines","title":"Centered ranks","a":[-11.5,-10.5,-9.5,-5.5,0.5,-3.0,-6.5,-8.5,-7.5,-4.5,1.5,4.0,2.5,-1.5,-3.0,-0.5,4.0],"a_label":"x","b":[-11.5,-10.5,-9.5,-5.5,-0.5,-4.5,-6.5,-8.5,-7.5,-3.5,0.5,3.5,4.5,1.5,-1.5,-2.5,2.5],"b_label":"y"}},{"phase":1,"caption":"Average ranks, then center","panel":{"kind":"lines","title":"Centered ranks","a":[-11.5,-10.5,-9.5,-5.5,0.5,-3.0,-6.5,-8.5,-7.5,-4.5,1.5,4.0,2.5,-1.5,-3.0,-0.5,4.0,8.5,9.5,7.5,5.5,6.5,10.5,11.5],"a_label":"x","b":[-11.5,-10.5,-9.5,-5.5,-0.5,-4.5,-6.5,-8.5,-7.5,-3.5,0.5,3.5,4.5,1.5,-1.5,-2.5,2.5,7.5,10.5,8.5,6.5,5.5,9.5,11.5],"b_label":"y"}},{"phase":2,"caption":"Accumulate normalized products using fixed full-vector norms","panel":{"kind":"bars","title":"Contribution to normalized dot product","a":[0.11505003263234313,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.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":0},"value":0.11505003263234313,"value_label":"partial normalized dot product"},{"phase":2,"caption":"Accumulate normalized products using fixed full-vector norms","panel":{"kind":"bars","title":"Contribution to normalized dot product","a":[0.11505003263234313,0.09591127484095147,0.07851240412150448,0.026315791963163554,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.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":3},"value":0.31578950355796265,"value_label":"partial normalized dot product"},{"phase":2,"caption":"Accumulate normalized products using fixed full-vector norms","panel":{"kind":"bars","title":"Contribution to normalized dot product","a":[0.11505003263234313,0.09591127484095147,0.07851240412150448,0.026315791963163554,-0.0002174858839930872,0.01174423773562671,0.036755114394831735,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.0,0.0],"a_label":"contribution","marker":6},"value":0.36407136980442806,"value_label":"partial normalized dot product"},{"phase":2,"caption":"Accumulate normalized products using fixed full-vector norms","panel":{"kind":"bars","title":"Contribution to normalized dot product","a":[0.11505003263234313,0.09591127484095147,0.07851240412150448,0.026315791963163554,-0.0002174858839930872,0.01174423773562671,0.036755114394831735,0.0628534204740022,0.04893432389844462,0.013701610691564494,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],"a_label":"contribution","marker":9},"value":0.4895607248684393,"value_label":"partial normalized dot product"},{"phase":2,"caption":"Accumulate normalized products using fixed full-vector norms","panel":{"kind":"bars","title":"Contribution to normalized dot product","a":[0.11505003263234313,0.09591127484095147,0.07851240412150448,0.026315791963163554,-0.0002174858839930872,0.01174423773562671,0.036755114394831735,0.0628534204740022,0.04893432389844462,0.013701610691564494,0.0006524576519792617,0.012179209503612884,0.009786864779688924,-0.001957372955937785,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":13},"value":0.5102218838477826,"value_label":"partial normalized dot product"},{"phase":2,"caption":"Accumulate normalized products using fixed full-vector norms","panel":{"kind":"bars","title":"Contribution to normalized dot product","a":[0.11505003263234313,0.09591127484095147,0.07851240412150448,0.026315791963163554,-0.0002174858839930872,0.01174423773562671,0.036755114394831735,0.0628534204740022,0.04893432389844462,0.013701610691564494,0.0006524576519792617,0.012179209503612884,0.009786864779688924,-0.001957372955937785,0.00391474591187557,0.0010874294199654361,0.008699435359723489,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":16},"value":0.5239234945393471,"value_label":"partial normalized dot product"},{"phase":2,"caption":"Accumulate normalized products using fixed full-vector norms","panel":{"kind":"bars","title":"Contribution to normalized dot product","a":[0.11505003263234313,0.09591127484095147,0.07851240412150448,0.026315791963163554,-0.0002174858839930872,0.01174423773562671,0.036755114394831735,0.0628534204740022,0.04893432389844462,0.013701610691564494,0.0006524576519792617,0.012179209503612884,0.009786864779688924,-0.001957372955937785,0.00391474591187557,0.0010874294199654361,0.008699435359723489,0.05545890041823724,0.08677686771324179,0.05545890041823724,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":19},"value":0.7216181630890632,"value_label":"partial normalized dot product"},{"phase":2,"caption":"Accumulate normalized products using fixed full-vector norms","panel":{"kind":"bars","title":"Contribution to normalized dot product","a":[0.11505003263234313,0.09591127484095147,0.07851240412150448,0.026315791963163554,-0.0002174858839930872,0.01174423773562671,0.036755114394831735,0.0628534204740022,0.04893432389844462,0.013701610691564494,0.0006524576519792617,0.012179209503612884,0.009786864779688924,-0.001957372955937785,0.00391474591187557,0.0010874294199654361,0.008699435359723489,0.05545890041823724,0.08677686771324179,0.05545890041823724,0.03110048141101147,0.03110048141101147,0.08677686771324179,0.11505003263234313],"a_label":"contribution","marker":23},"value":0.9856460262566713,"value_label":"partial normalized dot product"},{"phase":3,"caption":"Keep the signed reference coefficient","panel":{"kind":"bars","title":"All normalized coordinate products","a":[0.11505003263234313,0.09591127484095147,0.07851240412150448,0.026315791963163554,-0.0002174858839930872,0.01174423773562671,0.036755114394831735,0.0628534204740022,0.04893432389844462,0.013701610691564494,0.0006524576519792617,0.012179209503612884,0.009786864779688924,-0.001957372955937785,0.00391474591187557,0.0010874294199654361,0.008699435359723489,0.05545890041823724,0.08677686771324179,0.05545890041823724,0.03110048141101147,0.03110048141101147,0.08677686771324179,0.11505003263234313],"a_label":"contribution","marker":0},"value":0.9856460262566713,"value_label":"final result"},{"phase":3,"caption":"Keep the signed reference coefficient","panel":{"kind":"bars","title":"All normalized coordinate products","a":[0.11505003263234313,0.09591127484095147,0.07851240412150448,0.026315791963163554,-0.0002174858839930872,0.01174423773562671,0.036755114394831735,0.0628534204740022,0.04893432389844462,0.013701610691564494,0.0006524576519792617,0.012179209503612884,0.009786864779688924,-0.001957372955937785,0.00391474591187557,0.0010874294199654361,0.008699435359723489,0.05545890041823724,0.08677686771324179,0.05545890041823724,0.03110048141101147,0.03110048141101147,0.08677686771324179,0.11505003263234313],"a_label":"contribution","marker":7},"value":0.9856460262566713,"value_label":"final result"},{"phase":3,"caption":"Keep the signed reference coefficient","panel":{"kind":"bars","title":"All normalized coordinate products","a":[0.11505003263234313,0.09591127484095147,0.07851240412150448,0.026315791963163554,-0.0002174858839930872,0.01174423773562671,0.036755114394831735,0.0628534204740022,0.04893432389844462,0.013701610691564494,0.0006524576519792617,0.012179209503612884,0.009786864779688924,-0.001957372955937785,0.00391474591187557,0.0010874294199654361,0.008699435359723489,0.05545890041823724,0.08677686771324179,0.05545890041823724,0.03110048141101147,0.03110048141101147,0.08677686771324179,0.11505003263234313],"a_label":"contribution","marker":15},"value":0.9856460262566713,"value_label":"final result"},{"phase":3,"caption":"Keep the signed reference coefficient","panel":{"kind":"bars","title":"All normalized coordinate products","a":[0.11505003263234313,0.09591127484095147,0.07851240412150448,0.026315791963163554,-0.0002174858839930872,0.01174423773562671,0.036755114394831735,0.0628534204740022,0.04893432389844462,0.013701610691564494,0.0006524576519792617,0.012179209503612884,0.009786864779688924,-0.001957372955937785,0.00391474591187557,0.0010874294199654361,0.008699435359723489,0.05545890041823724,0.08677686771324179,0.05545890041823724,0.03110048141101147,0.03110048141101147,0.08677686771324179,0.11505003263234313],"a_label":"contribution","marker":23},"value":0.9856460262566713,"value_label":"final result"}],"checks":{"api":"compare_series(..., n_points=24): spearman_rho","expected":0.9856460262566713,"observed":0.9856460262566712,"tolerance":1e-11},"animation_steps_en":["Use the report's resampled observations.","Assign average ranks, including ties.","Compute Pearson correlation of ranks.","Keep the signed rank coefficient."],"echotime_status":"EchoTime report component / reference metric","echotime_api":"spearman_rho"}
