README.md

exuber : Econometric Analysis of Explosive Time Series

Build
Status AppVeyor Build
Status CRAN_Status_Badge lifecycle codecov

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

Simulate custom critical values

Simulation

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.



Try the exuber package in your browser

Any scripts or data that you put into this service are public.

exuber documentation built on March 2, 2019, 1:04 a.m.