Testing for and dating periods of explosive dynamics (exuberance) in time series using recursive unit root tests as proposed by Phillips, P. C., Shi, S. and Yu, J. (2015a)
Testing for and dating periods of explosive dynamics (exuberance) in time series using recursive unit root tests as proposed by Phillips, P. C., Shi, S. and Yu, J. (2015a) <:10.1111/iere.12132>. Simulate a variety of periodically-collapsing bubble models. The estimation and simulation utilize the matrix inversion lemma from the recursive least squares algorithm, which results in a significant speed improvement.
radf(): Recursive Augmented Dickey-Fuller test
mc_cv(): Monte Carlo Critical Values
wb_cv(): Wild Bootstrap Critical values
The package is still under development, to install the development version from GitHub:
Note that development version requires compilation, so to install you will need the appropriate development tools.
If you encounter a clear bug, please file a reproducible example on GitHub.
This is a basic example which shows you how to use exuber:
library(exuber)# Simulate data witn n = 100 observationsset.seed(123)a1 <- sim_dgp1(n = 100) # one bubblea2 <- sim_dgp2(n = 100) # two bubblesa3 <- sim_blan(n = 100) # blanchard modela4 <- sim_evans(n = 100) # evans modeldta <- data.frame("oneb" = a1, "twob" = a2, "blan" = a3, "evans" = a4)ts <- radf(dfrm, lag = 1)# Critical Values mc = Monte Carlo, wb= Wild Bootstrapped## Use 500 repetions(boostraps) for faster computationmc <- mc_cv(n = NROW(dta), nrep = 500, parallel = T)wb <- wb_cv(dta, nboot = 500, parallel = T)
Report summary statistics, diagnostics and date stamping periods of mildly explosive behaviour.
report(ts, mc)diagnostics(ts, mc)datestamp(ts, mc)
The output of plot will be a list,
# All togetherplot(ts, mc, plot_type = "single", breaks_x = 20)# Individuallyplot(ts, mc, plot_type = "multiple", breaks_x = 20)library(gridExtra)p1 <- plot(ts, mc, plot_type = "multiple", breaks_x = 20, breaks_y = 3)do.call("grid.arrange", c(p1, ncol = 2))
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.