wave.multiple.cross.correlation(wavemulcor)
wave.multiple.cross.correlation()所属R语言包:wavemulcor
Wavelet routine for multiple cross-correlation
小波多个相互关联的例程
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Produces an estimate of the multiscale multiple cross-correlation (as defined below).
产生一个估计的多尺度多交叉相关(定义见下文)。
用法----------Usage----------
wave.multiple.cross.correlation(xx, lag.max = NULL, ymaxr = NULL)
参数----------Arguments----------
参数:xx
A list of n (multiscaled) time series, usually the outcomes of dwt or modwt, i.e. xx <- list(v1.modwt.bw, v2.modwt.bw, v3.modwt.bw)
n(multiscaled)的时间序列列表,通常的结果的载重吨或modwt的,即XX < - 列表(v1.modwt.bw,v2.modwt.bw,v3.modwt.bw)
参数:lag.max
maximum lag. If not set, it defaults to half the square root of the length of the original series.
最高滞后。如果不设置,则默认为一半的平方根的长度在原始的系列。
参数:ymaxr
index number of the variable whose correlation is calculated against a linear combination of the rest, otherwise at each wavelet level wmc chooses the one maximizing the multiple correlation.
索引号的变量的相关计算针对其余的线性组合,否则在每个小波一级WMC选择一个最大化的多个相关。
Details
详细信息----------Details----------
The routine calculates one single set of wavelet multiple cross-correlations out of n variables that can be plotted as one single set of graphs (one per wavelet level), as an alternative to trying to make sense out of n(n-1)/2 x J sets of wavelet cross-correlations. The code is based on the calculation, at each wavelet scale, of the square root of the coefficient of determination in a linear combination of variables that includes a lagged variable for which such coefficient of determination is a maximum.
该例程的小波的多个交叉相关计算出一个单一的一套满分n变量可以绘制成一个单一的一套图(1每小波级别),作为一种替代,以试图使感满分<X >组的小波交叉相关。该代码是基于有关计算,在每个小波规模,滞后该判定系数为最大的变量的变量的线性组合,其中包括的确定系数的平方根。
值----------Value----------
List of two elements:<br> xy.mulcor: matrix with as many rows as levels in the wavelet transform object. The columns provide the point estimates for the wavelet multiple cross-correlations at different lags.<br> YmaxR: numeric vector giving, at each wavelet level, the index number of the variable whose correlation is calculated against a linear combination of the rest. By default, wmcc chooses at each wavelet level the variable maximizing the multiple correlation.
两个元素的列表的参考xy.mulcor:矩阵尽可能多的行水平的小波变换对象。列提供的点估计为小波多个交叉相关在不同的滞后。参考YmaxR:数值向量给,针对其余的线性组合来计算的相关的变量的索引号,在每个小波一级。默认情况下,每个小波wmcc选择多个相关变量的最大化。
注意----------Note----------
Needs waveslim package to calculate dwt or modwt coefficients as inputs to the routine (also for data in the example).
需要waveslim包计算输入例程(在本例中的数据)的的载重吨,modwt系数为。
(作者)----------Author(s)----------
Javier Fern谩ndez-Macho, Dpt. of Econometrics and Statistics,
& Instituto de Econom铆a P煤blica,
University of the Basque Country,
Agirre Lehendakari etorb. 83, E48015 BILBAO, Spain. (email: javier.fernandezmacho@ehu.es).
参考文献----------References----------
Fern谩ndez-Macho, Javier (2011) The wavelet multiple correlation, (mimeo).
实例----------Examples----------
## Based on data from Figure 7.9 in Gencay, Selcuk and Whitcher (2001)[#从图7.9中Gencay,塞尔丘克和Whitcher的数据(2001年)]
## plus one random series.[#加上一个随机序列。]
library(wavemulcor)
data(exchange)
returns <- diff(log(exchange))
returns <- ts(returns, start=1970, freq=12)
wf <- "d4"
J <- 6
lmax <- 36
n <- dim(returns)[1]
demusd.modwt <- modwt(returns[,"DEM.USD"], wf, J)
demusd.modwt.bw <- brick.wall(demusd.modwt, wf)
jpyusd.modwt <- modwt(returns[,"JPY.USD"], wf, J)
jpyusd.modwt.bw <- brick.wall(jpyusd.modwt, wf)
rand.modwt <- modwt(rnorm(length(returns[,"DEM.USD"])), wf, J)
rand.modwt.bw <- brick.wall(rand.modwt, wf)
##xx <- list(demusd.modwt.bw, jpyusd.modwt.bw)[#XX < - 的列表(demusd.modwt.bw,jpyusd.modwt.bw)]
xx <- list(demusd.modwt.bw, jpyusd.modwt.bw, rand.modwt.bw)
Lst <- wave.multiple.cross.correlation(xx, lmax)
returns.cross.cor <- as.matrix(Lst$xy.mulcor[1:J,])
YmaxR <- Lst$YmaxR
exchange.names <- c("DEM.USD", "JPY.USD", "RAND")
rownames(returns.cross.cor)<-rownames(returns.cross.cor,
do.NULL = FALSE, prefix = "Level ")
lags <- length(-lmax:lmax)
lower.ci <- tanh(atanh(returns.cross.cor) - qnorm(0.975) /
sqrt(matrix(trunc(n/2^(1:J)), nrow=J, ncol=lags)- 3))
upper.ci <- tanh(atanh(returns.cross.cor) + qnorm(0.975) /
sqrt(matrix(trunc(n/2^(1:J)), nrow=J, ncol=lags)- 3))
par(mfrow=c(3,2), las=1, pty="m", mar=c(2,3,1,0)+.1, oma=c(1.2,1.2,0,0))
for(i in J:1) {
matplot((12*lmax+1)),returns.cross.cor[i,], type="l", lty=1, ylim=c(-1,1),
xaxt="n", xlab="", ylab="", main=rownames(returns.cross.cor)[[i]][1])
if(i<3) {axis(side=1, at=seq(1, 2*lmax+1, by=12),
labels=seq(-lmax, lmax, by=12))}
#axis(side=2, at=c(-.2, 0, .5, 1))[轴(侧= 2,= C( - 0.2,0 0.5,1))]
lines(lower.ci[i,], lty=1, col=2) ##Add Connected Line Segments to a Plot[#添加连接线段的地积]
lines(upper.ci[i,], lty=1, col=2)
abline(h=0,v=lmax+1) ##Add Straight horiz and vert Lines to a Plot[#直HORIZ线和垂直线的地积]
text(1,1, labels=exchange.names[YmaxR[i]], adj=0.25, cex=.8)
}
par(las=0)
mtext('Lag (months)', side=1, outer=TRUE, adj=0.5)
mtext('Wavelet Multiple Cross-Correlation', side=2, outer=TRUE, adj=0.5)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|