wfromx {EbayesThresh} | R Documentation |
Find Empirical Bayes weight from data
Description
Suppose the vector is such that
is
drawn independently from a normal distribution with mean
and standard deviation
(s_i equals 1
for Cauchy prior). The prior distribution of the
is a mixture with probability
of zero
and probability
of a given symmetric heavy-tailed distribution.
This routine finds the marginal maximum likelihood estimate of the
parameter
.
Usage
wfromx(x, s = 1, prior = "laplace", a = 0.5, universalthresh = TRUE)
Arguments
x |
Vector of data. |
s |
A single value or a vector of standard deviations if the
Laplace prior is used. If a vector, must have the same length as
|
prior |
Specification of prior to be used; can be
|
a |
Scale factor if Laplace prior is used. Ignored if Cauchy prior is used. |
universalthresh |
If |
Details
The weight is found by marginal maximum likelihood.
The search is over weights corresponding to threshold in the
range
if
universalthresh=TRUE
, where is the length of the data
vector and
(s_i is 1 for Cauchy prior) is the
vector of sampling standard deviation of data
;
otherwise, the search is over
.
The search is by binary search for a solution to the equation
, where
is the derivative of the log likelihood.
The binary search is on a logarithmic scale in
.
If the Laplace prior is used, the scale parameter is fixed at the value
given for a
, and defaults to 0.5 if no value is provided. To
estimate a
as well as w
by marginal maximum likelihood,
use the routine wandafromx
.
Value
The numerical value of the estimated weight.
Author(s)
Bernard Silverman
References
See ebayesthresh
and
http://www.bernardsilverman.com
See Also
wandafromx
, tfromx
,
tfromw
, wfromt
Examples
wfromx(x = rnorm(100, s = c(rep(0,90),rep(5,10))), prior = "cauchy")