ur.za.fast: Unit root test for events considering a structrual break

Description Usage Arguments Details Value References See Also Examples

View source: R/ur.za.fast.R

Description

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.

Usage

1
ur.za.fast(y, model = c("intercept", "trend", "both"), lag = NULL)

Arguments

y

a vector or a time series.

model

Three choices: “intercept', “trend' or “both'.

lag

a scalar chosen as lag.

Details

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.

Value

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.

References

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.

See Also

noiseTests

Examples

 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')

Example output

Warning message:
no DISPLAY variable so Tk is not available 
$flag
[1] 0

$teststat
[1] -5.112709

$flag
[1] 0

$teststat
[1] -12.05105

$flag
[1] 1

$teststat
[1] -3.738567

TED documentation built on May 2, 2019, 4:26 a.m.