arch.unitroot.ZivotAndrews

class arch.unitroot.ZivotAndrews(y: ndarray | DataFrame | Series, lags: int | None = None, trend: 'c' | 'ct' | 't' = 'c', trim: float = 0.15, max_lags: int | None = None, method: 'aic' | 'bic' | 't-stat' = 'aic')[source]

Zivot-Andrews structural-break unit-root test

The Zivot-Andrews test can be used to test for a unit root in a univariate process in the presence of serial correlation and a single structural break.

Parameters:
y: ndarray | DataFrame | Series

data series

lags: int | None = None

The number of lags to use in the ADF regression. If omitted or None, method is used to automatically select the lag length with no more than max_lags are included.

trend: 'c' | 'ct' | 't' = 'c'

The trend component to include in the test

  • ”c” - Include a constant (Default)

  • ”t” - Include a linear time trend

  • ”ct” - Include a constant and linear time trend

trim: float = 0.15

percentage of series at begin/end to exclude from break-period calculation in range [0, 0.333] (default=0.15)

max_lags: int | None = None

The maximum number of lags to use when selecting lag length

method: 'aic' | 'bic' | 't-stat' = 'aic'

The method to use when selecting the lag length

  • ”AIC” - Select the minimum of the Akaike IC

  • ”BIC” - Select the minimum of the Schwarz/Bayesian IC

  • ”t-stat” - Select the minimum of the Schwarz/Bayesian IC

Notes

H0 = unit root with a single structural break

Algorithm follows Baum (2004/2015) approximation to original Zivot-Andrews method. Rather than performing an autolag regression at each candidate break period (as per the original paper), a single autolag regression is run up-front on the base model (constant + trend with no dummies) to determine the best lag length. This lag length is then used for all subsequent break-period regressions. This results in significant run time reduction but also slightly more pessimistic test statistics than the original Zivot-Andrews method,

No attempt has been made to characterize the size/power trade-off.

Based on the description in Zivot and Andrews [3]. See [2] for a general discussion of unit root tests. Code tested against Baum [1].

References

Methods

summary()

Summary of test, containing statistic, p-value and critical values

Properties

alternative_hypothesis

The alternative hypothesis

critical_values

Dictionary containing critical values specific to the test, number of observations and included deterministic trend terms.

lags

Sets or gets the number of lags used in the model.

nobs

The number of observations used when computing the test statistic.

null_hypothesis

The null hypothesis

pvalue

Returns the p-value for the test statistic

stat

The test statistic for a unit root

trend

Sets or gets the deterministic trend term used in the test.

valid_trends

List of valid trend terms.

y

Returns the data used in the test statistic