Linear model singular because of large integer datetime in R?

核能气质少年 提交于 2019-12-02 04:22:38

Yes, it could. QR factorization is stable, but is not almighty God.

X <- cbind(1, 1e+11 + 1:10000)
qr(X)$rank
# 1

Here the X is like the model matrix for your linear regression model, where there is a all-1 column for intercept, and there is a sequence for datetime (note the large offset).

If you center the datetime column, these two columns will be orthogonal hence very stable (even when solving normal equation directly!).

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