【问题标题】:adf test result clearly wrong and contrast with kpss testadf 测试结果明显错误并与 kpss 测试对比
【发布时间】:2018-09-27 15:59:16
【问题描述】:

我正在 R 中运行 adf.test:

x <- rnorm(1000)  # no unit-root
plot(x)
adf.test(x)#p-value = 0.01 thus stationary

y <- diffinv(x)# integrate the stationary series
adf.test(y)# p-value = 0.02847 thus stationary
kpss.test(y)# p-value = 0.01 thus non stattionary
plot(y)

显然这是一个正态分布,结果是 p 值平稳的 但是,我整合了 x 系列并再次执行 adf.test,测试 p 值仍然意味着一个平稳过程,但该图是一个非平稳过程。我对 y 系列使用 kpss 检验,它拒绝平稳假设。谁能告诉我为什么 adf test 会犯这么简单的错误? THX!

【问题讨论】:

    标签: time-series


    【解决方案1】:

    如果你使用tseries包,你的代码可能有错误。

    我检查过

    library(vars)
    library(tseries)
    x <- rnorm(1000)
    plot(x)
    summary(ur.df(x))
    adf.test(x)
    
    y <- diffinv(x)
    plot(y)
    summary(ur.df(y,type=c("trend"),lags=1))
    adf.test(y,k=1)
    summary(ur.kpss(y))
    kpss.test(y)
    

    这为我提供了 x 的平稳过程和 y 的非平稳过程。 (请注意,adf adf.test 始终包含漂移和趋势。ur.df 允许手动设置它们。)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-20
      • 1970-01-01
      • 2022-01-25
      • 1970-01-01
      • 1970-01-01
      • 2013-09-08
      • 1970-01-01
      • 2021-11-21
      相关资源
      最近更新 更多