Description Usage Arguments Details Value Author(s) References See Also Examples
Perform a unit root test to check stationarity in a linear stochastic process.
1 | uroot.test(y,unit_root = c("adf","kpss","pp","box"),alpha = 0.05)
|
y |
a numeric vector or an object of the |
unit_root |
A character string naming the desired unit root test for checking stationarity.
Valid values are |
alpha |
Level of the test, possible values range from 0.01 to 0.1. By default |
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.
a h.test class with the main results of unit root hypothesis test.
Asael Alonzo Matamoros and A. Trapletti
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.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.