uroot.test: The Unit root tests function

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/test.R

Description

Perform a unit root test to check stationarity in a linear stochastic process.

Usage

1
uroot.test(y,unit_root = c("adf","kpss","pp","box"),alpha = 0.05)

Arguments

y

a numeric vector or an object of the ts class containing a stationary time series.

unit_root

A character string naming the desired unit root test for checking stationarity. Valid values are "adf" for the Augmented Dickey-Fuller, "pp" for the Phillips-Perron, "kpss" for Kwiatkowski, Phillips, Schmidt, and Shin, and "box" for the Ljung-Box. The default value is "adf" for the Augmented Dickey-Fuller test.

alpha

Level of the test, possible values range from 0.01 to 0.1. By default alpha = 0.05 is used

Details

Several different tests are available: In the kpss test, the null hypothesis that y has a stationary root against a unit-root alternative. In the two remaining tests, the null hypothesis is that y has a unit root against a stationary root alternative. By default, alpha = 0.05 is used to select the more likely hypothesis.

Value

a h.test class with the main results of unit root hypothesis test.

Author(s)

Asael Alonzo Matamoros and A. Trapletti

References

Dickey, D. & Fuller, W. (1979). Distribution of the Estimators for Autoregressive Time Series with a Unit Root. Journal of the American Statistical Association. 74, 427-431.

Kwiatkowski, D., Phillips, P., Schmidt, P. & Shin, Y. (1992). Testing the Null Hypothesis of Stationarity against the Alternative of a Unit Root, Journal of Econometrics. 54, 159-178.

Phillips, P. & Perron, P. (1988). Testing for a unit root in time series regression, Biometrika. 72(2), 335-346.

Ljung, G. M. & Box, G. E. P. (1978). On a measure of lack of fit in time series models. Biometrika. 65, 297-303.

See Also

normal.test,seasonal.test

Examples

1
2
3
4
5
6
7
#  stationary  ar process
y = arima.sim(100,model = list(ar = 0.3))
uroot.test(y)

# a random walk process
y = cumsum(y)
uroot.test(y,unit_root = "pp")

nortsTest documentation built on June 17, 2021, 5:06 p.m.