qmwc {vectorwavelet}R Documentation

Compute quadruple wavelet coherence

Description

Compute quadruple wavelet coherence

Usage

qmwc(
  y,
  x1,
  x2,
  x3,
  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.

x3

time series 4 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 \chi^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 (qmwc)

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)

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

Examples

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/16)
x2 <- sin(t*2*pi/32)
x3 <- sin(t*2*pi/64)

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

## Quadruple wavelet coherence
result <- qmwc(y, x1, x2, x3, nrands = 10)

result <- qmwc(y, x1, x2, x3)


## 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 quadruple wavelet coherence")

par(old.par)


[Package vectorwavelet version 0.1.0 Index]