验证arima系数
我使用以下示例代码对数据运行AR1进程 (只是我为检查功能而选择的数字): 残差为:验证arima系数,r,R,我使用以下示例代码对数据运行AR1进程 (只是我为检查功能而选择的数字): 残差为: > arima(data_ts,order=c(1,0,0))$resid Time Series: Start = 1 End = 8 Frequency = 1 [1] -1.4581973 0.5521706 0.3383218 0.2487084 -2.3582160 0.8556328 2.0348596 [8] -1.0547538 现在,系数应该是-0.6965,截距应该是
> arima(data_ts,order=c(1,0,0))$resid
Time Series:
Start = 1
End = 8
Frequency = 1
[1] -1.4581973 0.5521706 0.3383218 0.2487084 -2.3582160 0.8556328 2.0348596
[8] -1.0547538
现在,系数应该是-0.6965,截距应该是5.0323。我想核实一下结果。因此,我将相应地分配参数,即:
data[8] = intercept + coefficcient_data[7] + residual[8]
但它永远不会正确。我做错了什么?顺便说一句-尝试ar函数会产生不同的结果:
ar(x = data_ts, aic = FALSE, order.max = 1, method = "ols")
Coefficients:
1
-0.6786
Intercept: 0.3527 (0.4951)
选择的订单1西格玛^2估计为1.709。但是,当我将时间序列参数分配到估计的方程+误差上时,结果是不正确的。有什么想法吗?好的,在
实际截距为:截距*(1-系数)@VincentBonhome-谢谢!
ar(x = data_ts, aic = FALSE, order.max = 1, method = "ols")
Coefficients:
1
-0.6786
Intercept: 0.3527 (0.4951)