Suppose a sequence of data has underlying mean vector with elements
\(\theta_i\). Given the sequence of data, and a vector of scale
factors cs
and a lower limit pilo
, this routine finds the
marginal maximum likelihood estimate of the parameter zeta
such
that the prior probability of \(\theta_i\) being nonzero is of the
form median(pilo, zeta*cs, 1)
.
zetafromx(xd, cs, pilo = NA, prior = "laplace", a = 0.5)
A vector of data.
A vector of scale factors, of the same length as xd
.
The lower limit for the estimated weights. If
pilo=NA
it is calculated according to the sample size to be
the weight corresponding to the universal threshold \(\sqrt{2
\log n}\).
Specification of prior to be used conditional on the mean
being nonzero; can be cauchy
or laplace
.
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.
A list with the following elements:
The value of zeta
that yields the marginal maximum
likelihood.
The weights (prior probabilities of nonzero) yielded by this
value of zeta
.
The factors as supplied to the program.
The lower bound on the weight, either as supplied or as calculated internally.
An exact algorithm is used, based on splitting the range up for
zeta
into subintervals over which no element of zeta*cs
crosses either pilo
or 1.
Within each of these subintervals, the log likelihood is concave and its maximum can be found to arbitrary accuracy; first the derivatives at each end of the interval are checked to see if there is an internal maximum at all, and if there is this can be found by a binary search for a zero of the derivative.
Finally, the maximum of all the local maxima over these subintervals is found.