fintech-algorithms

Zivot-Andrews Break Test

Install and import

bash
npm install fintech-algorithms
ts
import { zivotAndrews } from "fintech-algorithms/statistical-time-series/diagnostics/zivot-andrews-break-test";

Signature

zivotAndrews(values, lags, trim, criticalValue)

Worked example

executed Captured by running this function on the input its own test provides. Real output of real code — but not asserted against a published figure.

Input

values
[10.34556492, 11.02095, 9.20624589, 10.31211299, 10.28712609, 9.63521836]

Showing 6 of 96 elements.

lags
1
trim
0.15
criticalValue
-4.8

Call

zivotAndrews(values, lags, trim, criticalValue)

Returns

object with 17 fields: method, variant, nobs, lags, trim, candidate_start, candidate_end, scan, …

{
  "method": "zivot_andrews",
  "variant": "intercept-break-fixed-lag",
  "nobs": 96,
  "lags": 1,
  "trim": 0.15,
  "candidate_start": 15,
  "candidate_end": 80,
  "scan": [
    {
      "break_index": 15,
      "statistic": -2.5968971047294005,
      "gamma": -0.16587948752228582,
      "gamma_standard_error": 0.06387603390992676,
      "level_shift": -0.04138705771243637,
      "residual_sse": 63.10830583976075
    },
    {
      "break_index": 16,
      "statistic": -2.5793149673915057,
      "gamma": -0.16477543600586345,
      "gamma_standard_error": 0.06388341016471631,
      "level_shift": -0.01654423349541098,
      "residual_sse": 63.11836401077814
    },
    {
      "break_index": 17,
      "statistic": -2.570119387857429,
      "gamma": -0.16400056863572565,
      "gamma_standard_error": 0.0638104865519279,
      "level_shift": 0.0005933378039946896,
      "residual_sse": 63.12032010539862
    }
  ],
  "break_index": 47,
  "statistic": -7.029594549659584,
  "gamma": -0.5990847849626595,
  "gamma_standard_error": 0.08522323453088355,
  "level_shift": 3.0605819661853846,
  "critical_value": -4.8
}

Showing 14 of 17 fields.

Other exports

This module also exports acf, pacf, adf, kpss, ljungBox, runDiagnostic. Every module additionally exports run as an alias of its primary function, and a meta object carrying its catalog id, domain, family, shape and article URL.

Diagrams

Zivot-Andrews Break Test — diagnostic anatomy

How it works

This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.

Read the article →

References

  • Further Evidence on the Great Crash, the Oil-Price Shock, and the Unit-Root Hypothesis
  • statsmodels.tsa.stattools.zivot_andrews
  • Evidence decisions