Code
Ready-to-use implementations of the methods from my papers, so you can apply them to your own data. These are method packages, not replication files. If you use one, please cite the corresponding paper (each repository has a “How to cite” section).
bubble-test-tv-volatility (MATLAB)
MATLAB implementation of the wild-bootstrap sup-DF / sup-BZ / union test for explosive bubbles that remains valid under time-varying volatility.
- Repository: github.com/yang-zu/bubble-test-tv-volatility
- Paper: Harvey, Leybourne and Zu (2019), Econometric Reviews — see Research
bubble-test-hf-volatility (MATLAB)
MATLAB implementation of the TVPWY test for explosive bubbles that uses jump-robust high-frequency volatility to devolatize low-frequency prices, with real-time date-stamping of explosive episodes.
- Repository: github.com/yang-zu/bubble-test-hf-volatility
- Paper: Boswijk, Yu and Zu, working paper (arXiv:2405.02087) — see Research
dm-different-frequencies (MATLAB)
MATLAB implementation of the two-sample test for comparing the accuracy of forecasts observed at different sampling frequencies (e.g. a monthly forecast against a quarterly one).
- Repository: github.com/yang-zu/dm-different-frequencies
- Paper: Zhang, Zu and Li, Journal of Business and Economic Statistics — see Research
truncated-andrews-bandwidth (R)
R package implementing the truncated Andrews bandwidth for the CUSUM and QS mean-shift tests, with Algorithm 1 for size-calibrated selection of the truncation threshold. Install with remotes::install_github("yang-zu/truncated-andrews-bandwidth").
- Repository: github.com/yang-zu/truncated-andrews-bandwidth
- Paper: Li, Zhang and Zu, Economics Letters — see Research
adaptive-cointegration-test (Ox)
Ox implementation of the adaptive test for cointegration with nonstationary volatility: the Johansen trace test and the spot-covariance-weighted adaptive LR test, each with wild- and volatility-bootstrap p-values (bivariate system, no-cointegration null).
- Repository: github.com/yang-zu/adaptive-cointegration-test
- Paper: Boswijk and Zu (2022), Journal of Business and Economic Statistics — see Research
adaptive-unit-root-test (Ox)
Ox implementation of the adaptive wild-bootstrap unit-root test (DF-GLS and adaptive LR, robust to nonstationary volatility).
- Repository: github.com/yang-zu/adaptive-unit-root-test
- Paper: Boswijk and Zu (2018), The Econometrics Journal — see Research
volatility-adjusted-dm (MATLAB)
MATLAB implementation of the volatility-adjusted Diebold–Mariano tests for equal forecast accuracy that remain valid under heteroskedasticity.
- Repository: github.com/yang-zu/volatility-adjusted-dm
- Paper: Harvey, Leybourne and Zu (2024), Journal of Applied Econometrics — see Research
gdm-unstable-accuracy (MATLAB)
MATLAB implementation of the generalized Diebold–Mariano test for equal average forecast accuracy when relative accuracy varies over time.
- Repository: github.com/yang-zu/gdm-unstable-accuracy
- Paper: Harvey, Leybourne and Zu (2025), Journal of Business and Economic Statistics — see Research
sv-return-distribution-test (MATLAB)
MATLAB implementation of the specification test for stochastic-volatility models based on the return distribution (L2 density and Cramér–von Mises tests).
- Repository: github.com/yang-zu/sv-return-distribution-test
- Paper: Zu and Boswijk (2017), Journal of Empirical Finance — see Research
sv-volatility-density-test (MATLAB)
MATLAB implementation of the specification test for stochastic-volatility models based on the volatility density, recovered by deconvolution of squared returns (L2 tests against the model spot-variance density and the stationary marginal), with optional GMM estimation.
- Repository: github.com/yang-zu/sv-volatility-density-test
- Paper: Zu (2015), Journal of Econometrics — see Research
spot-volatility-hf (Ox)
Ox implementation of the noise-robust local two-scale (TSRV) spot-volatility estimator for high-frequency prices, with a local realised-volatility estimator and data-driven tuning.
- Repository: github.com/yang-zu/spot-volatility-hf
- Paper: Zu and Boswijk (2014), Journal of Econometrics — see Research
variance-function-breaks (MATLAB)
MATLAB implementation of the truncated local-least-squares estimator of the innovation variance function in autoregressions with structural breaks and explosive segments.
- Repository: github.com/yang-zu/variance-function-breaks
- Paper: Harvey, Leybourne and Zu (2023), Journal of Time Series Analysis — see Research