Shannon.entropy          package:wavethresh          R Documentation

_C_o_m_p_u_t_e _S_h_a_n_n_o_n _e_n_t_r_o_p_y

_D_e_s_c_r_i_p_t_i_o_n:

     Computes Shannon entropy of the squares of a set of coefficients.

_U_s_a_g_e:

     Shannon.entropy(v, zilchtol=1e-300)

_A_r_g_u_m_e_n_t_s:

       v: A vector of coefficients (e.g. wavelet coefficients).

zilchtol: A small number. Any number smaller than this is considered to
          be zero for the purposes of this function.

_D_e_t_a_i_l_s:

     This function computes the Shannon entropy of the squares of a set
     of coefficients. The squares are used because we are only
     interested in the entropy of the energy of the coefficients, not
     their actual sign. 

     The entropy of the squares of 'v' is given by 'sum( v^2 * log(v^2)
     )'. In this implementation any zero coefficients (determined by
     being less than 'zilchtol') have a zero contribution to the
     entropy. 

     The Shannon entropy measures how "evenly spread" a set of numbers
     is. If the size of the entries in a vector is approximately evenly
     spread then the Shannon entropy is large. If the vector is
     sparsely populated or the entries are very different then the
     Shannon entropy is near zero. Note that the input vectors to this
     function usually have their norm normalized so that diversity of
     coefficients corresponds to sparsity.

_V_a_l_u_e:

     A number representing the Shannon entropy of the input vector.

_R_E_L_E_A_S_E:

     Version 3.7.2 Copyright Guy Nason 1996

_S_e_e _A_l_s_o:

     'MaNoVe.wst', 'wst',

_E_x_a_m_p_l_e_s:

     #
     # Generate some test data
     #
     #
     # A sparse set
     #
     #Shannon.entropy(c(1,0,0,0))
     #0
     #
     # A evenly spread set
     #
     #Shannon.entropy( rep( 1/ sqrt(4), 4 ))
     #1.386294

