This function seeks the whitest orthonormal transform of a DWPT. The goal is to segment the normalized frequency interval \(f \in [0, 1/2]\) into subintervals such that, within each subinterval, the variability of the (corresponding) spectral density function (SDF) is minimized, i.e., each segment of the SDF is as flat as possible. Given an \(N\)-point uniformly sampled time series X, and denoting \(\mathbf{W}_{j,n}\) as the DWPT crystal at level \(j\) and (sequency ordered) oscillation index \(n\), this optimization is achieved as follows:
Perform a level \(J - 2\) partial DWPT of X where
\(J=\lfloor \log_2 (\mathbf{X}) \rfloor\).
By definition, \(\mathbf{W}_{0,0} \equiv \mathbf{X}\). Begin
step 2
with \(j=n=0\).
Perform a white noise test on the current (parent) crystal: \(\mathbf{W}_{j,n}\). If it passes (or the current crystal is in the last decomposition level) retain the crystal. Otherwise, discard the current parent crystal and perform the white noise test on its children: \(\mathbf{W}_{j+1,2n}\) and \(\mathbf{W}_{j+1,2n+1}\).
Repeat step 2
as many times as necessary until a suitable transform is found.
wavDWPTWhitest(x, significance=0.05, test="port2", wavelet="s8", n.level=NULL)
a vector containing a uniformly-sampled real-valued time series or an
object of class wavTransform
.
the number of decomposition levels. This argument is used only if
x
is a time series. Default: floor(logb(length(x), base=2)) - 2
.
a numeric value on the interval (0,1)
which qualitatively signifies the fraction of times that the
white noise hypothesis is incorrectly rejected.
The significance
is used to calculate comparative chi-square distribution
\(p\) x \(100\) percentage points where \(p=1 - \mbox{significance}\)
(the chi-square degrees of freedom are estimated automatically within the specified white noise test).
Default: 0.05
.
a character string denoting the white noise test to use.
Options are "port1"
, "port2"
, "port3"
and "cumper"
respresenting
the Portmanteau I, II, III and cumulative periodogram tests, respectively. See the
reference(s) for more details. Default: "port2"
.
a character string denoting the filter type.
See wavDaubechies
for details. This argument is used only if
x
is a time series. Default: "s8"
.
a list
containing the level
and osc
vectors denoting
the level and oscillation index, respectively, of the whitest transform.
D. B. Percival, S. Sardy and A. C. Davison, Wavestrapping Time Series: Adaptive Wavelet-Based Bootstrapping, in W. J. Fitzgerald, R. L. Smith, A. T. Walden and P. C. Young (Eds.), Nonlinear and Nonstationary Signal Processing, Cambridge, England: Cambridge University Press, 2001.
# NOT RUN {
## calculate the DWPT of the sunspots series
W <- wavDWPT(as.numeric(sunspots), wavelet="s8", n.levels=9)
## find the whitest transform based on the
## Portmanteau I white noise test
z <- wavDWPTWhitest(W, test="port1")
print(z)
# }
Run the code above in your browser using DataLab