我正在尝试使用外生回归变量拟合 ar 模型,特别是季节性虚拟变量和具有 AR(3) 误差的趋势。为此,我使用以下代码:
modelo<-Arima(log.licor, order = c(3,0,0), xreg = tend_esta, include.mean = F)
没有包含均值,因为我没有将任何季节性虚拟变量排除在回归之外。
结果
forecast::checkresiduals(modelo, test = "LB")
是:
Ljung-Box test
data: Residuals from Regression with ARIMA(3,0,0) errors
Q* = 77.787, df = 7, p-value = 3.886e-14
Model df: 17. Total lags used: 24
但是
的结果Box.test(residuals(modelo), type = "Ljung-Box")
是
Box-Ljung test
data: residuals(modelo)
X-squared = 1.3407, df = 1, p-value = 0.2469
我的论点有问题吗?每个结果的含义完全不同。
最佳答案
我遇到了同样的问题。在 Box.test
中使用 lag
和 fitdf
参数。所以对于你的问题,看看它在预测版本中是怎么说“Model df: 17”和“Total lags used: 24”的?试试 Box.test 版本中的那些。
关于testing - forecast::checkresiduals 和 Box.test 的不同结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49141746/