dof                package:wavethresh                R Documentation

_C_o_m_p_u_t_e _n_u_m_b_e_r _o_f _n_o_n-_z_e_r_o _c_o_e_f_f_i_c_i_e_n_t_s _i_n _w_d _o_b_j_e_c_t

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

     Compute number of non-zero coefficients in 'wd' object

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

     dof(wd)

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

      wd: A 'wavelet decomposition' object (such as that returned by
          the 'wd' function).

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

     Very simple function that counts the number of non-zero
     coefficients in a 'wd' class object.

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

     An integer that represents the number of non-zero coefficients in
     the input 'wd' object.

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

     Version 3.0 Copyright Guy Nason 1994

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

     'wd', 'wd.object', 'threshold', 'threshold.wd'.

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

     #
     # Let's generate some purely random numbers!!
     #
     #myrandom <- rnorm(512)
     #
     # Take the discrete wavelet transform
     #
     #myrandomWD <- wd(myrandom)
     #
     # How many coefficients are non-zero?
     #
     #dof(myrandomWD)
     # [1] 512
     #
     # All of them were nonzero!
     #
     # Threshold it
     #
     #myrandomWDT <- threshold(myrandomWD, policy="universal")
     #
     # Now lets see how many are nonzero
     #
     #dof(myrandomWDT)
     # [1] 8
     #
     # Wow so 504 of the coefficients were set to zero! Spooky!
     #

