ewspec
.
This function computes the Nason and Silverman raw or smoothed wavelet periodogram as described by Nason and Silverman (1995).## S3 method for class 'wd':
LocalSpec(wdS, lsmooth="none", nlsmooth=FALSE, prefilter=TRUE,
verbose=FALSE, lw.number=wdS$filter$filter.number,
lw.family=wdS$filter$family, nlw.number=wdS$filter$filter.number,
nlw.family=wdS$filter$family, nlw.policy="LSuniversal",
nlw.levels=0:(nlevelsWT(wdS) - 1), nlw.type="hard", nlw.by.level=FALSE,
nlw.value=0, nlw.dev=var, nlw.boundary=FALSE, nlw.verbose=FALSE,
nlw.cvtol=0.01, nlw.Q=0.05, nlw.alpha=0.05, nlw.transform=I,
nlw.inverse=I, debug.spectrum=FALSE, ...)
filter number
of the wavelet within the family used to perform the LINEAR wavelet smoothing.family
of the wavelet used to perform the LINEAR wavelet smoothing.filter number
of the wavelet used to perform the wavelet shrinkage.family
of the wavelet used to perform the wavelet shrinkage.threshold.wd
for different policy choices).threshold.wd
for a detailed description of how levels can be chosen).threshold.wd
for a list).threshold.wd
).nlw.policy
then the nlw.value option carries the manual threshold value (see thres
threshold.wd
). One possibility is the Splus var() function, threshold.wd
).threshold.wd
).threshold.wd
)threshold.wd
).threshold.wd
).nlw.transf
nl
T
then spectrum plots are produced at each stage of the squaring/smoothing. Therefore if you put in the non-decimated wavelet transform of white noise you can get a fair idea of how the coefficients are filtered at each stagwd
a time-ordered non-decimated wavelet transform. Each level of the returned object contains a smoothed wavelet periodogram. Note that this is not the corrected smoothed wavelet periodogram, or the evolutionary wavelet spectrum. Use the function ewspec
to compute the evolutionary wavelet spectrum.ewspec
instead. However, this function is still useful for computing the raw periodogram. This function attempts to produce a picture of local time-scale power of a signal. There are two main components to this function: linear smoothing of squared coefficients and non-linear smoothing of these. Neither, either or both of these components may be used to process the data. The function expects a non-decimated wavelet transform object (of class wd, type="station") such as that produced by the wd
() function with the type option set to "station
". The following paragraphs describe the various methods of smoothing.
LINEAR SMOOTHING. There are three varieties of linear smoothing. None simply squares the coefficients. Fourier and wavelet apply linear smoothing methods in accordance to the prescription given in Nason and Silverman (1995). Each level in the SWT corresponds to a band-pass filtering to a frequency range [sl, sh]. After squaring we obtain power in the range [0, 2sl] and [2sl, 2sh]. The linear smoothing gets rid of the power in [2sl, 2sh]. The Fourier method simply applies a discrete Fourier transform (rfft) and cuts off frequencies above 2sl. The wavelet method is a bit more suble. The DISCRETE wavelet transform is taken of a level (i) and all levels within the DWT, j, where j>i are set to zero and then the inverse is taken. Approximately this performs the same operation as the Fourier method only faster. By default the same wavelets are used to perform the linear smoothing as were used to compute the stationary wavelet transform in the first place. This can be changed by altering lw.number
and lw.family
.
NONLINEAR SMOOTHING. After either of the linear smoothing options above it is possible to use wavelet shrinkage upon each level in the squared (and possibly Fourier or wavelet linear smoothed) to denoise the coefficients. This process is akin to smoothing the ordinary periodogram. All the usual wavelet shrinkage options are available as nlw
.* where * is one of the usual threshold.wd
options. By default the same wavelets are used to perform the wavelet shrinkage as were used to compute the non-decimated wavelet transform. These wavelets can be replaced by altering nlw.number
and nlw.family
. Also, it is possible to transform the squared (and possibly smoothed coefficients) before applying wavelet shrinkage. The transformation is effected by supplying an appropriate transformation function (AND ITS INVERSE) to nlw.transform
and nlw.inverse
. (For examples, nlw.transform=log
andnlw.inverse=exp
might be a good idea).
ewspec
,#
# This function is obsolete. See ewspec()
#
# Compute the raw periodogram of the BabyECG
# data using the Daubechies least-asymmetric wavelet $N=10$.
#
data(BabyECG)
babywdS <- wd(BabyECG, filter.number=10, family="DaubLeAsymm", type="station")
babyWP <- LocalSpec(babywdS, lsmooth = "none", nlsmooth = FALSE)
plot(babyWP, main="Raw Wavelet Periodogram of Baby ECG")
#
# Note that the lower levels of this plot are too large. This is partly because
# there are "too many" coefficients at the lower levels. For a better
# picture of the local spectral properties of this time series see
# the examples section of ewspec
#
# Other results of this function can be seen in the paper by
# Nason and Silverman (1995) above.
#
Run the code above in your browser using DataLab