ZA_1br | R Documentation |
This function implements Zivot-Andrews sequential ADF unit root test with unknown one structural break. Handling two outlier models: "Innovational outlier" and "Additive outlier".
ZA_1br(y,
model=c("intercept", "trend", "both"),
outlier=1,
pmax=8,
ic=c("AIC","BIC"),
fixed=FALSE,
trim=0.1,
eq=1,
season=FALSE)
y |
Univariate time series data, a preferable format is |
model |
Modelling where the unknown structural change occurs. |
outlier |
The outlier model. |
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. If FALSE, pmax is the maximal lags where lag selection searches its optimal lag. |
trim |
The trimming percentage. Default is 10 |
eq |
The type of dependent variable in ADF equation. |
season |
Logical. If TURE,then seasonal dummies will be included in the test regression. |
teststat |
The Zivot-Andrews test statistic, which is the |
cval |
The critical values that are tabulated in Zivot and Andrews(1992) |
p |
The number of lags that are included in the test regression. |
bpoint |
The breaking point that corresponds to the teststat. |
tstats |
The sequential ADF test statistic. |
testreg |
The |
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.
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 inflation rate, 1958M1-2025M7
y=macro[1:200,"INF"]
za1=ZA_1br(y,
ic=c("AIC","BIC")[2],
outlier=1,
pmax=8,
fixed=TRUE,
model=c("intercept","trend","both")[1],
trim=0.01,
eq=1,
season=TRUE)
za1$timeElapse[3]
za1$teststat
za1$cval
y[za1$bpoint,]
za1$tstats
za1$p
#plotting
plot.ts(za1$tstats,ylim=range(c(za1$tstats,za1$cval)))
abline(h=za1$cval[1],col="red")
abline(h=za1$cval[2],col="blue")
abline(h=za1$cval[3],col="green")
abline(v=za1$bpoint,col="red",lty=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.