# NOT RUN {
## Based on data from Figure 7.8 in Gencay, Selcuk and Whitcher (2001)
## plus two random series.
library(wavemulcor)
data(exchange)
returns <- diff(log(as.matrix(exchange)))
returns <- ts(returns, start=1970, freq=12)
N <- dim(returns)[1]
wf <- "d4"
M <- 30
window <- "gauss"
J <- 3 #trunc(log2(N))-3
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)
xrand.modwt <- brick.wall(modwt(rnorm(length(returns[,"DEM.USD"])), wf, J), wf)
# ---------------------------
xx <- list(demusd.modwt, jpyusd.modwt, xrand.modwt)
names(xx) <- c("DEM.USD","JPY.USD","rand")
Lst <- wave.local.multiple.regression(xx, M, window=window) #, ymaxr=1)
# ---------------------------
##Producing line plots with CI
plot_wave.local.multiple.correlation(Lst) #, xaxt="s")
##Producing regression plots
plot_wave.local.multiple.regression(Lst) #, xaxt="s")
# }
Run the code above in your browser using DataLab