Skip to content
exuber

Guide

Settings and critical values

radf() takes only two parameters, the window size and the lag length. The rest of a test's behaviour depends on the critical values you compare the statistic with. The GSADF statistic has no closed-form distribution, so every critical value is simulated, either once for a lookup table or from your own data.

Settings

Two parameters: minw and lag.

minw

default: (0.01 + 1.8/√T)·T

The minimum window size, in observations. If it is too short, the ADF regression inside the window has little power. If it is too long, early and short-lived bubbles fall below the floor and cannot be tested at all. The default is the rule of thumb of Phillips, Shi & Yu, which depends only on the sample size T. Pass an integer to override it.

lag

default: 0

The number of lagged Δy terms in the ADF regression. This is the same augmentation as in an ordinary ADF test, applied inside every recursive window. It is fixed and defaults to 0. The precomputed critical values cover lags 0 to 4, so a run with lags needs no simulation of its own. For the sieve bootstrap, radf_sb_cv(type = "aic" / "bic") can choose the lag automatically, once per series.

Both are arguments to radf(). Its reference entry describes the return value and gives worked examples.

The other choice

Which critical values to read against.

The statistic from radf() needs a critical value before it can be interpreted. There are three ways to get one. They are listed in order of increasing computing cost, and each matches your data more closely than the last:

Precomputed (default)

Monte Carlo tables simulated once for every T up to 4,000 and lags 0–4. They are fetched on first use and cached. You get these when you pass no cv.

Monte Carlo

Simulated under the null (a random walk) for your exact T and minw. This assumes homoskedastic Gaussian innovations. See radf_mc_cv().

Bootstrap

Built from your own data, so it reproduces any heteroskedasticity or autocorrelation the data contain. The wild bootstrap (radf_wb_cv(), radf_wb_ps_cv()) and the sieve bootstrap (radf_sb_cv(), for panels) are both available.

Monte Carlo

Simulate the null directly.

Draw a pure random walk, cumsum(rnorm(n)), run GSADF on it, and repeat. After a few thousand replications, the 90th, 95th and 99th percentiles of the simulated distribution are the critical values for that sample size. They are exact for that T and minw, but they assume homoskedastic Gaussian innovations, which real series rarely have. See radf_mc_cv().

The default tables were built in this way, with 2,000 seeded replications for every lag from 0 to 4 and every sample size up to 4,000. They are served as a lookup, so a typical radf() call does not need to simulate anything (see the shared store below).

Wild bootstrap

Simulate the null from your data.

Instead of drawing fresh Gaussian noise, fit the null model to the actual series, take its residuals, and resample them with random ± sign weights in each replication. Any heteroskedasticity in the data, such as volatility clustering, a variance break or fat tails, carries over into the simulated critical value instead of being assumed away. The method costs more, and its critical values apply to one dataset and cannot be reused for other series. See radf_wb_cv().

Variants

Other bootstraps, for other problems.

  • Skewed innovations. radf_wb_cv(dist_skew = TRUE) draws Hafner's (2020) right-skewed multiplier weights. Use it for series whose returns are strongly right-skewed, such as the cryptocurrencies in the paper's own application.
  • Phillips–Shi wild bootstrap. Fits a null autoregression (lag fixed or chosen by AIC/BIC), resamples its residuals, and simulates a sample of the chosen length. It allows for non-stationary volatility, and real-time monitor() uses it for the training window. See radf_wb_ps_cv().
  • Sieve bootstrap. Fits an autoregression to each series and resamples its residuals, which preserves serial correlation. It gives critical values for the panel statistic. The lag is fixed or chosen by AIC/BIC (Pedersen & Schütte, 2020). See radf_sb_cv().

Shared store

One table, served rather than bundled.

exuber and pyexuber read the same precomputed tables from a small read-only store. It holds one object for each (lag, n) pair, simulated once with 2,000 replications, fetched on first use and cached on disk. In R this happens automatically whenever summary(), datestamp() or autoplot() is called without an explicit cv. In Python the call is exuber.radf_crit(n, lag).

The store covers lag 0 through 4 and every sample size from the smallest the PSY window allows up to n = 4,000. For larger samples, compute your own with radf_mc_cv() or radf_wb_cv().

shared critical-value store, live

Multiple series

Panel statistics come at no extra cost.

There is no separate panel setting. If you pass radf() a matrix or data frame with more than one column, it computes the univariate statistics for every series in one pass. It also returns bsadf_panel and gsadf_panel, the cross-sectional average and its supremum, at almost no extra cost. The panel statistic is tested against the panel critical values from the sieve bootstrap (radf_sb_cv()).