Description Usage Arguments Details Value References See Also Examples
This function performs the Zivot & Andrews unit root test, which allows a break at an unknown point in either the intercept, the linear trend or in both.
1 | ur.za.fast(y, model = c("intercept", "trend", "both"), lag = NULL)
|
y |
a vector or a time series. |
model |
Three choices: “intercept', “trend' or “both'. |
lag |
a scalar chosen as lag. |
This function is written refering to the ur.za
function
in the urza package (Pfaff 2008), but it speeds up executation using the RcppArmadillo package. Allowing a structrual break,
this function returns flag to be 0 if the time series is stationary and 1 if it is a unit root process.
a list consisting of:
flag |
0 if the time series is is stationary; 1 if it is a unit root process. |
teststat |
ZA unit root test statistic. |
Eric Zivot and Donald W K Andrews (1992). Further evidence on the great crash, the oil-price shock, and the unit-root hypothesis. Journal of Business & Economic Statistics, 20(1), 25-44. http://dx.doi.org/10.1198/073500102753410372.
Pfaff, Bernhard (2008). Analysis of Integrated and Cointegrated Time Series with R. Second Edition. Springer, New York. http://www.springer.com/statistics/statistical+theory+and+methods/book/978-0-387-75966-1.
1 2 3 4 5 6 7 8 9 10 11 12 | # this is a box function
set.seed(123)
x=cbfs_red('box')
ur.za.fast(x,'both')
# this is a cliff-ramp
set.seed(123)
x=cbfs_red('cr')
ur.za.fast(x,'both')
# this is a random walk process
set.seed(123)
x=cumsum(rnorm(300))
ur.za.fast(x,'both')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.