mwc: Compute multiple wavelet coherence

Description Usage Arguments Value Author(s) References Examples

Description

Compute multiple wavelet coherence

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
mwc(
  y,
  x1,
  x2,
  pad = TRUE,
  dj = 1/12,
  s0 = 2 * dt,
  J1 = NULL,
  max.scale = NULL,
  mother = "morlet",
  param = -1,
  lag1 = NULL,
  sig.level = 0.95,
  sig.test = 0,
  nrands = 300,
  quiet = FALSE
)

Arguments

y

time series 1 in matrix format (m rows x 2 columns). The first column should contain the time steps and the second column should contain the values.

x1

time series 2 in matrix format (m rows x 2 columns). The first column should contain the time steps and the second column should contain the values.

x2

time series 3 in matrix format (m rows x 2 columns). The first column should contain the time steps and the second column should contain the values.

pad

pad the values will with zeros to increase the speed of the transform. Default is TRUE.

dj

spacing between successive scales. Default is 1/12.

s0

smallest scale of the wavelet. Default is 2*dt.

J1

number of scales - 1.

max.scale

maximum scale. Computed automatically if left unspecified.

mother

type of mother wavelet function to use. Can be set to morlet, dog, or paul. Default is morlet. Significance testing is only available for morlet wavelet.

param

nondimensional parameter specific to the wavelet function.

lag1

vector containing the AR(1) coefficient of each time series.

sig.level

significance level. Default is 0.95.

sig.test

type of significance test. If set to 0, use a regular χ^2 test. If set to 1, then perform a time-average test. If set to 2, then do a scale-average test.

nrands

number of Monte Carlo randomizations. Default is 300.

quiet

Do not display progress bar. Default is FALSE

Value

Return a vectorwavelet object containing:

coi

matrix containg cone of influence

rsq

matrix of wavelet coherence

phase

matrix of phases

period

vector of periods

scale

vector of scales

dt

length of a time step

t

vector of times

xaxis

vector of values used to plot xaxis

s0

smallest scale of the wavelet

dj

spacing between successive scales

mother

mother wavelet used

type

type of vectorwavelet object created (mwc)

signif

matrix containg sig.level percentiles of wavelet coherence based on the Monte Carlo AR(1) time series

Author(s)

Tunc Oygur (info@tuncoygur.com.tr)

Code based on MWC MATLAB package written by Eric K. W. Ng and Johnny C. L. Chan.

References

T. Oygur, G. Unal.. Vector wavelet coherence for multiple time series. Int. J. Dynam. Control (2020).

T. Oygur, G. Unal. 2017. The large fluctuations of the stock return and financial crises evidence from Turkey: using wavelet coherency and VARMA modeling to forecast stock return. Fluctuation and Noise Letters

Ng, Eric KW and Chan, Johnny CL. 2012. Geophysical applications of partial wavelet coherence and multiple wavelet coherence. Journal of Atmospheric and Oceanic Technology 29-12:1845–1853.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
old.par <- par(no.readonly=TRUE)

t <- (-100:100)

y <- sin(t*2*pi)+sin(t*2*pi/4)+sin(t*2*pi/8)+sin(t*2*pi/16)+sin(t*2*pi/32)+sin(t*2*pi/64)
x1 <- sin(t*2*pi/8)
x2 <- sin(t*2*pi/32)

y <- cbind(t,y)
x1 <- cbind(t,x1)
x2 <- cbind(t,x2)

## Multiple wavelet coherence
result <- mwc(y, x1, x2, nrands = 10)

result <- mwc(y, x1, x2)


## Plot wavelet coherence and make room to the right for the color bar
## Note: plot function can be used instead of plot.vectorwavelet
par(oma = c(0, 0, 0, 1), mar = c(5, 4, 4, 5) + 0.1,  pin = c(3,3))
plot.vectorwavelet(result, plot.cb = TRUE, main = "Plot multiple wavelet coherence")

par(old.par)

vectorwavelet documentation built on Jan. 16, 2021, 5:38 p.m.