# NOT RUN {
# This example is the wavelet multiple correlation (WMC) version of
# the Figure 7 in Polanco-Martinez and Fernandez-Macho (2014).
library("wavemulcor")
library("W2CWM2C")
data(dataexample)
#:: Transform to 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!
dataexample <- dataexample[,1:5]
lrdatex <- apply(log(dataexample), 2, diff)
inputDATA <- ts(lrdatex, start=1, frequency=1)
#Input parameters
Wname <- "la8"
J <- 8
compWMC <- WMC(inputDATA, Wname, J, device="screen", NULL,
NULL, NULL, NULL, NULL)
# }
Run the code above in your browser using DataLab