# How to explain this unit root process?

I have a time series $X_t$ (shown below) with a structure break. The stationary test kpss.test() says it has a unit root. How to explain this? Why does $X_t$ have a unit root? Sure it is not constant in mean, so it is non-stationary. But I can not relate its non-stationarity to the concept of unit-root.

x=c(rnorm(1000,0,1),rnorm(1000,10,1))
kpss.test(x)


The $p$-value of the test is 0.01, so we reject the null hypothesis of a stationary process.

For example, a random walk has a unit root but it is constant in mean. So any relationship between unit root and constant-in-mean? Any comments about this?

• Note that a random walk does not have a constant mean; its first difference does. Nov 21 '13 at 9:41

All the tests have their assumptions (usually technical mathematical ones) and it is not uncommon than not the null hypothesis is rejected because of the failure of the assumptions, not because the alternative hypothesis is true. In this particular case KPSS was not designed to safeguard against the structural breaks. If you suspect that there are structural breaks in your data use Zivot-Andrews unit-root test from the package urca, function ur.za.
• Thanks for you answer. When I use PP.test to this time series. It gives me $p=0.01$, which means a wrong assumption of unit root. If I use 'adf.test', it gives $p>0.1$, so we don't have enough evidence to reject the null hypothesis of unit root. A little bit confusing here. Do you have any comments please? Nov 22 '13 at 4:09