Learn R Programming

WaveletComp (version 1.0)

wt: Wavelet transformation, and a simulation algorithm

Description

This function provides Morlet wavelet transformation results of the given time series, performed within the lower-order function WaveletTransform, subject to criteria concerning the time and frequency resolution, and an (optional) lower and/or upper Fourier period. It performs a simulation algorithm to test against a specified alternative hypothesis, which can be chosen from a variety of options, and provides p-values. The selected model will be fitted to the data and simulated according to estimated parameters in order to provide surrogate time series. This function is called by function analyze.wavelet.

The name and parts of the layout were inspired by a similar function developed by Huidong Tian and Bernard Cazelles (archived R package WaveletCo). The major part of the code for the computation of the cone of influence, and the code for Fourier-randomized surrogate time series has been adopted from Huidong Tian.

Usage

wt(x, start = 1, dt = 1, dj = 1/20, 
   lowerPeriod = 2*dt, upperPeriod = floor(length(x)*dt/3), 
   make.pval = T, method = "white.noise", params = NULL, 
   n.sim = 100, save.sim = F)

Arguments

x
the time series to be analyzed
start
starting value (in time units) at the time axis (for the computation of the cone of influence)
dt
time resolution, i.e. sampling resolution on time domain, 1/dt = number of intervals per time step. Default: 1.
dj
frequency resolution, i.e. sampling resolution on frequency domain, 1/dj = number of suboctaves (voices per octave). Default: 1/20.
lowerPeriod
lower Fourier period (in time units) for wavelet decomposition. Default: 2*dt.
upperPeriod
upper Fourier period (in time units) for wavelet decomposition. Default: (floor of one third of time series length)*dt.
make.pval
Compute p-values? Logical. Default: TRUE
method
the method of generating surrogate time series, select from: rlll{ "white.noise" : white noise "shuffle" : shuffling the given time series "Fourier.rand" : time series with a similar
params
a list of assignments between methods (AR, and ARIMA) and lists of parameter values which apply to surrogates. Default: NULL. Default includes: AR: AR = list(p=1), where:
n.sim
number of simulations. Default: 100
save.sim
Should simulations be saved on the output list? Logical. Default: FALSE.

Value

  • A list with the following elements:
  • Wavecomplex wavelet transform of the series
  • Phasephases
  • Amplamplitudes
  • Powerwavelet power in the time/frequency domain
  • Power.avgvector of average wavelet power in the frequency domain (averages over time)
  • Power.pvalp-values of wavelet power
  • Power.avg.pvalvector of p-values of average wavelet power
  • Periodthe Fourier periods (in time units)
  • Scalethe scales
  • coi.1, coi.2borders of the region where the wavelet transforms are not influenced by edge effects (cone of influence)
  • ncnumber of columns/time steps
  • nrnumber of rows/scales/Fourier periods
  • axis.1tick levels corresponding to time steps
  • axis.2tick levels corresponding to Fourier periods (= log2(Period))
  • series.sima data frame of the series which have been simulated as surrogates for the (detrended) time series (if both make.pval = TRUE and save.sim = TRUE.)

References

Aguiar-Conraria L., and Soares M.J., 2011. The Continuous Wavelet Transform: A Primer. NIPE Working Paper Series 16/2011.

Carmona R., Hwang W.-L., and Torresani B., 1998. Practical Time Frequency Analysis. Gabor and Wavelet Transforms with an Implementation in S. Academic Press, San Diego.

Cazelles B., Chavez M., Berteaux, D., Menard F., Vik J.O., Jenouvrier S., and Stenseth N.C., 2008. Wavelet analysis of ecological time series. Oecologia 156, 287--304.

Liu Y., Liang X.S., and Weisberg R.H., 2007. Rectification of the Bias in the Wavelet Power Spectrum. Journal of Atmospheric and Oceanic Technology 24, 2093--2102.

Tian, H., and Cazelles, B., 2012. WaveletCo. Available at http://cran.r-project.org/src/contrib/Archive/WaveletCo/, archived April 2013; accessed July 26, 2013.

Torrence C., and Compo G.P., 1998. A practical guide to wavelet analysis. Bulletin of the American Meteorological Society 79 (1), 61--78.

See Also

WaveletTransform, analyze.wavelet