Suppose the vector
wfromx(x, s = 1, prior = "laplace", a = 0.5, universalthresh = TRUE)
Vector of data.
A single value or a vector of standard deviations if the
Laplace prior is used. If a vector, must have the same length as
x
. Ignored if Cauchy prior is used.
Specification of prior to be used; can be
"cauchy"
or "laplace"
.
Scale factor if Laplace prior is used. Ignored if Cauchy prior is used.
If universalthresh = TRUE
, the
thresholds will be upper bounded by universal threshold;
otherwise, the thresholds can take any non-negative values.
The numerical value of the estimated weight.
The weight is found by marginal maximum likelihood.
The search is over weights corresponding to threshold universalthresh=TRUE
, where
The search is by binary search for a solution to the equation
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
.
# NOT RUN {
wfromx(x = rnorm(100, s = c(rep(0,90),rep(5,10))), prior = "cauchy")
# }
Run the code above in your browser using DataLab