R strucchange vs SAS proc autoreg for bai perron

R strucchange vs SAS proc autoreg for bai perron

当我使用 Bai 和 Perron (1998, 2003) 最小 BIC 估计结构断裂时,R strucchange 包的结果与 SAS proc autoreg 的结果不匹配。发现的断点数量根本不一样。我的数据有大约 20,000 个观察值,所以我很难在这里重现问题。但是谁能解释为什么发现的中断次数不同?下面是我用来估计中断的 R 和 SAS 代码的示例。

R代码为:

library(lmtest)
library(sandwich)
library(strucchange)

data.bp <- breakpoints(formula, data)
coeftest(data.bp)
coeftest(data.bp, vcov = NeweyWest)

SAS 代码是:

proc autoreg data=data;
model formula / BP=(EPS=0.15, PRINTEST=BIC);

我不想这么说,但您可能需要为我们提供一个更简单的示例来帮助您调试它。也许 strucchange 包是错误的,或者它可能使用了不同的假设。我从这里提取了源包:https://cran.r-project.org/web/packages/strucchange/index.html and the source is just over 6,500 lines with a least a third of that being test values. If you come up with a simple example you can share we can look into it further. https://whosebug.com/help/mcve 您可能还想查看源代码,因为正如我所说,包中内置了测试值,可以让您深入了解所做的不同——或错误,为您的需要。