plot_estim_RWWC {RolWinWavCor}R Documentation

Plot the rolling window wavelet correlation coefficients

Description

The plot_estim_RWWC function plots the rolling window wavelet correlation (RWWC) coefficients that are statistically significant between two regular time series as a heat map and also plots the time series under study. The function is based on the work of Polanco-Martínez et al. (2018). plot_estim_RWWC is fed by the function estim_RWWC that is contained in our R package 'RolWinWavCor'.

Usage

plot_estim_RWWC(inputdata, DATES="null", wavcorinput, Wname, J, W, 
  Align="center", vartsX="X", vartsY="Y", coltsX="black", 
  coltsY="blue", CEXAXIS=1, CEXLAB=1)

Arguments

inputdata

A matrix of three columns: the first one is the time (regular or evenly spaced) and the other two columns are the variables under study. This data set is the same used in the function estim_RWWC.

DATES

This optional parameter contains the times of the time series under study. If this parameter is not provided it is computed using the inputdata.

wavcorinput

This parameter contains the output of the function estim_RWWC and consists of a multidimensional matrix with three columns: the first one contains the correlation coefficients and the second and third columns are the left and right bound of the 95% confidence interval.

Wname

Name of the wavelet filter used in the wavelet transform (MODWT) decomposition and must be the same that was used with the function estim_RWWC.

J

The maximum level of the MODWT decomposition and must be the same used with the function estim_RWWC.

W

The window-length or size of the window used when the rolling window wavelet correlation coefficients are estimated and this must have the same value that was used in estim_RWWC.

Align

This is used to align the rolling object and must be the same as used in the function estim_RWWC.

vartsX, vartsY

Names of the first (e.g. “X”) and the second (e.g. “Y”) variable under study.

coltsX, coltsY

The colors used to plot the first and second variable. By default the colors are black and blue for the first and second variable, respectively.

CEXAXIS

This parameter is used to plot the size of the X and Y axes. Its default value is 1.

CEXLAB

This parameter is used to plot the size of the X-axis and Y-axis labels. Its default value is 1.

Details

The plot_estim_RWWC function plots the time series under analysis and the rolling window wavelet correlation coefficients that are statistically significant (within the 95% CI) as a heat map. This function is also based on the work of Polanco-Martínez et al. (2018).

Value

Output: a multi-plot displayed via screen containing the time series under scrutiny and a heat map of the rolling window wavelet correlation coefficients that are statistically significant.

Author(s)

Josué M. Polanco-Martínez (a.k.a. jomopo).
Excellence Unit GECOS, IME, Universidad de Salamanca, Salamanca, SPAIN.
BC3 - Basque Centre for Climate Change, Leioa, SPAIN.
Web1: https://scholar.google.es/citations?user=8djLIhcAAAAJ&hl=en.
Web2: https://www.researchgate.net/profile/Josue-Polanco-Martinez.
Email: josue.m.polanco@gmail.com
Acknowledgement:
We acknowledge to the Excellence Unit GECOS (grant reference number CLU-2019-03), Universidad de Salamanca for its funding support.

References

Polanco-Martínez, J. M., Fernández-Macho, J., Neumann, M. B., & Faria, S. H. (2018). A pre-crisis vs. crisis analysis of peripheral EU stock markets by means of wavelet transform and a nonlinear causality test. Physica A: Statistical Mechanics and its Applications, 490, 1211-1227. <URL: doi: 10.1016/j.physa.2017.08.065>.

Examples

# We reproduce Figure 2 presented in Polanco-Martínez et al. (2018). 
datPIGS     <- EU_stock_markets 
sindatePIGS <- datPIGS[-1]    
sindatePIGS <- sindatePIGS[c(1:5, 8)]
lrdatPIGS   <- apply(log(sindatePIGS), 2, diff)
lrDATES     <- as.Date(datPIGS[,1][-1])
tsdatPIGS   <- ts(lrdatPIGS, start=1, freq=1)
Nnam        <- dim(tsdatPIGS)[2]
lrdatPIGS   <- lrdatPIGS[,1:Nnam]
inputdata   <- tsdatPIGS[,c(2,5)]

Wname <- "la8"  
J     <- 4    
W     <- 241 
Align <- "center"

rwwc <- estim_RWWC(inputdata, Wname, J, W, Align=Align)
wavcor.output <- rwwc 
DATES         <- lrDATES
plot_estim_RWWC(inputdata, DATES=DATES, wavcor.output, Wname, J, W, 
                  Align=Align, CEXAXIS=1.2)

[Package RolWinWavCor version 0.4.0 Index]