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!
     #

