datestamp: Date-stamping periods of mildly explosive behavior

Description Usage Arguments Details Value References Examples

View source: R/datestamp.R

Description

Computes the origination, termination and duration of episodes during which the time series display explosive dynamics.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
datestamp(object, cv = NULL, min_duration = 0L, ...)

## S3 method for class 'radf_obj'
datestamp(
  object,
  cv = NULL,
  min_duration = 0L,
  option = c("gsadf", "sadf"),
  ...
)

Arguments

object

An object of class obj.

cv

An object of class cv.

min_duration

The minimum duration of an explosive period for it to be reported (default = 0).

...

further arguments passed to methods.

option

Whether to apply the "gsadf" or "sadf" methodology (default = "gsadf").

Details

Datestamp also stores a vector whose elements take the value of 1 when there is a period of explosive behaviour and 0 otherwise. This output can serve as a dummy variable for the occurrence of exuberance.

Value

Returns a list containing the estimated origination and termination dates of episodes of explosive behaviour and the corresponding duration.

References

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.

Examples

1
2
3
4
5
6
7
8
9
rsim_data <- radf(sim_data)

ds_data <- datestamp(rsim_data)
ds_data

# Choose minimum window
datestamp(rsim_data, min_duration = psy_ds(nrow(sim_data)))

autoplot(ds_data)

kvasilopoulos/exuber documentation built on Aug. 8, 2020, 7:52 a.m.