BAYES.THR(data, alpha = 0.5, beta = 1, filter.number = 8, family = "DaubLeAsymm", bc = "periodic", dev = var, j0 = 5, plotfn = F)
data
alpha, beta
alpha
and beta
take
positive values; see Abramovich, Sapatinas,
& Silverman (1998) or Chipman & Wolfson (1999) for more
details on selecting alpha
and beta
.
filter.number
For the ``wavelets on the interval'' (bc="interval"
)
transform the filter number ranges from
1 to 8. See the table of filter coefficients indexed after the reference to
Cohen, Daubechies and Vial, (1993).
family
This argument is ignored for the ``wavelets on the interval'' transform
(bc="interval"
).
bc
bc="periodic"
the
default, then the function you decompose is assumed to be
periodic on it's interval of definition, if
bc="symmetric"
then the function beyond its boundaries is
assumed to be a symmetric reflection of the function in
the boundary. The symmetric option was the implicit
default in releases prior to 2.2. If bc=="interval"
then
the ``wavelets on the interval algorithm'' due to
Cohen, Daubechies and Vial is used.
(The WaveThresh
implementation of the ``wavelets on the interval transform'' was
coded by Piotr Fryzlewicz,
Department of Mathematics,
Wroclaw University of Technology,
Poland; this code was largely based
on code written by
Markus Monnerjahn,
RHRK,
Universitat Kaiserslautern;
integration into WaveThresh
by
GPN).
dev
var()
function. A popular, useful and
robust alternative is the madmad function.
j0
plotfn
TRUE
, BAYES.THR
draws the noisy data
and the thresholded function estimate.
plotfn = TRUE
, the noisy data and function estimate
are plotted.
The function wave.band uses the same priors to compute posterior credible intervals for the regression function, using the method described by Barber, Nason, & Silverman (2001).
# # Generate some noisy test data and plot it. # blocks.data <- test.data(type="blocks", rsnr=4, n=1024, plotfn=T)
# # Now try BAYES.THR with the default parameters. # blocks.thr <- BAYES.THR(blocks.data$ynoise, plotfn=T))
# # The default wavelet is Daubechies' least asymmetric wavelet # with 8 vanishing moments; quite a smooth wavelet. Since the # flat sections are still rather noisy, try Haar wavelets: # blocks.thr <- BAYES.THR(blocks.data$ynoise, plotfn=T, filter.number=1, family = "DaubExPhase"))
# # To show the importance of a sensible prior, consider alpha = 4, # beta = 1 (which implies a smoother prior than the default). # blocks.thr <- BAYES.THR(blocks.data$ynoise, plotfn=T, filter.number=1, family = "DaubExPhase", alpha=4, beta=1))
# # Here, the extreme values of the function are being smoothed towards zero. #