{"id":"derivative_similarity","title":"EchoTime derivative similarity","family":"native","definition":"echotime","intro_en":"The derivative component compares local increments after standardizing the input and then standardizing its first differences. It reports the positive part of their Pearson correlation. The animation follows the difference vectors and their normalized product terms, exposing why two signals can share a slow level pattern while differing substantially in their local changes.","intro_zh":"差分分项先标准化输入，再标准化其一阶差分，以两组差分 Pearson 相关的正部分作为相似度。动画追踪差分向量及归一化乘积，说明两条序列即使共享缓慢变化的水平形状，局部变化仍可能不同。","steps_en":["Resample and standardize each original series.","Take first differences and standardize those differences separately.","Compute Pearson correlation of the aligned change vectors.","Clip the correlation to [0,1]."],"steps_zh":["重采样并标准化原序列。","取一阶差分并分别标准化。","计算对齐变化向量的 Pearson 相关。","将相关截至 [0,1]。"],"formula":"max(corr(z(diff(x)),z(diff(y))),0)","caveats_en":["Differencing can amplify measurement noise and reduces the sample count by one.","Anticorrelated changes receive zero similarity after clipping.","Sampling resolution determines which changes are treated as local."],"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"},"result":{"label":"similarity","value":0.8192724527210028,"detail":""},"frames":[{"phase":0,"caption":"Resample and standardize the original level traces","panel":{"kind":"lines","title":"Standardized level inputs","a":[-1.9249938311141905,-1.7067268140429754,-1.2701927799005448,-0.6153917286868987],"a_label":"x","b":[-2.010364037206175,-1.4865014729321389,-1.0583819678664712,-0.6959783756503127],"b_label":"y"}},{"phase":0,"caption":"Resample and standardize the original level traces","panel":{"kind":"lines","title":"Standardized level inputs","a":[-1.9249938311141905,-1.7067268140429754,-1.2701927799005448,-0.6153917286868987,0.039409322526747226,-0.3971247116156834,-0.833658745758114,-1.1246814351864012,-0.9791700904722576,-0.4698803839727553],"a_label":"x","b":[-2.010364037206175,-1.4865014729321389,-1.0583819678664712,-0.6959783756503127,-0.27630724282358066,-0.6501606624163054,-0.767876762594728,-0.8468284161108967,-0.8289252405908301,-0.6437049054498428],"b_label":"y"}},{"phase":0,"caption":"Resample and standardize the original level traces","panel":{"kind":"lines","title":"Standardized level inputs","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],"a_label":"x","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],"b_label":"y"}},{"phase":0,"caption":"Resample and standardize the original level traces","panel":{"kind":"lines","title":"Standardized level inputs","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],"a_label":"x","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],"b_label":"y"}},{"phase":1,"caption":"Take first differences and standardize each change vector","panel":{"kind":"lines","title":"Standardized first differences","a":[0.13569205707299586,0.6864421710751585,1.2371922850773207],"a_label":"x","b":[0.8611829040219345,0.6254594043197607,0.4636640210189587],"b_label":"y"}},{"phase":1,"caption":"Take first differences and standardize each change vector","panel":{"kind":"lines","title":"Standardized first differences","a":[0.13569205707299586,0.6864421710751585,1.2371922850773207,1.2371922850773205,-1.5165582849334895,-1.5165582849334895,-1.1493915422653818,-0.047891314261057395,0.8700255424092123],"a_label":"x","b":[0.8611829040219345,0.6254594043197607,0.4636640210189587,0.6046591511482543,-1.3490321779414889,-0.7184111612757136,-0.6229714384718065,-0.38451071398430725,0.02743127692528874],"b_label":"y"}},{"phase":1,"caption":"Take first differences and standardize each change vector","panel":{"kind":"lines","title":"Standardized first differences","a":[0.13569205707299586,0.6864421710751585,1.2371922850773207,1.2371922850773205,-1.5165582849334895,-1.5165582849334895,-1.1493915422653818,-0.047891314261057395,0.8700255424092123,1.053608913743266,0.6864421710751587,-1.1493915422653815,-1.5165582849334895,-0.9658081709313272,0.31927542840705014,1.2371922850773203],"a_label":"x","b":[0.8611829040219345,0.6254594043197607,0.4636640210189587,0.6046591511482543,-1.3490321779414889,-0.7184111612757136,-0.6229714384718065,-0.38451071398430725,0.02743127692528874,0.6233324430274709,1.1432371499945881,-0.3243591640718407,-1.227461486057608,-1.5486018580235412,-0.5108850431442582,1.060066350152393],"b_label":"y"}},{"phase":1,"caption":"Take first differences and standardize each change vector","panel":{"kind":"lines","title":"Standardized first differences","a":[0.13569205707299586,0.6864421710751585,1.2371922850773207,1.2371922850773205,-1.5165582849334895,-1.5165582849334895,-1.1493915422653818,-0.047891314261057395,0.8700255424092123,1.053608913743266,0.6864421710751587,-1.1493915422653815,-1.5165582849334895,-0.9658081709313272,0.31927542840705014,1.2371922850773203,1.0536089137432667,-0.047891314261057395,-1.149391542265382,-0.9658081709313273,-0.04789131426105795,1.2371922850773203,0.3192754284070508],"a_label":"x","b":[0.8611829040219345,0.6254594043197607,0.4636640210189587,0.6046591511482543,-1.3490321779414889,-0.7184111612757136,-0.6229714384718065,-0.38451071398430725,0.02743127692528874,0.6233324430274709,1.1432371499945881,-0.3243591640718407,-1.227461486057608,-1.5486018580235412,-0.5108850431442582,1.060066350152393,1.7212060650395784,0.7326851101671589,-1.1162851411098784,-1.7222882495717105,-0.7796283351933038,1.3291495472315065,1.1123613457985642],"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.005080681728818813,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.005080681728818813,"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.005080681728818813,0.018667030931331822,0.024940936942286277,0.03252520160443572,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.08121385120687263,"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.005080681728818813,0.018667030931331822,0.024940936942286277,0.03252520160443572,0.08895156200430585,0.047370104287885774,0.031132091410973606,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.24866760891003786,"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.005080681728818813,0.018667030931331822,0.024940936942286277,0.03252520160443572,0.08895156200430585,0.047370104287885774,0.031132091410973606,0.0008006401495724352,0.001037648329821811,0.02855428774778739,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.27906018513721953,"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.005080681728818813,0.018667030931331822,0.024940936942286277,0.03252520160443572,0.08895156200430585,0.047370104287885774,0.031132091410973606,0.0008006401495724352,0.001037648329821811,0.02855428774778739,0.034120269186785304,0.016209377384367084,0.08093551678771471,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":12},"value":0.4103253484960866,"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.005080681728818813,0.018667030931331822,0.024940936942286277,0.03252520160443572,0.08895156200430585,0.047370104287885774,0.031132091410973606,0.0008006401495724352,0.001037648329821811,0.02855428774778739,0.034120269186785304,0.016209377384367084,0.08093551678771471,0.0650283620868944,-0.00709187134854945,0.05702199609037452,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":15},"value":0.525283835324806,"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.005080681728818813,0.018667030931331822,0.024940936942286277,0.03252520160443572,0.08895156200430585,0.047370104287885774,0.031132091410973606,0.0008006401495724352,0.001037648329821811,0.02855428774778739,0.034120269186785304,0.016209377384367084,0.08093551678771471,0.0650283620868944,-0.00709187134854945,0.05702199609037452,0.07884687184846403,-0.0015256196898005587,0.0557847260847049,0.0,0.0,0.0,0.0],"a_label":"contribution","marker":18},"value":0.6583898135681744,"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.005080681728818813,0.018667030931331822,0.024940936942286277,0.03252520160443572,0.08895156200430585,0.047370104287885774,0.031132091410973606,0.0008006401495724352,0.001037648329821811,0.02855428774778739,0.034120269186785304,0.016209377384367084,0.08093551678771471,0.0650283620868944,-0.00709187134854945,0.05702199609037452,0.07884687184846403,-0.0015256196898005587,0.0557847260847049,0.07232174191892918,0.0016233663307638226,0.07149624198038404,0.015441288922751312],"a_label":"contribution","marker":22},"value":0.8192724527210028,"value_label":"partial normalized dot product"},{"phase":3,"caption":"Clip first-difference correlation to [0,1]","panel":{"kind":"bars","title":"All normalized coordinate products","a":[0.005080681728818813,0.018667030931331822,0.024940936942286277,0.03252520160443572,0.08895156200430585,0.047370104287885774,0.031132091410973606,0.0008006401495724352,0.001037648329821811,0.02855428774778739,0.034120269186785304,0.016209377384367084,0.08093551678771471,0.0650283620868944,-0.00709187134854945,0.05702199609037452,0.07884687184846403,-0.0015256196898005587,0.0557847260847049,0.07232174191892918,0.0016233663307638226,0.07149624198038404,0.015441288922751312],"a_label":"contribution","marker":0},"value":0.8192724527210028,"value_label":"final result"},{"phase":3,"caption":"Clip first-difference correlation to [0,1]","panel":{"kind":"bars","title":"All normalized coordinate products","a":[0.005080681728818813,0.018667030931331822,0.024940936942286277,0.03252520160443572,0.08895156200430585,0.047370104287885774,0.031132091410973606,0.0008006401495724352,0.001037648329821811,0.02855428774778739,0.034120269186785304,0.016209377384367084,0.08093551678771471,0.0650283620868944,-0.00709187134854945,0.05702199609037452,0.07884687184846403,-0.0015256196898005587,0.0557847260847049,0.07232174191892918,0.0016233663307638226,0.07149624198038404,0.015441288922751312],"a_label":"contribution","marker":7},"value":0.8192724527210028,"value_label":"final result"},{"phase":3,"caption":"Clip first-difference correlation to [0,1]","panel":{"kind":"bars","title":"All normalized coordinate products","a":[0.005080681728818813,0.018667030931331822,0.024940936942286277,0.03252520160443572,0.08895156200430585,0.047370104287885774,0.031132091410973606,0.0008006401495724352,0.001037648329821811,0.02855428774778739,0.034120269186785304,0.016209377384367084,0.08093551678771471,0.0650283620868944,-0.00709187134854945,0.05702199609037452,0.07884687184846403,-0.0015256196898005587,0.0557847260847049,0.07232174191892918,0.0016233663307638226,0.07149624198038404,0.015441288922751312],"a_label":"contribution","marker":14},"value":0.8192724527210028,"value_label":"final result"},{"phase":3,"caption":"Clip first-difference correlation to [0,1]","panel":{"kind":"bars","title":"All normalized coordinate products","a":[0.005080681728818813,0.018667030931331822,0.024940936942286277,0.03252520160443572,0.08895156200430585,0.047370104287885774,0.031132091410973606,0.0008006401495724352,0.001037648329821811,0.02855428774778739,0.034120269186785304,0.016209377384367084,0.08093551678771471,0.0650283620868944,-0.00709187134854945,0.05702199609037452,0.07884687184846403,-0.0015256196898005587,0.0557847260847049,0.07232174191892918,0.0016233663307638226,0.07149624198038404,0.015441288922751312],"a_label":"contribution","marker":22},"value":0.8192724527210028,"value_label":"final result"}],"checks":{"api":"compare_series(..., n_points=24): derivative_similarity","expected":0.8192724527210028,"observed":0.8192724527210029,"tolerance":1e-11},"animation_steps_en":["Resample and standardize the original series.","Take first differences and standardize them.","Compute Pearson correlation of aligned changes.","Clip the correlation to the interval [0,1]."],"echotime_status":"EchoTime report component / reference metric","echotime_api":"derivative_similarity"}
