Skip to content

Econometric Analysis of Explosive Time Series

License

Notifications You must be signed in to change notification settings

s-spavound/exuber

 
 

Repository files navigation

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

  • 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 assiged 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.

About

Econometric Analysis of Explosive Time Series

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • R 95.3%
  • C++ 4.7%