Learn R Programming

brainwaver (version 1.6)

const.cor.list: Computation of the list of correlation matrices

Description

Computes the list of the correlation matrices in terms of the scale of the wavelet decomposition.

Usage

const.cor.list(data.mat, names.data = 0, method = "modwt", wf = "la8", n.levels = 4, boundary = "periodic", p.corr = 0.975, save.wave = FALSE, export.data = FALSE)

Arguments

data.mat
matrix containing the data time series. Each column of the matrix represents one time series.
names.data
optional character vector containing the name associated to the column of the matrix data.mat.
method
wavelet decomposition to be used, algorithm implemented in the waveslim package (Whitcher, 2000). By default, the Maximal Overlap Discrete Wavelet Transform is used "modwt". It is also possible to use the classical Discrete Wavelet Transform "dwt".
wf
name of the wavelet filter to use in the decomposition. By default this is set to "la8", the Daubechies orthonormal compactly supported wavelet of length $L=8$ (Daubechies, 1992), least asymmetric family.
n.levels
specifies the depth of the decomposition. This must be a number less than or equal to $log(length(x),2)$.
boundary
Character string specifying the boundary condition. If boundary=="periodic" the default, then the vector you decompose is assumed to be periodic on its defined interval, if boundary=="reflection", the vector beyond its boundaries is assumed to be a symmetric reflection of itself.
p.corr
(one minus the) two-sided p-value for the confidence interval
save.wave
logical. If TRUE all the wavelet coefficient are saved.
export.data
logical. If TRUE the correlation matrices with the upper and lower bound are exported to text file.

Value

Object of class "Wave Correlation", basically, a list with the following components
d?
Correlation matrix for each scale of the wavelet decomposition.
lowerd?
matrix containing the lower bound of the correlation for each scale of the wavelet decomposition.
upperd?
matrix containing the upper bound of the correlation for each scale of the wavelet decomposition.

Details

This function uses the wavelet decomposition implemented in the R package waveslim, (whitcher, 2000).

References

R. Gencay, F. Selcuk and B. Whitcher (2001) An Introduction to Wavelets and Other Filtering Methods in Finance and Economics, Academic Press.

D. B. Percival and A. T. Walden (2000) Wavelet Methods for Time Series Analysis, Cambridge University Press.

S. Achard, R. Salvador, B. Whitcher, J. Suckling, Ed Bullmore (2006) A Resilient, Low-Frequency, Small-World Human Brain Functional Network with Highly Connected Association Cortical Hubs. Journal of Neuroscience, Vol. 26, N. 1, pages 63-72.

See Also

const.var.list, read.cor.txt, save.cor.txt

Examples

Run this code
data(brain)
brain<-as.matrix(brain)
# WARNING : To process only the first five regions
brain<-brain[,1:5]


n.levels<-4
wave.cor.list<-const.cor.list(brain,n.levels=n.levels)

tot.regions <- dim(brain)[2]
n.series <- dim(brain)[1]
col.regions<-1

nb.comp.regions <- 8
    comp.regions <- round(runif(nb.comp.regions,2,tot.regions))
    sym.region <- col.regions+1

comp.regions <- c(sym.region,comp.regions)

    name.ps <- "example-1.ps"
    postscript(name.ps)
    par(mfrow=c(3,3))
    for(k in 1:(nb.comp.regions+1)){
	
        reg <- comp.regions[k]


       cor.vector<-matrix(0,4,3)
	for(i in 1:n.levels){

       cor.vector[i,1]<-(wave.cor.list[[i]])[1,reg]
       cor.vector[i,2]<-(wave.cor.list[[i+n.levels]])[1,reg]
       cor.vector[i,3]<-(wave.cor.list[[i+2*n.levels]])[1,reg]

}

         title <- paste("1 -- ",comp.regions[k],sep="")
        matplot(2^(0:(n.levels-1)),cor.vector,main=title,type="b", 
                 log="x", pch="*LU", xaxt="n", lty=1, col=c(1,4,4), 
                 xlab="Wavelet Scale",ylab="Wavelet Covariance",ylim=c(-0.5,1))
        axis(side=1, at=2^(0:7))
        abline(h=0)
      }
    dev.off()






Run the code above in your browser using DataLab