vwc: Compute n-dimensional vector wavelet coherence

Description Usage Arguments Value Author(s) References Examples

Description

Compute n-dimensional vector wavelet coherence

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
vwc(
  y,
  x,
  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 y in matrix format (m rows x 2 columns). The first column should contain the time steps and the second column should contain the values.

x

multivariate time series x in matrix format (m rows x n columns). The first column should contain the time steps and the other columns 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 (vwc)

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).

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

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

## n-dimensional multiple wavelet coherence
result <- vwc(y, x, nrands = 10)

result <- vwc(y, x)


## 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 n-dimensional vwc (n=5)")

par(old.par)

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