Skip to content
exuber

Helpers

Helper functions in accordance to PSY(2015)

Also: psy_ds

psy_minw
psy_minw(n)

psy_ds(n, rule = 1, delta = 1)

psy_minw and psy_ds use the rules of thumb proposed by Phillips et al. (2015) to compute the minimum window size and the minimum duration of an episode of exuberance, respectively.

Arguments

n A positive integer. The sample size.
rule Rule to compute the minimum duration of an episode (default: rule = 1, where T denotes the sample size). Rule 1 corresponds to log(T), while rule 2 to log(T)/T.
delta Frequency-dependent parameter (default; delta = 1). See details.

Value

psy_minw: a single integer, the minimum window length. psy_ds: a single integer, the minimum episode duration in observations.

Details

For the minimum duration period, psy_ds allows the user to choose from two rules:

rule1=δlog⁡(n)andrule2=δlog⁡(n)/n\text{rule}_1 = \delta \log(n) \quad \text{and} \quad \text{rule}_2 = \delta \log(n)/n

delta depends on the frequency of the data and the minimal duration condition.

Examples

These examples are copied from the package's own documentation and are run by R CMD check on every release. The printed output (after #>) and the plots were produced by running them against the current package source.

psy_minw(100)
#> [1] 19
psy_ds(100)
#> [1] 5

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. 10.1111/iere.12132