View source: R/stationarytest.R
stationary.test | R Documentation |
Performs stationary test for a univariate time series.
stationary.test(x, method = c("adf", "pp", "kpss"), nlag = NULL,
type = c("Z_rho", "Z_tau"), lag.short = TRUE, output = TRUE)
x |
a numeric vector or univariate time series. |
method |
a character indicating which test to use. The default is
|
nlag |
the lag order to calculate the test statistic, only valid for
|
type |
the test type, only valid for |
lag.short |
a logical value, only valid for |
output |
a logical value indicating to print the results in R console.
The default is |
This function combines the existing functions adf.test
,
pp.test
and
kpss.test
for testing the stationarity of a univariate time series x
.
The results are the same as one of the adf.test
, pp.test
,
kpss.test
, depending on which test are used.
Missing values are removed.
Debin Qiu
x <- arima.sim(list(order = c(1,0,0),ar = 0.2),n = 100)
stationary.test(x) # same as adf.test(x)
stationary.test(x, method = "pp") # same as pp.test(x)
stationary.test(x, method = "kpss") # same as kpss.test(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.