Skip to contents

dating_hlw extends dating_hls to series with more than one explosive episode: it first runs PSY's existing detection and dating (radf/datestamp) to locate a preliminary start/end for each episode, splits the sample into disjoint date windows around them, then re-dates each window with dating_hls-style SSR/BIC fitting (restricted to Models 2 and 4 for every window but the last).

Usage

dating_hlw(
  data,
  cv = NULL,
  minw = NULL,
  trim = 0.1,
  min_duration = NULL,
  nboot = 199L,
  seed = NULL
)

# S3 method for class 'dating_hlw_obj'
autoplot(object, ...)

Arguments

data

A univariate or multivariate numeric time series object, a numeric vector or matrix, or a data.frame. A column may have leading and/or trailing NA values (an uneven/unbalanced panel where series enter or exit the sample at different times) – those periods are filled with NA in badf/bsadf and excluded from that series' adf/sadf/ gsadf. Interior NA values (a gap in the middle of a series) are not supported. When any series is padded this way, the panel statistic (bsadf_panel/gsadf_panel) is not available and is returned as NA, with a warning.

cv

Critical values for the step-1 PSY detection/dating step, as accepted by datestamp. Default NULL computes radf_wb_cv internally.

minw

Minimum window size for the step-1 radf call. Default psy_minw.

trim

Minimum fraction of the (differenced) sample required in every regime (default 0.05, following Harvey, Leybourne & Sollis's own empirical-application choice; their simulations use 0.1).

min_duration

Minimum duration (in observations) for a step-1 PSY episode to be counted. Default psy_ds (HLW's own \(\ln(T)\) rule).

nboot, seed

Passed to radf_wb_cv when cv is not supplied.

object

An object of class dating_hlw_obj, the output of dating_hlw.

Value

An object of class dating_hlw_obj: a list, one element per series, each a data frame with one row per detected episode (model, origination, collapse, recovery). A series with no step-1 detected episode gets a zero-row data frame.

Details

When exactly one episode is detected, this reduces to dating_hls applied to the whole series – the paper's own stated property, since the single window then runs [1, n] and fits all four models.

Note

The step-2 SSR/BIC dating within each window needs no critical values at all, same as dating_hls. The step-1 PSY detection/dating pass does use a wild bootstrap critical value (cv/nboot/seed below), but only to locate the preliminary episode windows, not for the dating step itself.

Returns its own class (not radf_obj), so it does not plug into summary()/\link{datestamp}/tidy/autoplot – prints its own dating table (model, origination, collapse, recovery) – see vignette("naming-and-analysis", package = "exuber") for the full picture of which functions do and don't fit that pipeline.

Status

[Experimental]

References

Harvey, D. I., Leybourne, S. J., & Whitehouse, E. J. (2020). Date-stamping multiple bubble regimes. Journal of Empirical Finance, 58, 226-246.

See also

dating_hls for the single-bubble fitting this wraps, and datestamp for PSY's own multi-bubble threshold-crossing dating.

Examples

# \donttest{
res <- dating_hlw(sim_data$psy1, trim = 0.1, nboot = 199L, seed = 1)
print(res)
#> 
#> ── dating_hlw (n = 100, trim = 0.1) ────────────────────────────────────────────
#> 
#> series1:
#>  model origination collapse recovery
#>      4          41       55       71
#> 

# Plot every detected episode's breakpoints over the series
autoplot(res)


# A two-bubble series: dating_hls() alone would only fit one bubble
res2 <- dating_hlw(sim_psy2(n = 200, seed = 123), trim = 0.1, nboot = 199L, seed = 1)
autoplot(res2)

# }