ZA_1br: Zivot-Andrews unit root test with unknown one structural...

View source: R/uroot_breaks.R

ZA_1brR Documentation

Zivot-Andrews unit root test with unknown one structural break.

Description

This function implements Zivot-Andrews sequential ADF unit root test with unknown one structural break. Handling two outlier models: "Innovational outlier" and "Additive outlier".

Usage

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)

Arguments

y

Univariate time series data, a preferable format is ts when season=TRUE.

model

Modelling where the unknown structural change occurs.
intercept= structural change occurs at the intercept.
trend= structural change occurs at the trend.
both= structural changes occur at both the intercept and the trend.

outlier

The outlier model.
1=Innovational outlier model.
2=Additive 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.
1= original y. 2= differenced y.

season

Logical. If TURE,then seasonal dummies will be included in the test regression.

Value

teststat

The Zivot-Andrews test statistic, which is the min(tstats).

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 lm() output that corresponds to teststat.

timeElapse

Time elapsed for sequential search.

Note

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.

Author(s)

Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University.

References

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.

Examples

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)



COINT documentation built on Sept. 9, 2025, 5:51 p.m.

Related to ZA_1br in COINT...