# NOT RUN {
## Based on data from Figure 7.9 in Gencay, Selcuk and Whitcher (2001)
## plus one random series.
library(wavemulcor)
data(exchange)
returns <- diff(log(exchange))
returns <- ts(returns, start=1970, freq=12)
N <- dim(returns)[1]
wf <- "d4"
J <- trunc(log2(N))-3
lmax <- 36
set.seed(140859)
demusd.modwt <- brick.wall(modwt(returns[,"DEM.USD"], wf, J), wf)
jpyusd.modwt <- brick.wall(modwt(returns[,"JPY.USD"], wf, J), wf)
rand.modwt <- brick.wall(modwt(rnorm(length(returns[,"DEM.USD"])), wf, J), wf)
# ---------------------------
xx <- list(demusd.modwt, jpyusd.modwt, rand.modwt)
names(xx) <- c("DEM.USD","JPY.USD","rand")
Lst <- wave.multiple.cross.regression(xx, lmax)
# ---------------------------
##Producing correlation plot
plot_wave.multiple.cross.correlation(Lst, lmax) #, by=2)
##Producing regression plot
plot_wave.multiple.cross.regression(Lst, lmax) #, by=2)
# }
Run the code above in your browser using DataLab