WMCC {W2CWM2C} | R Documentation |
Wavelet multiple cross-correlation (multivariate case).
Description
The WMCC
function (multivariate case) computes the wavelet
multiple cross correlation by means of the function
wave.multiple.cross.correlation from the wavemulcor
package (Fernandez-Macho 2012b) and present the result as a novel
plot that reduce the number of plots of the classical function
wave.multiple.cross.correlation. The WMCC
plot output
can be displayed in the screen (by default) or can be saved as PNG,
JPG, PDF or EPS. The WMCC
function also provides a way
to handle multivariate time series easily as a list of N elements
(time series).
Usage
WMCC(inputDATA, Wname, J, lmax, device="screen", filename,
Hfig, WFig, Hpdf, Wpdf)
Arguments
inputDATA |
An array of multivariate time series as a ts object (please, check the ts manual to get more information about the ts function in R). |
Wname |
The wavelet function or filter to use in the decomposition. |
J |
Specifies the depth of the decomposition. |
lmax |
The maximum lag. |
device |
The type of the output device (by default the option is “screen”, and the other options are “jpg”, “png”, “eps” and “pdf”). |
filename |
The output filename. |
Hfig |
The height of the 'jpg' or 'png' image. |
WFig |
The width of the 'jpg' or 'png' image. |
Hpdf |
The height of the eps or pdf. |
Wpdf |
The width of the eps or pdf. |
Details
The WMCC
function compute the wavelet multiple
cross correlation using the function
wave.multiple.cross.correlation from the wavemulcor
package (Fernandez-Macho 2012b), but the WMCC
function incorporates some graphical improvements (please, look at
Figure 7 in Polanco-Martinez and Fernandez-Macho 2014), such as
the reduction of the number of plots to present the results of the
function wave.multiple.cross.correlation.
Value
Output:
Output plot: screen or 'filename + .png, .jpg, .eps or .pdf'.
Output data: The same list of elements of the function wave.multiple.cross.correlation of the wavemulcor package (Fernandez-Macho 2012b).
Note
Needs wavemulcor (to compute the wave.multiple.cross.correlation) and waveslim packages (to compute the modwt and the brick.wall) and also needs the colorspace package to plot the heatmaps.
Author(s)
Josue M. Polanco-Martinez (a.k.a. jomopo).
BC3 - Basque Centre for Climate Change, Bilbao, 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.
References
Fernandez-Macho, J. (2012a). Wavelet multiple correlation and
cross-correlation: A multiscale analysis of euro zone stock
markets. Physica A: Statistical Mechanics and its Applications,
391(4):1097–1104. doi: 10.1016/j.physa.2011.11.002.
Fernandez-Macho, J. (2012b). wavemulcor: Wavelet routine for
multiple correlation. R package version 1.2, The Comprehensive R
Archive Network (CRAN), <URL: https://cran.r-project.org/package=wavemulcor>.
Ihaka, R., Murrell, P., Hornik, K., Fisher, J. C. and Zeileis, A.
(2012). colorspace: Color Space Manipulation. R package version
1.2.0, The Comprehensive R Archive Network (CRAN), <URL: https://cran.r-project.org/package=colorspace>.
Polanco-Martinez, J. and J. Fernandez-Macho (2014). The
package 'W2CWM2C': description, features and applications.
Computing in Science & Engineering, 16(6):68–78.
doi: 10.1109/MCSE.2014.96.
Examples
library("colorspace")
library("wavemulcor")
library("W2CWM2C")
data(dataexample)
#:: Figure 7 (Polanco-Martinez and Fernandez-Macho (2014).
#:: Transform log returns using: ln(t + deltat) - ln(t).
#:: The application in this example uses stock market
#:: indexes (it is common to use log returns instead of
#:: raw data). Other kinds of pre-processing data are possible.
dataexample <- dataexample[-1] #remove the dates!
lrdatex <- apply(log(dataexample), 2, diff)
inputDATA <- ts(lrdatex, start=1, frequency=1)
Wname <- "la8"
J <- 8
lmax <- 30
compWCC <- WMCC(inputDATA, Wname, J, lmax, device="screen", NULL,
NULL, NULL, NULL, NULL)