BAYES.THR             package:wavethresh             R Documentation

_B_a_y_e_s_i_a_n _w_a_v_e_l_e_t _t_h_r_e_s_h_o_l_d_i_n_g.

_D_e_s_c_r_i_p_t_i_o_n:

     This function carries out Bayesian wavelet thresholding of noisy
     data, using the BayesThresh method of Abramovich, Sapatinas, &
     Silverman (1998).

_U_s_a_g_e:

     BAYES.THR(data, alpha = 0.5, beta = 1, filter.number = 8, family =
     "DaubLeAsymm", bc = "periodic", dev = var, j0 = 5, plotfn = FALSE)

_A_r_g_u_m_e_n_t_s:

    data: A vector of length a power of two, containing noisy data to
          be thresholded.

alpha, beta: Hyperparameters which determine the priors placed on the
          wavelet coefficients. Both 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: This selects the smoothness of wavelet that you want to
          use in the decomposition. By default this is 10, the
          Daubechies least-asymmetric orthonormal compactly supported
          wavelet with 10 vanishing moments. 

          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: Specifies the family of wavelets that you want to use. Two
          popular options are "DaubExPhase" and "DaubLeAsymm" but see
          the help for filter.select for more possibilities. 

          This argument is ignored for the ``wavelets on the interval''
          transform ('bc="interval"').

      bc: Specifies the boundary handling. If '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: This argument supplies the function to be used to compute the
          spread of the absolute values coefficients. The function
          supplied must return a value of spread on the variance scale
          (i.e. not standard deviation) such as the 'var()' function. A
          popular, useful and robust alternative is the 'madmad'
          function.

      j0: The primary resolution level. While BayesThresh thresholds at
          all resolution levels, j0 is used in assessing the universal
          threshold which is used in the empirical Bayes estimation of
          hyperparameters.

  plotfn: If TRUE, BAYES.THR draws the noisy data and the thresholded
          function estimate.

_D_e_t_a_i_l_s:

     A mixture prior consisting of a zero-mean normal distribution and
     a point mass at zero is placed on each wavelet coefficient. The
     empirical coefficients are then calculated and the priors updated
     to give posterior distributions for each coefficient. The
     thresholded value of each coefficient is the median of that
     coefficient's posterior distribution. See Abramovich, Sapatinas, &
     Silverman (1998) for more details of the procedure; the help page
     for 'threshold.wd' has more information about wavelet thresholding
     in general. 

     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).

_V_a_l_u_e:

     A vector containing the thresholded estimate of the function from
     which the data was drawn.

_R_E_L_E_A_S_E:

     3.9.5 Code by Fanis Sapatinas/Felix Abramovich Documentation by
     Stuart Barber

_S_e_e _A_l_s_o:

     'threshold.wd', 'wd'

_E_x_a_m_p_l_e_s:

     #
     # Generate some noisy test data and plot it.
     #
     #blocks.data <- test.data(type="blocks", rsnr=4, n=1024, plotfn=TRUE) 
     #
     # Now try BAYES.THR with the default parameters.
     #
     #blocks.thr <- BAYES.THR(blocks.data$ynoise, plotfn=TRUE))  
     #
     # 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=TRUE, filter.number=1,
     #        family = "DaubExPhase", alpha=4, beta=1)) 
     #
     # Here, the extreme values of the function are being smoothed towards zero.
     #

