The curious case of ARIMA modelling using R

China☆狼群 提交于 2019-12-04 16:12:21

The problem arises in the stats::arima function when calculating the covariance matrix of the coefficients. The code is not very robust to scale effects due to large numbers, and crashes in computing the inverse of the Hessian matrix in this line:

var <- crossprod(A, solve(res$hessian * n.used, A))

The problem is avoided by simply scaling the data. For example

arima(ts.sim.1/100, order = c(1,0,0))

will work.

The tseries::arma function does not work "perfectly fine" though. It returns a warning message:

In arma(ts.sim.1, order = c(1, 0)) : Hessian negative-semidefinite

This can also be avoided by scaling:

arma(ts.sim.1/1000, order = c(1,0))
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!