postmed {EbayesThresh} | R Documentation |
Posterior median estimator
Description
Given a single value or a vector of data and sampling standard deviations (sd is 1 for Cauchy prior), find the corresponding posterior median estimate(s) of the underlying signal value(s).
Usage
postmed(x, s, w = 0.5, prior = "laplace", a = 0.5)
postmed.laplace(x, s = 1, w = 0.5, a = 0.5)
postmed.cauchy(x, w)
cauchy.medzero(x, z, w)
Arguments
x |
A data value or a 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
|
w |
The value of the prior probability that the signal is nonzero. |
prior |
Family of the nonzero part of the prior; can be
|
a |
The scale parameter of the nonzero part of the prior if the Laplace prior is used. |
z |
The data vector (or scalar) provided as input to
|
Details
The routine calls the relevant one of the routines
postmed.laplace
or postmed.cauchy
. In the Laplace case,
the posterior median is found explicitly, without any need for the
numerical solution of an equation. In the quasi-Cauchy case, the
posterior median is found by finding the zero, component by component,
of the vector function cauchy.medzero
.
Value
If is a scalar, the posterior median
where
is
the mean of the distribution from which
is drawn. If
is
a vector with elements
and
is a vector with
elements
(s_i is 1 for Cauchy prior), then the
vector returned has elements
, where each
has mean
and standard deviation
, all with the
given prior.
Note
If the quasicauchy prior is used, the argument a
and
s
are ignored. The routine calls the approprate one of
postmed.laplace
or postmed.cauchy
.
Author(s)
Bernard Silverman
References
See ebayesthresh
and
http://www.bernardsilverman.com
See Also
Examples
postmed(c(-2,1,0,-4,8,50), w = 0.05, prior = "cauchy")
postmed(c(-2,1,0,-4,8,50), s = 1:6, w = 0.2, prior = "laplace", a = 0.3)