{"id":"ar_prediction_error_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.","This is not a held-out forecast evaluation: both models are fitted to the displayed records and only the comparison mechanism is illustrated. Self-error need not be zero."],"caveats_zh":["本例固定二阶，并分别去均值；改变阶数、中心化或估计器都会改变拟合对象。","十六个样本仅用于解释过程，不能据此可靠推断生成机制。","这里并非留出预测评估：模型拟合于展示的记录，仅用于解释比较机制；自比较误差不必为零。"],"title":"Symmetric AR cross-prediction error","intro_en":"Fit centered AR(2) models, apply the x model to y and the y model to x, then average their one-step mean-squared errors. This measures compatibility under a specified predictive model and centering convention. Even a self-comparison can remain positive because fitted innovations are not zero.","intro_zh":"拟合中心化 AR(2) 模型，用 x 的模型预测 y，再用 y 的模型预测 x，最后平均两个一步预测均方误差。它度量指定预测模型和中心化约定下的兼容性；即使自比较，也可能因拟合创新不为零而得到正值。","steps_en":["Fit one centered conditional-OLS AR(2) model to each full input.","Transfer the x coefficients to centered y, and transfer the y coefficients to centered x.","Compute each direction's one-step squared residuals on the available 14 lagged targets.","Average the two directional MSEs; interpret this as error rather than a mathematical metric."],"steps_zh":["分别对完整输入拟合中心化条件最小二乘 AR(2)。","将 x 的系数用于中心化 y，再将 y 的系数用于中心化 x。","对各方向的 14 个可用滞后目标计算一步预测残差平方。","平均两个方向的 MSE，把结果解释为误差分数。"],"formula":"d = (mean((y_centered-A_y phi_x)^2)+mean((x_centered-A_x phi_y)^2))/2","result":{"label":"symmetric cross error","value":0.09704715495001955,"detail":"MSE(x model -> y)=0.047154603; MSE(y model -> x)=0.14693971."},"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":"Use the model fitted on x to predict centered y one step ahead.","panel":{"kind":"lines","title":"x model applied to y: observed versus prediction","a":[0.15783008588991065,0.5924999999999999,0.5878300858899107,-0.0874999999999998,-0.7628300858899106],"a_label":"centered y","b":[0.14619943088486678,0.3024476749138578,0.5092351511334914,0.23547053914057178,-0.45338635164455376],"b_label":"prediction from x model"}},{"phase":1,"caption":"Use the model fitted on x to predict centered y one step ahead.","panel":{"kind":"lines","title":"x model applied to y: observed versus prediction","a":[0.15783008588991065,0.5924999999999999,0.5878300858899107,-0.0874999999999998,-0.7628300858899106,-0.7675000000000001,-0.3328300858899107,0.05249999999999999,0.43783008588991057],"a_label":"centered y","b":[0.14619943088486678,0.3024476749138578,0.5092351511334914,0.23547053914057178,-0.45338635164455376,-0.7272272582442872,-0.31410488659055735,0.1340212595589804,0.25973717405661795],"b_label":"prediction from x model"}},{"phase":1,"caption":"Use the model fitted on x to predict centered y one step ahead.","panel":{"kind":"lines","title":"x model applied to y: observed versus prediction","a":[0.15783008588991065,0.5924999999999999,0.5878300858899107,-0.0874999999999998,-0.7628300858899106,-0.7675000000000001,-0.3328300858899107,0.05249999999999999,0.43783008588991057,0.8724999999999995,0.8678300858899114,0.19250000000000023,-0.48283008588991083,-0.4875000000000004],"a_label":"centered y","b":[0.14619943088486678,0.3024476749138578,0.5092351511334914,0.23547053914057178,-0.45338635164455376,-0.7272272582442872,-0.31410488659055735,0.1340212595589804,0.25973717405661795,0.4159854180856089,0.6227728943052422,0.3490082823123239,-0.33984860847280296,-0.6136895150725363],"b_label":"prediction from x model"}},{"phase":1,"caption":"Reverse the roles: the y model predicts centered x one step ahead.","panel":{"kind":"lines","title":"y model applied to x: observed versus prediction","a":[0.4344744111674237,0.411396103067893,0.01552558883257682,-0.9519216919004692,-0.975],"a_label":"centered x","b":[0.9528943298787959,0.09844290567197123,0.12905926947976584,-0.3422784095966912,-1.1958091036451284],"b_label":"prediction from y model"}},{"phase":1,"caption":"Reverse the roles: the y model predicts centered x one step ahead.","panel":{"kind":"lines","title":"y model applied to x: observed versus prediction","a":[0.4344744111674237,0.411396103067893,0.01552558883257682,-0.9519216919004692,-0.975,-0.4708705142353162,-0.1655255888325764,0.7113961030678927,1.2155255888325764],"a_label":"centered x","b":[0.9528943298787959,0.09844290567197123,0.12905926947976584,-0.3422784095966912,-1.1958091036451284,-0.3742195825604388,0.2721269746987686,0.2082673288499487,1.0289361197762503],"b_label":"prediction from y model"}},{"phase":1,"caption":"Reverse the roles: the y model predicts centered x one step ahead.","panel":{"kind":"lines","title":"y model applied to x: observed versus prediction","a":[0.4344744111674237,0.411396103067893,0.01552558883257682,-0.9519216919004692,-0.975,-0.4708705142353162,-0.1655255888325764,0.7113961030678927,1.2155255888325764,0.6208705142353174,0.2250000000000003,-0.17087051423531652,-0.765525588832576,-0.2613961030678945],"a_label":"centered x","b":[0.9528943298787959,0.09844290567197123,0.12905926947976584,-0.3422784095966912,-1.1958091036451284,-0.3742195825604388,0.2721269746987686,0.2082673288499487,1.0289361197762503,0.8843095197585626,-0.29723436242591994,-0.2662366196992373,-0.40994248955853735,-0.8005132144661251],"b_label":"prediction from y model"}},{"phase":2,"caption":"Accumulate squared cross-prediction errors using the full target count.","panel":{"kind":"bars","title":"Directional squared prediction errors","a":[0.00013527213584635207,0.08413035128787705],"a_label":"x model -> y","b":[0.2687592121167057,0.09793970376033077],"b_label":"y model -> x"},"value":0.01610587640359857,"value_label":"partial symmetric error"},{"phase":2,"caption":"Accumulate squared cross-prediction errors using the full target count.","panel":{"kind":"bars","title":"Directional squared prediction errors","a":[0.00013527213584635207,0.08413035128787705,0.00617716376936581,0.1043099691527515],"a_label":"x model -> y","b":[0.2687592121167057,0.09793970376033077,0.012889896641297903,0.3716649316581239],"b_label":"y model -> x"},"value":0.03378594644722497,"value_label":"partial symmetric error"},{"phase":2,"caption":"Accumulate squared cross-prediction errors using the full target count.","panel":{"kind":"bars","title":"Directional squared prediction errors","a":[0.00013527213584635207,0.08413035128787705,0.00617716376936581,0.1043099691527515,0.09575542466371105,0.0016218937285223355],"a_label":"x model -> y","b":[0.2687592121167057,0.09793970376033077,0.012889896641297903,0.3716649316581239,0.04875666025256506,0.009341402593621814],"b_label":"y model -> x"},"value":0.03933863863431141,"value_label":"partial symmetric error"},{"phase":2,"caption":"Accumulate squared cross-prediction errors using the full target count.","panel":{"kind":"bars","title":"Directional squared prediction errors","a":[0.00013527213584635207,0.08413035128787705,0.00617716376936581,0.1043099691527515,0.09575542466371105,0.0016218937285223355,0.000350633088800503,0.006645715760082654,0.03171708524526094],"a_label":"x model -> y","b":[0.2687592121167057,0.09793970376033077,0.012889896641297903,0.3716649316581239,0.04875666025256506,0.009341402593621814,0.191539766365558,0.25313856344605085,0.03481562996272168],"b_label":"y model -> x"},"value":0.0578460455581855,"value_label":"partial symmetric error"},{"phase":2,"caption":"Accumulate squared cross-prediction errors using the full target count.","panel":{"kind":"bars","title":"Directional squared prediction errors","a":[0.00013527213584635207,0.08413035128787705,0.00617716376936581,0.1043099691527515,0.09575542466371105,0.0016218937285223355,0.000350633088800503,0.006645715760082654,0.03171708524526094,0.20840556350047085,0.06005302714736527,0.024494842432354006],"a_label":"x model -> y","b":[0.2687592121167057,0.09793970376033077,0.012889896641297903,0.3716649316581239,0.04875666025256506,0.009341402593621814,0.191539766365558,0.25313856344605085,0.03481562996272168,0.06940010963107646,0.2727287292984074,0.00909469407135566],"b_label":"y model -> x"},"value":0.08085236577536513,"value_label":"partial symmetric error"},{"phase":2,"caption":"Accumulate squared cross-prediction errors using the full target count.","panel":{"kind":"bars","title":"Directional squared prediction errors","a":[0.00013527213584635207,0.08413035128787705,0.00617716376936581,0.1043099691527515,0.09575542466371105,0.0016218937285223355,0.000350633088800503,0.006645715760082654,0.03171708524526094,0.20840556350047085,0.06005302714736527,0.024494842432354006,0.02044370288437893,0.01592379371424178],"a_label":"x model -> y","b":[0.2687592121167057,0.09793970376033077,0.012889896641297903,0.3716649316581239,0.04875666025256506,0.009341402593621814,0.191539766365558,0.25313856344605085,0.03481562996272168,0.06940010963107646,0.2727287292984074,0.00909469407135566,0.12643934048933086,0.29064725980237216],"b_label":"y model -> x"},"value":0.09704715495001956,"value_label":"partial symmetric error"},{"phase":3,"caption":"Average the two completed directional mean-squared errors.","panel":{"kind":"bars","title":"Two directional MSEs","a":[0.04715460275078779,0.1469397071492513],"a_label":"cross MSE","labels":["x -> y","y -> x"],"marker":0},"value":0.09704715495001955,"value_label":"symmetric error"},{"phase":3,"caption":"Average the two completed directional mean-squared errors.","panel":{"kind":"bars","title":"Two directional MSEs","a":[0.04715460275078779,0.1469397071492513],"a_label":"cross MSE","labels":["x -> y","y -> x"],"marker":1},"value":0.09704715495001955,"value_label":"symmetric error"},{"phase":3,"caption":"Average the two completed directional mean-squared errors.","panel":{"kind":"bars","title":"Two directional MSEs","a":[0.04715460275078779,0.1469397071492513],"a_label":"cross MSE","labels":["x -> y","y -> x"],"marker":0},"value":0.09704715495001955,"value_label":"symmetric error"},{"phase":3,"caption":"Average the two completed directional mean-squared errors.","panel":{"kind":"bars","title":"Two directional MSEs","a":[0.04715460275078779,0.1469397071492513],"a_label":"cross MSE","labels":["x -> y","y -> x"],"marker":1},"value":0.09704715495001955,"value_label":"symmetric error"}],"animation_steps_en":["Fit one centered conditional least-squares AR(2) model to each input.","Use the x model to predict y, then use the y model to predict x.","Compute each direction's one-step mean-squared prediction error.","Average the two errors; even self-error can be positive."],"echotime_status":"Possible addition","echotime_api":""}
