LSWPspec
returns the spectral estimate of a locally stationary time series
characterized by a wavelet packet basis.
LSWPspec(x, lev, bb, wavelet, smooth, spa, correct = TRUE, AA = NULL)
a real valued numeric vector containing a time series of dyadic length.
the maximum level for which the spectra should be estimated.
a wavelet packet basis for which the spectra is estimated.
wavelet used to estimate the wavelet packet spectra. Possible values are "haar"
, "d4"
and "la8"
. See also Details.
logical. If FALSE
the returned spectral estimate is not smoothed. Default value is FALSE
. See also Details.
window length for spectral smoothing. Increasing values increase the smoothing.
logical. Should the returned spectral estimate be unbiased? Default is TRUE
.
this argument is for internal use only and should be left alone. See also Details.
A matrix containing the time-frequency spectral estimate where each column corresponds to a different time point and ech row corresponds to a different packet from the given basis.
The current implementation allow the use of these three well known Daubechies discrete wavelets for spectral estimation. Default choice is the
"la8"
wavelet which has decent control over frequency leakage characterizing compactly supported filters. In this initial implementation
smoothing is provided by local polynomials through the lowess
function and the smoothing parameter spa
is passed to lowess
.
Future package versions will allow for different smoothing methods. The argument AA
is tipically used by other functions to provide the
inner product matrix when running simulations. For a direct usage on a single time series the matrix is calculated internally usig the default settings.
A. Cardinali and G.P. Nason (2017). Locally Stationary Wavelet Packet Processes: Basis Selection and Model Fitting. Journal of Time Series Analysis, 38:2, 151-174.
# NOT RUN {
wb <- get.wavelet.basis(4)
wpp <- LSWPspec(x = sp500, lev = 4, bb = wb, wavelet = 'la8', smooth = TRUE, spa = 0.35)
# }
Run the code above in your browser using DataLab