wandafromx           package:ebayesthresh           R Documentation

_F_i_n_d _w_e_i_g_h_t _a_n_d _s_c_a_l_e _f_a_c_t_o_r _f_r_o_m _d_a_t_a _i_f _L_a_p_l_a_c_e _p_r_i_o_r _i_s _u_s_e_d

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

     Given a vector of data, find the marginal maximum likelihood
     choice of both weight and scale factor under the Laplace prior.

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

     wandafromx(x)

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

       x: a vector of data

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

     The parameters are found by marginal maximum likelihood.  The
     search is over weights corresponding to thresholds in the range
     [0, sqrt(2 log n)], where n is the length of the data vector. The
     search uses a nonlinear optimization routine ('optim' in R) to
     minimize the negative log likelihood function 'negloglik.laplace'.
      The range over which the scale factor is searched is (0.04, 3).

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

     A list with values 

       w: The estimated weight

       a: The estimated scale factor

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

     Bernard Silverman

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

     See 'ebayesthresh' and <URL: http://www.bernardsilverman.com>

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

     'wfromx', 'tfromw'

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

     wandafromx(rnorm(100, c( rep(0,90), rep(5,10))))

