Learn R Programming

wmtsa (version 2.0-3)

wavVar: Discrete wavelet variance estimation

Description

The discrete wavelet variance is a useful alternative to the spectral density function (SDF) and is seen as an octave-band regularization of the SDF. The wavelet variance decomposes the variance of certain stochastic processes on a scale-by-scale basis, and thus, is very appealing to the analyst studying physical phenomena which fluctuate both within and across a wide range of scale.

By definition, the wavelet variance involves an averaged energy summation of MODWT wavelet coefficients. While DWT wavelet coefficients can also be used, the statistical properties are inferior to those of the MODWT wavelet variance. See the references for more details.

The MODWT Wavelet Variance

Let \(N\) be the the number of samples in a time series \(\{X_t\}\), \(L\) be the length of the wavelet filter, \(L_j \equiv (2^j - 1)(L - 1) + 1\) be the equivalent filter width at level $j$ in a MODWT, and \(\tau_j \equiv 2^{j-1}\) be the scale of the data at level \(j\) for \(j=1,\ldots,J\). Then the unbiased wavelet variance is defined as $$ \hat\nu_X^2(\tau_j ) \equiv{1 \over M_j} \sum_{t=L_j - 1}^{N-1} \tilde{d}_{j,t}^2,$$

where \(\tilde{d}_{j,t}\) are the MODWT coefficients at level \(j\) and time \(t\), and \(M_j \equiv N - L_j + 1\). The unbiased wavelet variance estimator avoids so-called boundary coefficients which are those coefficients subject to circular filter operations in a discrete wavelet transform. The biased estimator is defined as $$ \widetilde\nu_X^2(\tau_j ) \equiv{1 \over N} \sum_{t=0}^{N-1} \tilde{d}_{j,t}^2,$$ and includes the effects of the boundary coefficients.

The DWT Wavelet Variance

The DWT can also be used to calculate wavelet variance estimates, but is not preferred over the MODWT due to its poor statistical properties. Let \(N_j \equiv \lfloor N / 2^j \rfloor\) be the number of DWT wavelet coefficients at level \(j\), and \(L'_j \equiv \lceil (L-2)(1 - 2^{-j}) \rceil\) be the number of DWT boundary coefficients at level \(j\) (assuming \(N_j > L'j\)). Then the DWT version of the unbiased wavelet variance is defined as $$ \hat{\hat\nu}_X^2(\tau_j ) \equiv{1 \over N - 2^jL'_j} \sum_{t=L'_j - 1}^{N_j-1} d_{j,t}^2,$$

where \(d_{j,t}\) are the DWT coefficients at level \(j\) and time \(t\). Similarly, the DWT version of the biased wavelet variance is defined as $$ \widetilde{\widetilde\nu}_X^2(\tau_j ) \equiv{1 \over N} \sum_{t=0}^{N_j-1} d_{j,t}^2.$$

Usage

wavVar(x, xform="modwt", wavelet="s8", n.levels=NULL,
    position=list(from=1,by=1,units=character()), units=character(),
    documentation=character(), sdf=NULL, sdfargs=NULL,
    sampling.interval=1, n.fft=1024)

Arguments

x

a vector containing a uniformly-sampled real-valued time series.

documentation

a character string used to describe the input data. Default: character().

n.fft

a positive integer (greater than one) defining the number of frequencies to use in evaluating the SDF. The frequencies are uniformly distributed over the interval [0, Nyquist] ala f=[0, 1/P , 2/P, 3/P, ..., (n.freq-1)/P] where P=2*(n.freq-1)/sampling.interval. Only used when the input SDF is not NULL. Default: 1024.

n.levels

the number of decomposition levels. Default: the maximum level at which there exists at least one interior wavelet coefficient.

position

a list containing the arguments from, by and to which describe the position(s) of the input data. All position arguments need not be specified as missing members will be filled in by their default values. Default: list(from=1, by=1, units=character()).

sampling.interval

sampling interval of the time series. Default: 1.

sdf

a spectral density function of the process corresponding to the input time series. This input must be a function whose first argument is f (representing frequency). At a minimum, the SDF must be defined over frequencies [0, Nyquist] where Nyquist=1/(2*sampling.interval). Additional arguments that are needed to calculate the SDF should be passed via the sdfargs parameter. This argument is used only for calculating mode 2 EDOF. If the EDOF mode 2 estimates are not desired, specify this this argument as NULL and the EDOF mode 2 and corresponding confidence intervals will not be calculated. See the mutilsSDF function for more details. Default: NULL.

sdfargs

a list of arguments passed directly to the SDF function ala do.call. Default: NULL (no additional arguments).

units

a string denoting the units of the time series. Default: character() (no units).

wavelet

a character string denoting the filter type. See wavDaubechies for details. Default: "s8".

xform

a character string denoting the type of wavelet transform: "modwt" or "dwt". Default: "modwt".

Value

an object of class wavVar.

References

D. B. Percival and A. T. Walden, Wavelet Methods for Time Series Analysis, Cambridge University Press, 2000.

See Also

wavVarTest, wavEDOF, wavVarConfidence, mutilsSDF.

Examples

Run this code
# NOT RUN {
## create sequence 
x <- make.signal("doppler")

## perform a time independent wavelet variance 
## analysis 
vmod <- wavVar(x)

## plot the result 
plot(vmod, pch=15, title="Wavelet Variance of Doppler")

## calculate wavelet variance estimaates for the 
## ocean series and calculate EDOF mode 2 
## estimates and corresponding 95 percent 
## confidence intervals 
# }
# NOT RUN {
vocean <- wavVar(ocean, sdf=oceansdf, wavelet="d6")

## summarize the results 
plot(vocean, edof=1:3)

summary(vocean)
# }

Run the code above in your browser using DataLab