An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20110119/a31c901c/attachment.pl>
Howto test for true stationarity with adfTest()
4 messages · Mark Breman, Paul Teetor, Matthieu Stigler
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20110119/1c0f9791/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20110120/41cc9d10/attachment.pl>
I would suggest:
1 test for unit root:
if unit root: stochastic trend
if not: 2
2 test for trend in normal AR(MA) model
if not trend: "pure stationary" as you call
if trend: trend stationary
Note if just the question of trend is of interest for you, you might be
interested in using a test for trend indeopendeant of I(1)/I(0). Such a
test has been developed in:
David I. Harvey, Stephen J. Leybourne, A.M. Robert Taylor
A simple, robust and powerful test of the trend hypothesis, J
Econometrics 2007, 1302-1330
Mat
Le 20. 01. 11 07:48, Mark Breman a ?crit :
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
[1] 0.01
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
0.01
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]]
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
[[alternative HTML version deleted]]
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.