ebayesthresh          package:EbayesThresh          R Documentation

_E_m_p_i_r_i_c_a_l _B_a_y_e_s _t_h_r_e_s_h_o_l_d_i_n_g _o_n _a _s_e_q_u_e_n_c_e

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

     Given a sequence of data, performs Empirical Bayes thresholding, 
     as discussed in Johnstone and Silverman (2004).

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

     ebayesthresh(x, prior = "laplace", a = 0.5, bayesfac = FALSE, 
            sdev = NA, verbose = FALSE, threshrule = "median")

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

       x: vector of data values

   prior: specification of prior to be used  conditional on the mean
          being nonzero;  can be 'cauchy' or 'laplace' 

       a: scale factor if Laplace prior is used.   Ignored if Cauchy
          prior is used.  If, on entry, 'a=NA' and 'prior="laplace"',
          then the scale  parameter will also be estimated by marginal
          maximum likelihood.  If 'a' is not specified then the default
          value 0.5 will be used. 

bayesfac: if 'bayesfac=TRUE', then whenever a threshold is explicitly 
          calculated, the Bayes factor threshold will be used 

    sdev: the sampling standard deviation of the data 'x'.  If, on
          entry, 'sdev=NA', then the standard deviation will be 
          estimated using the median absolute deviation from zero,  as
          'mad(x, center=0)'. 

 verbose: controls the level of output. See below.

threshrule: specifies the thresholding rule to be applied to the data. 
          Possible values are 'median' (use the posterior median); 
          'mean' (use the posterior mean);  'hard' (carry out hard
          thresholding);  'soft' (carry out soft thresholding);  'none'
          (find various parameters, but do not carry out any
          thresholding). 

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

     It is assumed that the data vector (x_1, ..., x_n) is such that
     each  x_i is drawn independently from a normal distribution with
     mean  theta_i and variance sigma^2. The prior distribution of each
     theta_i is a mixture with probability  1-w of zero and probability
     w of a given symmetric heavy-tailed distribution. The mixing
     weight w is estimated by marginal maximum likelihood. Given the
     mixing weight, and possibly a scale factor in the symmetric
     distribution, are estimated by marginal  maximum likelihood.   
     The resulting values are used as the hyperparameters in the prior.

     The parameters can be estimated as the posterior median or the
     posterior mean given the data, or by hard or soft thresholding
     using the posterior median threshold.   If hard or soft
     thresholding is chosen, then there is the additional choice of
     using the Bayes factor threshold, which is the value such that 
     the posterior probability of zero is  exactly half if the data
     value is equal to the threshold.

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

     If 'verbose=FALSE', a vector giving the values of the estimates of
     the underlying mean vector.

     If 'verbose=TRUE', a list with the following elements: 

   muhat: the estimated mean vector (omitted if 'threshrule="none"')

      x : the data vector as supplied

threshold.sdevscale: the threshold as a multiple of the standard
          deviation 'sdev'

threshold.origscale: the threshold measured on the original scale of
          the data

   prior: the prior that was used

       w: the mixing weight as estimated by marginal maximum likelihood

       a: (only present if Laplace prior used) the scale factor as
          supplied or estimated

bayesfac: the value of the parameter 'bayesfac', determining whether
          Bayes factor or posterior median thresholds are used

    sdev: the standard deviation of the data as supplied or estimated

threshrule: the thresholding rule used, as specified above

_A_u_t_h_o_r(_s):

     Bernard Silverman

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

     Johnstone, I. M. and Silverman, B. W. (2004)   Needles and straw
     in haystacks:  Empirical Bayes estimates of  possibly sparse
     sequences.   _Annals of Statistics_, *32*, 1594-1649.

     Johnstone, I. M. and Silverman, B. W. (2004)  EbayesThresh:  R
     software for Empirical Bayes thresholding.   _Journal of
     Statistical Software_. To appear.

     Johnstone, I. M. (2004)  `Function Estimation and Classical Normal
     Theory'  `The Threshold Selection Problem'.   The Wald Lectures I
     and II, 2004.  Available from  <URL:
     http://www-stat.stanford.edu/~imj/>.

     Johnstone, I. M. and Silverman, B. W. (2005)   Empirical Bayes
     selection of wavelet thresholds. _Annals of Statistics_, *33*, to
     appear.

     The papers by Johnstone and Silverman are available from <URL:
     http://www.bernardsilverman.com>.   

     See also <URL: http://www-stat.stanford.edu/~imj/> for further
     references,  including the draft of a monograph by I. M.
     Johnstone.

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

     'tfromx', 'threshld'

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

     ebayesthresh(x=rnorm(100, c( rep(0,90), rep(5,10))), prior="cauchy", sdev=NA)

