xis a stationary univariate time series.
kpss.test(x, lag.short = TRUE, output = TRUE)
p.value) and three rows (
type3). Each row is the test results (including lag parameter, test statistic and p.value) for each type of linear regression models.
xis a stationary time series. In order to calculate the test statistic, we consider three types of linear regression models. The first type (
type1) is the one with no drift and deterministic trend, defined as $$x[t] = u[t] + e[t].$$ The second type (
type2) is the one with drift but no trend: $$x[t] = \mu + u[t] + e[t].$$ The third type (
type3) is the one with both drift and trend: $$x[t] = \mu + \alpha*t + u[t] + e[t].$$ The details of calculation of test statistic (
kpss) can be seen in the references below. The default parameter of lag to calculate the test statistic is $max(1,floor(3*sqrt(n)/13)$ for short term effect, otherwise, $max(1,floor(10*sqrt(n)/13)$ for long term effect. The p.value is calculated by the interpolation of test statistic from tables of critical values (Table 5, Hobijn B., Franses PH. and Ooms M (2004)) for a given sample size $n$ = length(
Kwiatkowski, D.; Phillips, P. C. B.; Schmidt, P.; Shin, Y. (1992). Testing the null hypothesis of stationarity against the alternative of a unit root. Journal of Econometrics, 54 (1-3): 159-178.
# KPSS test for AR(1) process x <- arima.sim(list(order = c(1,0,0),ar = 0.2),n = 100) kpss.test(x) # KPSS test for co2 data kpss.test(co2)