ZA_2br | R Documentation |
This function implements Zivot-Andrews sequential ADF unit root test with one unknown structural break. Handling two outlier models: "Innovational outlier" and "Additive outlier".
ZA_2br(y,
model=c("intercept", "both"),
pmax=8,
ic=c("AIC","BIC"),
fixed=TRUE,
trim=0.1,
eq=1,
trace=TRUE,
season=FALSE)
y |
Univariate time series data, a preferable format is |
model |
Modelling where the unknown structural change occurs. |
pmax |
The maximal lags that are either included in the test regression or lag selection searches its optimal lag via "ic". |
ic |
Information criteria, "AIC" or "BIC". The default is "AIC". |
fixed |
Logical. If TURE, pmax is the fixed inputed lags, and the default is TRUE. |
trim |
The trimming percentage. Default is 10 |
eq |
The type of dependent variable in ADF equation. |
trace |
Logical. If TURE, then screen displays the sequential progress. |
season |
Logical. If TURE,then seasonal dummies will be included in the test regression, and y must be in |
This code entends Zivot-Andrews (1992) sequential procedure to two unknown structural changes. Critical values are from Narayan and Popp (2010).
teststat |
The ADF test statistic in the presence of two structural breaks. |
cval |
The critical values that are tabulated in Narayan and Popp (2010). |
p |
The number of lags that are included in the test regression. |
bpoint1 |
The first breaking point that corresponds to the teststat. |
bpoint2 |
The second breaking point that corresponds to the teststat. |
timeElapse |
Time elapsed for sequential search. |
This code modifies function ur.za
of package urca
. We add "season", "eq", "outlier",and "trim".
Specifically, "outlier" is crucial, "season" is left to advanced research.
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University.
Narayan, P. K. and Popp, S. (2010) A new unit root test with two structural breaks in level and slope at unknown time.
Journal of Applied Statistics,37, 1425-1438.
Zivot,E. and Andrews, W.K. (1992),Further Evidence on the Great Crasch, the Oil-Price Shock, and the Unit-Root Hypothesis. Journal of Business & Economic Statistics,10(3), 251-270.
data(macro) # US macro data, 1967M1-2025M7
# It takes time
y=macro[1:200,"INF"]
za2=ZA_2br(y,
ic=c("AIC","BIC")[2],
pmax=8,
fixed=TRUE,
model=c("intercept","trend","both")[1],
trim=0.1,
eq=1,
season=TRUE)
za2$timeElapse[3]/60
za2$teststat
za2$cval
y[za2$bpoint1,] #The first dated strictural change
y[za2$bpoint2,] #The second dated strictural change
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.