wr                package:wavethresh                R Documentation

_D_i_s_c_r_e_t_e _w_a_v_e_l_e_t _t_r_a_n_s_f_o_r_m (_r_e_c_o_n_s_t_r_u_c_t_i_o_n).

_D_e_s_c_r_i_p_t_i_o_n:

     This function performs the reconstruction stage of Mallat's
     pyramid algorithm, i.e., the discrete inverse wavelet transform.

_U_s_a_g_e:

     wr(wd, start.level = 0, verbose = getOption("verbose"),
        bc = wd$bc, return.object = FALSE,
        filter.number = wd$filter$filter.number, family = wd$filter$family)

_A_r_g_u_m_e_n_t_s:

      wd: A wavelet decomposition object as returned by 'wd', see
          'wd.object'.

start.level: integer; the level at which to start reconstruction. This
          is usually the first (level 0).

bc, filter.number, family: by default part of the 'wd' object, but can
          specified differently by the ``knowing''.

 verbose: logical, controlling the printing of ``informative'' messages
          whilst the computations progress.  Such messages are
          generally annoying so it is turned off by default.

return.object: logical; If this is FALSE then the top level of the
          reconstruction is returned (this is the reconstructed
          function at the highest resolution). Otherwise if it is T the
          whole wd reconstructed object is returned. 

_D_e_t_a_i_l_s:

     The code implements Mallat's pyramid algorithm (Mallat 1989). In
     the reconstruction the quadrature mirror filters G and H are
     supplied with c0 and d0, d1, .., d(m-1) (the wavelet coefficients)
     and rebuild c1, .., cm.

     If 'wd' was obtained directly from 'wd()' then the original
     function can be reconstructued *exactly* as cm and can be sought
     with 'accessC(wd.object, level=wd.object$levels)'.

     Usually, the 'wd' object has been modified in some way, for
     example, some coefficients set to zero by threshold. 'Wr' then
     reconstructs the function with that set of wavelet coefficients.

_V_a_l_u_e:

     Either a vector containing the top level reconstruction or an
     object of class 'wd' containing the results of the reconstruction,
     details to be found in the documentation for 'wd.object'.

_R_E_L_E_A_S_E:

     Release 2.2 Copyright Guy Nason 1993

_R_e_f_e_r_e_n_c_e_s:

     see 'wd' for a list.

_S_e_e _A_l_s_o:

     'wd', 'accessC', 'accessD', 'filter.select', 'threshold'.

_E_x_a_m_p_l_e_s:

     # Decompose and then exactly reconstruct test.data
     example(wd)#-> wds has wd() ressult
     rec.wds <- wr(wds)
     rec.wds.obj <- wr(wds, return.object = TRUE)
     rec.wds2 <- accessC(rec.wds.obj, level=rec.wds.obj$nlevels)
     all(rec.wds == rec.wds2)# since wr() internally uses accessC()

     # Look at accuracy of reconstruction
     summary(abs(rec.wds - y)) #~ 10^-11

     # Reconstruct a hard.thresholded object, look at the wavelet coefficients
     summary(thr.wds <- wr(threshold(wds, type="hard") ))

