# 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"
M <- 30
window <- "gauss"
J <- 3 #trunc(log2(N))-3
lmax <- 2
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")
# }
# NOT RUN {
# Note: WLMCR may take more than 10 seconds of CPU time on some systems
Lst <- wave.local.multiple.cross.regression(xx, M, window=window, lag.max=lmax) #, ymaxr=1)
# ---------------------------
##Producing cross-correlation plot
plot_wave.local.multiple.cross.correlation(Lst, lmax, lag.first=FALSE) #, xaxt="s")
##Producing cross-regression plot
plot_wave.local.multiple.cross.regression(Lst, lmax, nsig=2) #, xaxt="s")
# }
Run the code above in your browser using DataLab