Compute wavelet coherence
wtc(
d1,
d2,
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
)
Return a biwavelet
object containing:
matrix containg cone of influence
matrix containing the cross-wavelet transform
matrix containing the bias-corrected cross-wavelet transform
using the method described by Veleda et al. (2012)
matrix of power
matrix of bias-corrected cross-wavelet power using the method described
by Veleda et al. (2012)
matrix of wavelet coherence
matrix of phases
vector of periods
vector of scales
length of a time step
vector of times
vector of values used to plot xaxis
smallest scale of the wavelet
spacing between successive scales
standard deviation of time series 1
standard deviation of time series 2
mother wavelet used
type of biwavelet
object created (wtc
)
matrix containing sig.level
percentiles of wavelet
coherence based on the Monte Carlo AR(1) time series
Time series 1 in matrix format (n
rows x 2 columns). The
first column should contain the time steps and the second column should
contain the values.
Time series 2 in matrix format (n
rows x 2 columns). The
first column should contain the time steps and the second column should
contain the values.
Pad the values will with zeros to increase the speed of the transform.
Spacing between successive scales.
Smallest scale of the wavelet.
Number of scales - 1.
Maximum scale. Computed automatically if left unspecified.
Type of mother wavelet function to use. Can be set to
morlet
, dog
, or paul
.
Nondimensional parameter specific to the wavelet function.
Vector containing the AR(1) coefficient of each time series.
Significance level.
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.
Number of Monte Carlo randomizations.
Do not display progress bar.
Tarik C. Gouhier (tarik.gouhier@gmail.com)
Code based on WTC MATLAB package written by Aslak Grinsted.
Cazelles, B., M. Chavez, D. Berteaux, F. Menard, J. O. Vik, S. Jenouvrier, and N. C. Stenseth. 2008. Wavelet analysis of ecological time series. Oecologia 156:287-304.
Grinsted, A., J. C. Moore, and S. Jevrejeva. 2004. Application of the cross wavelet transform and wavelet coherence to geophysical time series. Nonlinear Processes in Geophysics 11:561-566.
Torrence, C., and G. P. Compo. 1998. A Practical Guide to Wavelet Analysis. Bulletin of the American Meteorological Society 79:61-78.
Torrence, C., and P. J. Webster. 1998. The annual cycle of persistence in the El Nino/Southern Oscillation. Quarterly Journal of the Royal Meteorological Society 124:1985-2004.
Veleda, D., R. Montagne, and M. Araujo. 2012. Cross-Wavelet Bias Corrected by Normalizing Scales. Journal of Atmospheric and Oceanic Technology 29:1401-1408.
t1 <- cbind(1:100, rnorm(100))
t2 <- cbind(1:100, rnorm(100))
## Wavelet coherence
wtc.t1t2 <- wtc(t1, t2, nrands = 10)
## Plot wavelet coherence and phase difference (arrows)
## Make room to the right for the color bar
par(oma = c(0, 0, 0, 1), mar = c(5, 4, 4, 5) + 0.1)
plot(wtc.t1t2, plot.cb = TRUE, plot.phase = TRUE)
Run the code above in your browser using DataLab