Let $Y_t = \rho Y_{t-1} + \epsilon_t$ and $Y_0$ be some constant.
I generated a time series data for the above model like this
y=rnorm(1,5,1)
for(i in 1:100)
y=append(y,tail(y,1)+rnorm(1,1,1))
The above is a plot of the same. Now to test the stationarity of this series I used the adf.test
function from the package tseries
in R
. For the above model a Dickey-Fuller Test (i.e adf test with 0 lag) should be enough (and appropriate too) to test for stationarity. However the output of the following code:
> adf.test(y,k = 0)
Augmented Dickey-Fuller Test
data: y
Dickey-Fuller = -3.4732, Lag order = 0, p-value = 0.04793
alternative hypothesis: stationary
Tells that the null hypothesis is rejected at the 5% level and the series is stationary. While from the plot the series is clearly NOT stationary. Can someone explain what's going on?