Learn R Programming

⚠️There's a newer version (1.0.2) of this package.Take me there.

exuber : Econometric Analysis of Explosive Time Series

Description

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). 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.

Overview

Estimation

  • radf() : Recursive Augmented Dickey-Fuller test

Simulate custom critical values

  • mc_cv() : Monte Carlo critical values
  • wb_cv() : Wild Bootstrap critical values
  • sb_cv() : Sieve Bootstrap (panel) critical values

Simulation

  • sim_dgp1() : Simulation of a single-bubble process
  • sim_dgp2() : Simulation of a two-bubble process
  • sim_blan() : Simulation of a Blanchard (1979) bubble process
  • sim_evans() : Simulation of a Evans (1991) bubble process
  • sim_div() : Simulation of dividends

Installation

You can install the released version of exuber from CRAN with:

install.packages("exuber")

And the development version from GitHub with:

if(!require(devtools)) install.packages("devtools")
devtools::install_github("kvasilopoulos/exuber")

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.

Usage

This is a basic example which shows you how to use exuber:

library(exuber)
# Simulate data witn n = 100 observations
set.seed(112)
sim1 <- sim_dgp1(n = 100) # one bubble
sim2 <- sim_dgp2(n = 100) # two bubbles

dta <- data.frame("onebubble" = sim1, 
                  "twobbubbles" = sim2)

ts <- radf(dta, lag = 1)

Report t-stats with the assigned critical values

summary(ts)
#> 
#>  Recursive Unit Root
#>  ----------------------------------
#>  H0: Unit root
#>  H1: Explosive root
#>  ----------------------------------
#>  Critical values: Monte Carlo 
#>  Minimum window: 19 
#>  Iterations: 2000 
#>  Lag: 1 
#>  ----------------------------------
#>  onebubble 
#>         tstat      90%      95%     99%
#> ADF    -2.304  -0.4035  -0.0762  0.5104
#> SADF    4.522   1.0074   1.3484  1.9454
#> GSADF   4.718   1.6942   1.9259  2.6191
#> 
#>  twobbubbles 
#>         tstat      90%      95%     99%
#> ADF    -2.411  -0.4035  -0.0762  0.5104
#> SADF    4.057   1.0074   1.3484  1.9454
#> GSADF   5.571   1.6942   1.9259  2.6191

Date stamp periods of explosive behaviour

datestamp(ts)
#> 
#> Datestamp: Individual
#>  -----------------------------------
#> onebubble :
#>   Start End Duration
#> 1    40  55       16
#> 
#> twobbubbles :
#>   Start End Duration
#> 1    24  40       17
#> 2    62  70        9

Plotting

The output of autoplot is a list of ggplots

ts %>% 
  autoplot() %>% 
  ggarrange()

License

This package is free and open source software, licensed under GPL-3.

Code of Conduct

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.

Copy Link

Version

Install

install.packages('exuber')

Monthly Downloads

513

Version

0.2.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Kostas Vasilopoulos

Last Published

March 1st, 2019

Functions in exuber (0.2.1)

sim_dgp1

Simulation of a single-bubble process
%>%

Pipe operator
sim_div

Simulation of dividends
col_names

Retrieve/Set column names
print.ggarrange

Print a ggarrange object
sim_evans

Simulation of an Evans (1991) bubble process
crit

Simulated Monte Carlo critical values
reexports

Objects exported from other packages
autoplot.radf

Plotting with ggplot2 and tidying with tibble radf objects
autoplot.datestamp

Plotting with ggplot2 and tidying with tibble datestamp objects
summary

Summarizing radf Models
sim_dgp2

Simulation of a two-bubble process
wb_cv

Wild Bootstrap Critical values
datestamp

Date stamping periods of mildly explosive behaviour
diagnostics

Diagnostics
index.radf

Retrieve/Replace the Index
exuber-deprecated

Deprecated functions in package exuber.
exuber

Econometric Analysis of Explosive Time Series
mc_cv

Monte Carlo Critical Values
radf

Recursive Augmented Dickey-Fuller Test
sb_cv

Panel Sieve Bootstrap Critical Values
sim_blan

Simulation of a Blanchard (1979) bubble process