spec.wave(x, wavelet="s8", n.levels=6, shrink.level=NULL,
detrend=T, plot=T, shrink.fun="soft", taper=.1)
"d4", "s8".
See
wavelet for a list of all available wavelet names.
n.levels is bigger than
ml, where
ml is the maximum possible level,
computed from the
max.level function, then
n.levels is set to
ml and
a warning message is given.
n.levels-1.
TRUE, remove a least squares line from the time series before computing
periodogram.
TRUE, a plot of the spectrum will be provided. See
spec.plot for
details.
soft and
hard, default is
soft. See
shrink for
details.
spec.pgram for details.
10*log10(power)).
WaveShrink" followed by the filter name used in the analysis
and
shrink.level.
Zeros are padded at the beginning of the original time series to make the
series length divisible by
2^(n.levels).
Thresholds are computed based on Gao (1993).
Gao, Hong-Ye (1993). Wavelet Shrinkage Estimates of Spectrum in Time Series.
ma.1 <- arima.sim(model=list(ma=1), n=512) # MA Example
par(mfrow=c(2,2))
plot((1:200)/400, log(4)+2*log(sin(pi*(1:200)/800)), type="l",
xlab="frequency", ylab="spectrum", main="True Spectrum")
ma.raw <- spectrum(ma.1) # raw periodogram
ma.ar <- spectrum(ma.1, "ar") # AR estimate
ma.wave <- spec.wave(ma.1, "s10", shrink.level=5) # waveshrink estimate