radf_wb_cv generates critical values for the recursive unit root tests
with the wild bootstrap of Harvey et al. (2016), which is asymptotically
robust to non-stationary volatility. radf_wb_distr computes the
distribution.
Usage
radf_wb_cv(
data,
minw = NULL,
nboot = 500L,
dist_rad = FALSE,
dist_skew = FALSE,
seed = NULL
)
radf_wb_distr(
data,
minw = NULL,
nboot = 500L,
dist_rad = FALSE,
dist_skew = FALSE,
seed = NULL
)Arguments
- data
A univariate or multivariate numeric time series object, a numeric vector or matrix, or a data.frame. A column may have leading or trailing
NAvalues, which describes an unbalanced panel in which series enter or exit the sample at different times. Those periods are filled withNAinbadfandbsadfand excluded from theadf,sadfandgsadfof that series. InteriorNAvalues (a gap in the middle of a series) are not supported. When any series is padded in this way, the panel statistics (bsadf_panelandgsadf_panel) are not available, and the function returnsNAfor them with a warning.- minw
A positive integer. The minimum window size (default = \((0.01 + 1.8/\sqrt{T})T\), where T denotes the sample size).
- nboot
A positive integer. Number of bootstraps (default = 500L).
- dist_rad
Logical. If TRUE then the Rademacher distribution will be used.
- dist_skew
Logical. If TRUE, use the fixed right-skewed multiplier distribution of Hafner (2020) instead of the default standard normal or (
dist_rad = TRUE) Rademacher one. It is appropriate when the return distribution of the series is itself clearly right-skewed, as for the cryptocurrency returns in the application of that paper. At most one ofdist_radanddist_skewmay beTRUE.- seed
An object specifying if and how the random number generator (rng) should be initialized. It is either NULL or an integer, which is passed to
set.seedbefore the simulation. If you set it, the value is saved as the "seed" attribute of the returned value. The default, NULL, leaves the state of the rng unchanged and returns .Random.seed as the "seed" attribute. Results are reproducible across the parallel and the non-parallel option when you use the same seed.
Value
For radf_wb_cv, a list with the critical values for the ADF,
BADF, BSADF and GSADF tests. For radf_wb_distr, a list with the ADF,
SADF and GSADF distributions.
Details
The function applies a wild bootstrap re-sampling scheme to construct the bootstrap analogue of the test of Phillips et al. (2015). The bootstrap test is asymptotically robust to non-stationary volatility.
References
Harvey, D. I., Leybourne, S. J., Sollis, R., & Taylor, A. M. R. (2016). Tests for explosive financial bubbles in the presence of non-stationary volatility. Journal of Empirical Finance, 38(Part B), 548-574.
Phillips, P. C. B., Shi, S., & Yu, J. (2015). Testing for Multiple Bubbles: Historical Episodes of Exuberance and Collapse in the S&P 500. International Economic Review, 56(4), 1043-1078. doi:10.1111/iere.12132
Hafner, C. M. (2020). Testing for bubbles in cryptocurrencies with time-varying volatility. Journal of Financial Econometrics, 18(2), 233-249.
See also
radf_mc_cv for Monte Carlo critical values and
radf_sb_cv for sieve bootstrap critical values.
Other critical values:
radf_common_cv(),
radf_mc_cv(),
radf_recovery_cv(),
radf_sb_cv(),
radf_sbz_cv(),
radf_sign_cv(),
radf_sign_dm_cv(),
radf_tt_cv(),
radf_wb_ps_cv()
Examples
# \donttest{
# Volatility triples half-way through the sample. This is the case of
# non-stationary volatility that the wild bootstrap is built for, and plain
# radf_mc_cv() over-rejects here
y <- sim_psy1(n = 200, seed = 1, e = sim_vol_break(199))
# Default minimum window
wb <- radf_wb_cv(y)
tidy(wb)
#> # A tibble: 3 × 5
#> id sig adf sadf gsadf
#> <fct> <fct> <dbl> <dbl> <dbl>
#> 1 series1 90 -0.135 3.82 4.32
#> 2 series1 95 0.276 4.81 5.22
#> 3 series1 99 1.16 6.57 7.24
# Change the minimum window and the number of bootstraps
wb2 <- radf_wb_cv(y, nboot = 600, minw = 20)
tidy(wb2)
#> # A tibble: 3 × 5
#> id sig adf sadf gsadf
#> <fct> <fct> <dbl> <dbl> <dbl>
#> 1 series1 90 -0.209 3.98 4.52
#> 2 series1 95 0.0593 5.02 5.37
#> 3 series1 99 0.913 7.01 7.39
# Simulate distribution
wdist <- radf_wb_distr(y)
autoplot(wdist)
# Apply the critical values to actual data
rsim_data <- radf(y, minw = 20)
autoplot(rsim_data, cv = wb2)
# }
