Thanks Paul, you are right; if the trend is stronger it's revealed by the
adfTest.
As a follow-up question:
Does anyone know if a test exists that would reveal a weaker trend in the
data?
Regards,
-Mark-
2011/1/19 Paul Teetor<paulteetor at yahoo.com>
Mark,
The adfTest with type="nc" works for me. I think your trend time series is
not "trendy" enough. When I change the assignment statement to this:
trend=notrend+(row(notrend)*.4) # Change 0.04 to 0.4
and execute this:
adfTest(coredata(trend), lag=0, type='nc')@test$p.value
I get a p-value of 0.98.
Paul Teetor, Elgin, IL USA
http://quanttrader.info/public
------------------------------
*From:* Mark Breman<breman.mark at gmail.com>
*To:* r-sig-finance at r-project.org
*Sent:* Wed, January 19, 2011 4:38:56 AM
*Subject:* [R-SIG-Finance] Howto test for true stationarity with adfTest()
Hi everyone,
I want to test for true stationarity (not trend-stationarity) in my
timeseries. I understand that i can't use the adf.test(), because it
de-trends the series.
Indeed, i can verify this:
notrend=xts(rnorm(100), Sys.Date()-100:1)
trend=notrend+(row(notrend)*.04)
adf.test(coredata(notrend), alternative="stationary", k=0)$p.value
adf.test(coredata(trend), alternative="stationary", k=0)$p.value
[1] 0.01
The p-values are the same so it's not usable for my purpose.
I'm told i can use the adfTest() from package fUnitRoots instead because
this test does not de-trend the series.
So i try:
library(fUnitRoots)
adfTest(coredata(notrend), lag=0, type='c')@test$p.value
adfTest(coredata(trend), lag=0, type='c')@test$p.value
0.01
Again, the p-values are the same!? Changing the type parameter (to 'ct' or
'nc') does not help either (it gives the same p-values).
What am i doing wrong here?
Thanks,
-Mark-
[[alternative HTML version deleted]]