{"id":"ar_distance","family":"model-based","definition":"protocol","x":[0.0,0.8769216919004693,0.8094744111674236,0.7863961030678929,0.3905255888325767,-0.5769216919004693,-0.6000000000000001,-0.09587051423531628,0.2094744111674235,1.0863961030678926,1.5905255888325764,0.9958705142353173,0.6000000000000002,0.20412948576468337,-0.39052558883257615,0.11360389693210537],"y":[-0.2003300858899106,0.185,0.5703300858899106,1.005,1.0003300858899107,0.3250000000000002,-0.35033008588991066,-0.3550000000000001,0.07966991411008931,0.46499999999999997,0.8503300858899105,1.2849999999999995,1.2803300858899114,0.6050000000000002,-0.07033008588991083,-0.07500000000000043],"parameters":{"order":2,"demean":"separately using full series mean","intercept":false,"estimator":"conditional OLS, no regularization","residual_variance":"mean squared fitted residual","beta_x":[1.0243090422834804,-0.6188171023843692],"beta_y":[1.2418713737062936,-0.8788590636409944],"ar_companion_root_radii_x":[0.7866492880466931,0.7866492880466931],"ar_companion_root_radii_y":[0.9374748336040784,0.9374748336040784]},"sources":[{"label":"statsmodels: conditional least-squares autoregression","url":"https://www.statsmodels.org/stable/generated/statsmodels.tsa.ar_model.AutoReg.html"},{"label":"Exact illustrative inputs and encoder definitions","url":"https://github.com/ZipengWu365/EchoTime/blob/main/tools/method_animation_data/feature_model_embedding.py"}],"caveats_en":["The example fixes order two and demeans each series separately. Changing order, centering or estimator changes the fitted object.","Sixteen samples suffice only for an illustration, not a reliable claim about the generating process.","Coefficient similarity does not establish equal innovation noise, nonlinear dependence or causal dynamics."],"caveats_zh":["本例固定二阶，并分别去均值；改变阶数、中心化或估计器都会改变拟合对象。","十六个样本仅用于解释过程，不能据此可靠推断生成机制。","系数相似不能证明创新噪声、非线性依赖或因果动力学相同。"],"title":"Autoregressive-coefficient distance","intro_en":"Fit a separately centered AR(2) model by conditional least squares to each short input, then compare the two lag coefficients. The distance describes this specified fitted linear recurrence. Mean level and innovation variance are excluded from the coefficient vector in this example.","intro_zh":"分别对两条短序列去均值，用条件最小二乘拟合 AR(2)，再比较两个滞后系数。距离描述这一明确指定的线性递推拟合；本例系数向量不包含均值水平和创新方差。","steps_en":["Remove each series' sample mean and construct two lagged predictors.","Fit the same AR(2) equation by ordinary least squares for each input.","Compare the corresponding lag-one and lag-two coefficients.","Take the Euclidean norm of the coefficient difference."],"steps_zh":["去除各序列样本均值，构造两个滞后预测量。","分别用普通最小二乘拟合相同形式的 AR(2) 方程。","比较对应的一阶和二阶滞后系数。","计算系数差的欧氏范数。"],"formula":"z_t = phi_1*z_(t-1)+phi_2*z_(t-2)+e_t; d=||phi_x-phi_y||_2","result":{"label":"distance","value":0.3390504234893716,"detail":"Distance between separately demeaned conditional-OLS AR(2) coefficients."},"frames":[{"phase":0,"caption":"Build 2 lagged rows: x lags in the left columns, y lags in the right.","panel":{"kind":"matrix","title":"AR(2) design: [x lag1, x lag2 | y lag1, y lag2]","z":[[0.5019216919004694,-0.3749999999999999,-0.22749999999999998,-0.6128300858899106],[0.4344744111674237,0.5019216919004694,0.15783008588991065,-0.22749999999999998]],"row_label":"prediction row","col_label":"lagged predictors","cursor":[1,0]}},{"phase":0,"caption":"Build 4 lagged rows: x lags in the left columns, y lags in the right.","panel":{"kind":"matrix","title":"AR(2) design: [x lag1, x lag2 | y lag1, y lag2]","z":[[0.5019216919004694,-0.3749999999999999,-0.22749999999999998,-0.6128300858899106],[0.4344744111674237,0.5019216919004694,0.15783008588991065,-0.22749999999999998],[0.411396103067893,0.4344744111674237,0.5924999999999999,0.15783008588991065],[0.01552558883257682,0.411396103067893,0.5878300858899107,0.5924999999999999]],"row_label":"prediction row","col_label":"lagged predictors","cursor":[3,0]}},{"phase":0,"caption":"Build 6 lagged rows: x lags in the left columns, y lags in the right.","panel":{"kind":"matrix","title":"AR(2) design: [x lag1, x lag2 | y lag1, y lag2]","z":[[0.5019216919004694,-0.3749999999999999,-0.22749999999999998,-0.6128300858899106],[0.4344744111674237,0.5019216919004694,0.15783008588991065,-0.22749999999999998],[0.411396103067893,0.4344744111674237,0.5924999999999999,0.15783008588991065],[0.01552558883257682,0.411396103067893,0.5878300858899107,0.5924999999999999],[-0.9519216919004692,0.01552558883257682,-0.0874999999999998,0.5878300858899107],[-0.975,-0.9519216919004692,-0.7628300858899106,-0.0874999999999998]],"row_label":"prediction row","col_label":"lagged predictors","cursor":[5,0]}},{"phase":0,"caption":"Build 8 lagged rows: x lags in the left columns, y lags in the right.","panel":{"kind":"matrix","title":"AR(2) design: [x lag1, x lag2 | y lag1, y lag2]","z":[[0.5019216919004694,-0.3749999999999999,-0.22749999999999998,-0.6128300858899106],[0.4344744111674237,0.5019216919004694,0.15783008588991065,-0.22749999999999998],[0.411396103067893,0.4344744111674237,0.5924999999999999,0.15783008588991065],[0.01552558883257682,0.411396103067893,0.5878300858899107,0.5924999999999999],[-0.9519216919004692,0.01552558883257682,-0.0874999999999998,0.5878300858899107],[-0.975,-0.9519216919004692,-0.7628300858899106,-0.0874999999999998],[-0.4708705142353162,-0.975,-0.7675000000000001,-0.7628300858899106],[-0.1655255888325764,-0.4708705142353162,-0.3328300858899107,-0.7675000000000001]],"row_label":"prediction row","col_label":"lagged predictors","cursor":[7,0]}},{"phase":0,"caption":"Build 11 lagged rows: x lags in the left columns, y lags in the right.","panel":{"kind":"matrix","title":"AR(2) design: [x lag1, x lag2 | y lag1, y lag2]","z":[[0.5019216919004694,-0.3749999999999999,-0.22749999999999998,-0.6128300858899106],[0.4344744111674237,0.5019216919004694,0.15783008588991065,-0.22749999999999998],[0.411396103067893,0.4344744111674237,0.5924999999999999,0.15783008588991065],[0.01552558883257682,0.411396103067893,0.5878300858899107,0.5924999999999999],[-0.9519216919004692,0.01552558883257682,-0.0874999999999998,0.5878300858899107],[-0.975,-0.9519216919004692,-0.7628300858899106,-0.0874999999999998],[-0.4708705142353162,-0.975,-0.7675000000000001,-0.7628300858899106],[-0.1655255888325764,-0.4708705142353162,-0.3328300858899107,-0.7675000000000001],[0.7113961030678927,-0.1655255888325764,0.05249999999999999,-0.3328300858899107],[1.2155255888325764,0.7113961030678927,0.43783008588991057,0.05249999999999999],[0.6208705142353174,1.2155255888325764,0.8724999999999995,0.43783008588991057]],"row_label":"prediction row","col_label":"lagged predictors","cursor":[10,0]}},{"phase":0,"caption":"Build 14 lagged rows: x lags in the left columns, y lags in the right.","panel":{"kind":"matrix","title":"AR(2) design: [x lag1, x lag2 | y lag1, y lag2]","z":[[0.5019216919004694,-0.3749999999999999,-0.22749999999999998,-0.6128300858899106],[0.4344744111674237,0.5019216919004694,0.15783008588991065,-0.22749999999999998],[0.411396103067893,0.4344744111674237,0.5924999999999999,0.15783008588991065],[0.01552558883257682,0.411396103067893,0.5878300858899107,0.5924999999999999],[-0.9519216919004692,0.01552558883257682,-0.0874999999999998,0.5878300858899107],[-0.975,-0.9519216919004692,-0.7628300858899106,-0.0874999999999998],[-0.4708705142353162,-0.975,-0.7675000000000001,-0.7628300858899106],[-0.1655255888325764,-0.4708705142353162,-0.3328300858899107,-0.7675000000000001],[0.7113961030678927,-0.1655255888325764,0.05249999999999999,-0.3328300858899107],[1.2155255888325764,0.7113961030678927,0.43783008588991057,0.05249999999999999],[0.6208705142353174,1.2155255888325764,0.8724999999999995,0.43783008588991057],[0.2250000000000003,0.6208705142353174,0.8678300858899114,0.8724999999999995],[-0.17087051423531652,0.2250000000000003,0.19250000000000023,0.8678300858899114],[-0.765525588832576,-0.17087051423531652,-0.48283008588991083,0.19250000000000023]],"row_label":"prediction row","col_label":"lagged predictors","cursor":[13,0]}},{"phase":1,"caption":"Expose 1 of 2 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"OLS autoregressive coefficient vectors","a":[1.0243090422834804],"a_label":"x features","b":[1.2418713737062936],"b_label":"y features","labels":["AR lag1"],"marker":0}},{"phase":1,"caption":"Expose 1 of 2 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"OLS autoregressive coefficient vectors","a":[1.0243090422834804],"a_label":"x features","b":[1.2418713737062936],"b_label":"y features","labels":["AR lag1"],"marker":0}},{"phase":1,"caption":"Expose 1 of 2 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"OLS autoregressive coefficient vectors","a":[1.0243090422834804],"a_label":"x features","b":[1.2418713737062936],"b_label":"y features","labels":["AR lag1"],"marker":0}},{"phase":1,"caption":"Expose 1 of 2 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"OLS autoregressive coefficient vectors","a":[1.0243090422834804],"a_label":"x features","b":[1.2418713737062936],"b_label":"y features","labels":["AR lag1"],"marker":0}},{"phase":1,"caption":"Expose 1 of 2 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"OLS autoregressive coefficient vectors","a":[1.0243090422834804],"a_label":"x features","b":[1.2418713737062936],"b_label":"y features","labels":["AR lag1"],"marker":0}},{"phase":1,"caption":"Expose 2 of 2 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"OLS autoregressive coefficient vectors","a":[1.0243090422834804,-0.6188171023843692],"a_label":"x features","b":[1.2418713737062936,-0.8788590636409944],"b_label":"y features","labels":["AR lag1","AR lag2"],"marker":1}},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.04733336805413002],"a_label":"contributions","labels":["AR lag1"],"marker":0},"value":0.21756233142281323,"value_label":"partial distance"},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.04733336805413002],"a_label":"contributions","labels":["AR lag1"],"marker":0},"value":0.21756233142281323,"value_label":"partial distance"},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.04733336805413002],"a_label":"contributions","labels":["AR lag1"],"marker":0},"value":0.21756233142281323,"value_label":"partial distance"},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.04733336805413002],"a_label":"contributions","labels":["AR lag1"],"marker":0},"value":0.21756233142281323,"value_label":"partial distance"},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.04733336805413002],"a_label":"contributions","labels":["AR lag1"],"marker":0},"value":0.21756233142281323,"value_label":"partial distance"},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.04733336805413002,0.0676218216141922],"a_label":"contributions","labels":["AR lag1","AR lag2"],"marker":1},"value":0.3390504234893716,"value_label":"partial distance"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.04733336805413002,0.0676218216141922],"a_label":"contributions","labels":["AR lag1","AR lag2"],"marker":0},"value":0.3390504234893716,"value_label":"final distance"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.04733336805413002,0.0676218216141922],"a_label":"contributions","labels":["AR lag1","AR lag2"],"marker":0},"value":0.3390504234893716,"value_label":"final distance"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.04733336805413002,0.0676218216141922],"a_label":"contributions","labels":["AR lag1","AR lag2"],"marker":1},"value":0.3390504234893716,"value_label":"final distance"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.04733336805413002,0.0676218216141922],"a_label":"contributions","labels":["AR lag1","AR lag2"],"marker":1},"value":0.3390504234893716,"value_label":"final distance"}],"animation_steps_en":["Demean each input and construct two lagged predictors.","Fit the same AR(2) recurrence by conditional least squares.","Compare corresponding lag-one and lag-two coefficients.","Take the Euclidean norm of the coefficient difference."],"echotime_status":"Possible addition","echotime_api":""}
