{"id":"shift_rmse_distance","title":"Shifted RMSE","family":"sliding","definition":"reference","intro_en":"Shifted RMSE evaluates sqrt(mean of squared overlap errors) after each permitted integer shift, using only samples that overlap. This example admits lags from minus three to plus three samples, leaving at least seven paired observations. The animation shows the actual overlap pairs and candidate scores before selecting their minimum.","intro_zh":"Shifted RMSE 在每个允许的整数平移后，仅对重叠样本计算对应分数。本例滞后范围为 −3 至 +3 个采样点，始终保留至少七对观测。动图展示实际配对和候选分数，再选择最小值。","steps_en":["Fix the permitted lags and minimum acceptable overlap before scoring.","At each lag, compute sqrt(mean of squared overlap errors) on the actual paired samples.","Record every candidate score together with its lag.","Choose the minimum overlap score."],"steps_zh":["先固定允许滞后与最小可接受重叠长度。","对每个滞后的实际配对样本计算对应分数。","记录所有候选分数及其滞后。","选取最小重叠分数。"],"formula":"min_{lag=-3,...,3} sqrt(mean((x_overlap-y_overlap)^2))","caveats_en":["Averaging adjusts for overlap length but a tiny overlap can still give an unstable optimum.","The bounded window is an explicit demonstration choice; allowing every possible lag changes the problem.","Overlap cropping removes unmatched endpoints from this score."],"caveats_zh":["平均化调整了重叠长度影响，但很短的重叠仍可能产生不稳定最优点。","有界窗口是明确的演示选择；允许所有滞后会改变问题。","重叠裁剪会从分数中排除未匹配的两端。"],"sources":[{"label":"Imported registry: overlap-based shift definitions","url":"https://github.com/ZipengWu365/EchoTime/blob/main/src/echotime/data/ts_similarity_package_v2_registry.csv"},{"label":"SciPy: euclidean","url":"https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.euclidean.html"}],"x":[1.0,1.1,1.8,3.1,2.4,1.3,0.8,0.9,1.1,1.0],"y":[1.0,1.025244129544237,1.0272789228047705,1.104233600241796,1.7772959251407623,3.071232271760106,2.3916175350540323,1.3197095979615636,0.8296807473987015,0.9123635545572527],"input_label":"Deterministic synthetic illustration; sample index is the time axis.","parameters":{"lags":[-3,-2,-1,0,1,2,3],"minimum_overlap":7,"normalization":"none beyond stated mean/root","selected_lag":-2},"result":{"label":"distance","value":0.021206303371600264,"detail":""},"frames":[{"phase":0,"caption":"Use the declared bounded lag window: -3 to +3 samples","panel":{"kind":"lines","title":"Original input; no hidden standardization","a":[1.0,1.1,1.8],"a_label":"x","b":[1.0,1.025244129544237,1.0272789228047705],"b_label":"y"}},{"phase":0,"caption":"Use the declared bounded lag window: -3 to +3 samples","panel":{"kind":"lines","title":"Original input; no hidden standardization","a":[1.0,1.1,1.8,3.1,2.4],"a_label":"x","b":[1.0,1.025244129544237,1.0272789228047705,1.104233600241796,1.7772959251407623],"b_label":"y"}},{"phase":0,"caption":"Use the declared bounded lag window: -3 to +3 samples","panel":{"kind":"lines","title":"Original input; no hidden standardization","a":[1.0,1.1,1.8,3.1,2.4,1.3,0.8],"a_label":"x","b":[1.0,1.025244129544237,1.0272789228047705,1.104233600241796,1.7772959251407623,3.071232271760106,2.3916175350540323],"b_label":"y"}},{"phase":0,"caption":"Use the declared bounded lag window: -3 to +3 samples","panel":{"kind":"lines","title":"Original input; no hidden standardization","a":[1.0,1.1,1.8,3.1,2.4,1.3,0.8,0.9,1.1,1.0],"a_label":"x","b":[1.0,1.025244129544237,1.0272789228047705,1.104233600241796,1.7772959251407623,3.071232271760106,2.3916175350540323,1.3197095979615636,0.8296807473987015,0.9123635545572527],"b_label":"y"}},{"phase":1,"caption":"Lag -3: sqrt(mean of squared overlap errors)","panel":{"kind":"alignment","title":"Overlap correspondence at lag -3","a":[1.0,1.1,1.8,3.1,2.4,1.3,0.8,0.9,1.1,1.0],"b":[1.0,1.025244129544237,1.0272789228047705,1.104233600241796,1.7772959251407623,3.071232271760106,2.3916175350540323,1.3197095979615636,0.8296807473987015,0.9123635545572527],"pairs":[[0,3],[1,4],[2,5],[3,6],[4,7],[5,8],[6,9]]},"value":0.7548211462265637,"value_label":"current overlap score"},{"phase":1,"caption":"Lag -2: sqrt(mean of squared overlap errors)","panel":{"kind":"alignment","title":"Overlap correspondence at lag -2","a":[1.0,1.1,1.8,3.1,2.4,1.3,0.8,0.9,1.1,1.0],"b":[1.0,1.025244129544237,1.0272789228047705,1.104233600241796,1.7772959251407623,3.071232271760106,2.3916175350540323,1.3197095979615636,0.8296807473987015,0.9123635545572527],"pairs":[[0,2],[1,3],[2,4],[3,5],[4,6],[5,7],[6,8],[7,9]]},"value":0.021206303371600264,"value_label":"current overlap score"},{"phase":1,"caption":"Lag -1: sqrt(mean of squared overlap errors)","panel":{"kind":"alignment","title":"Overlap correspondence at lag -1","a":[1.0,1.1,1.8,3.1,2.4,1.3,0.8,0.9,1.1,1.0],"b":[1.0,1.025244129544237,1.0272789228047705,1.104233600241796,1.7772959251407623,3.071232271760106,2.3916175350540323,1.3197095979615636,0.8296807473987015,0.9123635545572527],"pairs":[[0,1],[1,2],[2,3],[3,4],[4,5],[5,6],[6,7],[7,8],[8,9]]},"value":0.682478691443871,"value_label":"current overlap score"},{"phase":1,"caption":"Lag +0: sqrt(mean of squared overlap errors)","panel":{"kind":"alignment","title":"Overlap correspondence at lag +0","a":[1.0,1.1,1.8,3.1,2.4,1.3,0.8,0.9,1.1,1.0],"b":[1.0,1.025244129544237,1.0272789228047705,1.104233600241796,1.7772959251407623,3.071232271760106,2.3916175350540323,1.3197095979615636,0.8296807473987015,0.9123635545572527],"pairs":[[0,0],[1,1],[2,2],[3,3],[4,4],[5,5],[6,6],[7,7],[8,8],[9,9]]},"value":1.0440761045294178,"value_label":"current overlap score"},{"phase":1,"caption":"Lag +1: sqrt(mean of squared overlap errors)","panel":{"kind":"alignment","title":"Overlap correspondence at lag +1","a":[1.0,1.1,1.8,3.1,2.4,1.3,0.8,0.9,1.1,1.0],"b":[1.0,1.025244129544237,1.0272789228047705,1.104233600241796,1.7772959251407623,3.071232271760106,2.3916175350540323,1.3197095979615636,0.8296807473987015,0.9123635545572527],"pairs":[[1,0],[2,1],[3,2],[4,3],[5,4],[6,5],[7,6],[8,7],[9,8]]},"value":1.259362322939743,"value_label":"current overlap score"},{"phase":1,"caption":"Lag +2: sqrt(mean of squared overlap errors)","panel":{"kind":"alignment","title":"Overlap correspondence at lag +2","a":[1.0,1.1,1.8,3.1,2.4,1.3,0.8,0.9,1.1,1.0],"b":[1.0,1.025244129544237,1.0272789228047705,1.104233600241796,1.7772959251407623,3.071232271760106,2.3916175350540323,1.3197095979615636,0.8296807473987015,0.9123635545572527],"pairs":[[2,0],[3,1],[4,2],[5,3],[6,4],[7,5],[8,6],[9,7]]},"value":1.3373082361668747,"value_label":"current overlap score"},{"phase":1,"caption":"Lag +3: sqrt(mean of squared overlap errors)","panel":{"kind":"alignment","title":"Overlap correspondence at lag +3","a":[1.0,1.1,1.8,3.1,2.4,1.3,0.8,0.9,1.1,1.0],"b":[1.0,1.025244129544237,1.0272789228047705,1.104233600241796,1.7772959251407623,3.071232271760106,2.3916175350540323,1.3197095979615636,0.8296807473987015,0.9123635545572527],"pairs":[[3,0],[4,1],[5,2],[6,3],[7,4],[8,5],[9,6]]},"value":1.365853618290573,"value_label":"current overlap score"},{"phase":2,"caption":"Compare scores only over the admitted lag window","panel":{"kind":"lines","title":"Candidate score versus lag","a":[0.7548211462265637],"a_label":"overlap score","marker":0,"x":[-3.0]},"value":0.7548211462265637,"value_label":"best candidate so far"},{"phase":2,"caption":"Compare scores only over the admitted lag window","panel":{"kind":"lines","title":"Candidate score versus lag","a":[0.7548211462265637,0.021206303371600264],"a_label":"overlap score","marker":1,"x":[-3.0,-2.0]},"value":0.021206303371600264,"value_label":"best candidate so far"},{"phase":2,"caption":"Compare scores only over the admitted lag window","panel":{"kind":"lines","title":"Candidate score versus lag","a":[0.7548211462265637,0.021206303371600264,0.682478691443871],"a_label":"overlap score","marker":2,"x":[-3.0,-2.0,-1.0]},"value":0.021206303371600264,"value_label":"best candidate so far"},{"phase":2,"caption":"Compare scores only over the admitted lag window","panel":{"kind":"lines","title":"Candidate score versus lag","a":[0.7548211462265637,0.021206303371600264,0.682478691443871,1.0440761045294178],"a_label":"overlap score","marker":3,"x":[-3.0,-2.0,-1.0,0.0]},"value":0.021206303371600264,"value_label":"best candidate so far"},{"phase":2,"caption":"Compare scores only over the admitted lag window","panel":{"kind":"lines","title":"Candidate score versus lag","a":[0.7548211462265637,0.021206303371600264,0.682478691443871,1.0440761045294178,1.259362322939743],"a_label":"overlap score","marker":4,"x":[-3.0,-2.0,-1.0,0.0,1.0]},"value":0.021206303371600264,"value_label":"best candidate so far"},{"phase":2,"caption":"Compare scores only over the admitted lag window","panel":{"kind":"lines","title":"Candidate score versus lag","a":[0.7548211462265637,0.021206303371600264,0.682478691443871,1.0440761045294178,1.259362322939743,1.3373082361668747],"a_label":"overlap score","marker":5,"x":[-3.0,-2.0,-1.0,0.0,1.0,2.0]},"value":0.021206303371600264,"value_label":"best candidate so far"},{"phase":2,"caption":"Compare scores only over the admitted lag window","panel":{"kind":"lines","title":"Candidate score versus lag","a":[0.7548211462265637,0.021206303371600264,0.682478691443871,1.0440761045294178,1.259362322939743,1.3373082361668747,1.365853618290573],"a_label":"overlap score","marker":6,"x":[-3.0,-2.0,-1.0,0.0,1.0,2.0,3.0]},"value":0.021206303371600264,"value_label":"best candidate so far"},{"phase":3,"caption":"Select the smallest overlap error","panel":{"kind":"lines","title":"Complete bounded lag scan","a":[0.7548211462265637,0.021206303371600264,0.682478691443871,1.0440761045294178,1.259362322939743,1.3373082361668747,1.365853618290573],"a_label":"candidate score","marker":1,"x":[-3.0,-2.0,-1.0,0.0,1.0,2.0,3.0]},"value":0.021206303371600264,"value_label":"final result"},{"phase":3,"caption":"Select the smallest overlap error","panel":{"kind":"lines","title":"Complete bounded lag scan","a":[0.7548211462265637,0.021206303371600264,0.682478691443871,1.0440761045294178,1.259362322939743,1.3373082361668747,1.365853618290573],"a_label":"candidate score","marker":1,"x":[-3.0,-2.0,-1.0,0.0,1.0,2.0,3.0]},"value":0.021206303371600264,"value_label":"final result"},{"phase":3,"caption":"Select the smallest overlap error","panel":{"kind":"lines","title":"Complete bounded lag scan","a":[0.7548211462265637,0.021206303371600264,0.682478691443871,1.0440761045294178,1.259362322939743,1.3373082361668747,1.365853618290573],"a_label":"candidate score","marker":1,"x":[-3.0,-2.0,-1.0,0.0,1.0,2.0,3.0]},"value":0.021206303371600264,"value_label":"final result"},{"phase":3,"caption":"Select the smallest overlap error","panel":{"kind":"lines","title":"Complete bounded lag scan","a":[0.7548211462265637,0.021206303371600264,0.682478691443871,1.0440761045294178,1.259362322939743,1.3373082361668747,1.365853618290573],"a_label":"candidate score","marker":1,"x":[-3.0,-2.0,-1.0,0.0,1.0,2.0,3.0]},"value":0.021206303371600264,"value_label":"final result"}],"animation_steps_en":["Fix lags from -3 to +3 and retain adequate overlap.","Compute RMSE on each actual overlap.","Record every candidate score with its lag.","Choose the minimum overlap error."],"echotime_status":"Possible addition","echotime_api":""}
