disp: Generate a table with identified bubble/crisis periods

Description Usage Arguments Value References Examples

View source: R/disp.R

Description

disp generates a data frame with bubble/crisis periods identified by the PSY procedure

Usage

1
disp(OT, obs)

Arguments

OT

A date vector. Bubbles/crisis periods identified by the spymonitor::locate function.

obs

A positive integer. The number of observations.

Value

A vector of strings with bubble/crisis periods.

References

Phillips, P. C. B., Shi, S., & Yu, J. (2015a). Testing for multiple bubbles: Historical episodes of exuberance and collapse in the S&P 500. International Economic Review, 56(4), 1034–1078.

Phillips, P. C. B., Shi, S., & Yu, J. (2015b). Testing for multiple bubbles: Limit Theory for Real-Time Detectors. International Economic Review, 56(4), 1079–1134.

* Phillips, P. C. B., & Shi, S.(forthcoming). Real time monitoring of asset markets: Bubbles and crisis. In Hrishikesh D. Vinod and C.R. Rao (Eds.), Handbook of Statistics Volume 41 - Econometrics Using R.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data(spread)

y        <- spread$value[150:200]
obs      <- length(y)
swindow0 <- floor(obs*(0.01 + 1.8/sqrt(obs)))
dim      <- obs - swindow0 + 1
Tb       <- 24 + swindow0 - 1

# Estimate PSY statistics and CVs
bsadf          <- PSY(y, swindow0)
quantilesBsadf <- cvPSYwmboot(y, swindow0, Tb=Tb, nboot = 49, nCores = 2)
quantile95     <- quantilesBsadf %*% matrix(1, nrow = 1, ncol = dim)

# locate bubble/crisis dates
ind95        <- (bsadf > t(quantile95[2, ])) * 1
monitorDates <- spread$date[swindow0:obs]
OT           <- locate(ind95, monitorDates)

# Show bubble/crisis periods
disp(OT, obs)

psymonitor documentation built on May 2, 2019, 1:33 p.m.