Wavelet transformation, and a simulation algorithm
Wavelet transformation, and a simulation algorithm
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.
start: starting point in time (for the computation of the cone of influence).
Default: start = 1.
dt: time resolution, i.e. sampling resolution in the time domain, 1/dt = number of observations per time unit. For example: a natural choice of dt in case of hourly data is dt = 1/24, resulting in one time unit equaling one day. This is also the time unit in which periods are measured. If dt = 1, the time interval between two consecutive observations will equal one time unit.
Default: 1.
dj: frequency resolution, i.e. sampling resolution in the frequency domain, 1/dj = number of suboctaves (voices per octave).
Default: 1/20.
lowerPeriod: lower Fourier period (measured in time units determined by dt, see the explanations concerning dt) for wavelet decomposition.
If dt = 1, the minimum admissible value is 2.
Default: 2*dt.
upperPeriod: upper Fourier period (measured in time units determined by dt, see the explanations concerning dt) for wavelet decomposition.
Default: (floor of one third of time series length)*dt.
method: the method of generating surrogate time series; select from:
"white.noise"
:
white noise
"shuffle"
:
shuffling the given time series
"Fourier.rand"
:
time series with a similar spectrum
"AR"
:
AR(p)
"ARIMA"
:
ARIMA(p,0,q)
Default: "white.noise".
params: a list of assignments between methods (AR, and ARIMA) and lists of parameter values applying to surrogates. Default: NULL.
Default includes two lists named AR and ARIMA:
AR = list(...), a list containing one single element:
p
:
AR order.
Default: 1 .
ARIMA = list(...), a list of six elements:
p
:
AR order.
Default: 1 .
q
:
MA order.
Default: 1 .
include.mean
:
Include a mean/intercept term?
Default: TRUE .
sd.fac
:
magnification factor to boost the
residual standard deviation.
Default: 1 .
trim
:
Simulate trimmed data?
Default: FALSE .
trim.prop
:
high/low trimming proportion.
Default: 0.01 .
n.sim: number of simulations. Default: 100.
save.sim: Should simulations be saved on the output list? Logical. Default: FALSE.
Returns
A list with the following elements:
Wave: complex wavelet transform of the series
Phase: phases
Ampl: amplitudes
Power: wavelet power in the time/frequency domain
Power.avg: vector of average wavelet power in the frequency domain (averages over time)
Power.pval: p-values of wavelet power
Power.avg.pval: vector of p-values of average wavelet power
Period: the Fourier periods (measured in time units determined by dt, see the explanations concerning dt)
Scale: the scales (the Fourier periods divided by the Fourier factor)
coi.1, coi.2: borders of the region where the wavelet transforms are not influenced by edge effects (cone of influence). The coordinates of the borders are expressed in terms of internal axes axis.1 and axis.2.
nc: number of columns = number of observations = number of observation epochs; "epoch" meaning point in time
nr: number of rows = number of scales (Fourier periods)
axis.1: tick levels corresponding to the time steps used for (cross-)wavelet transformation: 1, 1+dt, 1+2dt, .... The default time axis in plot functions provided by WaveletComp is determined by observation epochs, however; "epoch" meaning point in time.
axis.2: tick levels corresponding to the log of Fourier periods: log2(Period). This determines the period axis in plot functions provided by WaveletComp.
series.sim: a data frame of the series 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.