這裏是輸出:adf.test返回P> 0.99 XTS,但返回P <0.01,與coredata(XTS)
library(tseries) # for adf.test function
adf.test(data)
Augmented Dickey-Fuller Test
data: data
Dickey-Fuller = 11.1451, Lag order = 16, p-value = 0.99
alternative hypothesis: stationary
Warning message:
In adf.test(spread.princomp) : p-value greater than printed p-value
adf.test(coredata(data))
Augmented Dickey-Fuller Test
data: coredata(data)
Dickey-Fuller = -4.031, Lag order = 16, p-value = 0.01
alternative hypothesis: stationary
Warning message:
In adf.test(coredata(spread.princomp)) :
p-value smaller than printed p-value
底層數據是數值向量。人們似乎成功地將adf.test與xts結合使用,所以我不確定我做錯了什麼。請讓我知道我可以提供什麼其他信息。
您應該包括包'adf.test'的名稱。 – 2013-05-08 18:29:27
這可能與snark領域的[近期線索](http://thread.gmane.org/gmane.comp.lang.r.finance/11441/focus=11470)有關。 – GSee 2013-05-08 18:34:29
測試單位根的最好方法是使用'urca'包,它通常更安全。 – dickoa 2013-05-08 18:38:12